Description
PR #2394 (#2389) adds the capture_pprof agent command (heap/goroutine profiles returned base64 via the command result, no listener). Making it AI-invokable was deliberately deferred because MCP tool registration requires a multi-site sweep, and partial registration is a known drift trap (the AI gate reads TWO maps — a tool registered in one but not the other silently misbehaves).
Proposed Fix
Register capture_agent_pprof following the set_agent_log_level pattern (apps/api/src/services/aiToolsAgentLogs.ts:150-230), covering ALL registration sites in one PR:
- SDK tool map / registry hub
- guardrails permission map AND rate-limit map (both — dual-map drift)
- approval switch (approval-gated, Tier-2, like other device-touching diagnostics)
- tool schemas
- web tierConfig (×3 sites)
Result should surface profile metadata (sizes, capture time) and hand back the artifact in a way the chat UI can offer for download, not a giant inline base64 blob in the transcript.
Blocked On
PR #2394 — the agent command and CAPTURE_PPROF command type only exist on that branch.
Affected Files
apps/api/src/services/aiToolsAgentLogs.ts (or a new aiToolsDiag file per the hub/per-domain pattern)
- guardrails + tierConfig registration sites
Refs #2389.
Description
PR #2394 (#2389) adds the
capture_pprofagent command (heap/goroutine profiles returned base64 via the command result, no listener). Making it AI-invokable was deliberately deferred because MCP tool registration requires a multi-site sweep, and partial registration is a known drift trap (the AI gate reads TWO maps — a tool registered in one but not the other silently misbehaves).Proposed Fix
Register
capture_agent_pproffollowing theset_agent_log_levelpattern (apps/api/src/services/aiToolsAgentLogs.ts:150-230), covering ALL registration sites in one PR:Result should surface profile metadata (sizes, capture time) and hand back the artifact in a way the chat UI can offer for download, not a giant inline base64 blob in the transcript.
Blocked On
PR #2394 — the agent command and
CAPTURE_PPROFcommand type only exist on that branch.Affected Files
apps/api/src/services/aiToolsAgentLogs.ts(or a new aiToolsDiag file per the hub/per-domain pattern)Refs #2389.