🤖 feat: add opt-in AgentPond tracing - #3772
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93bafb8214
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| onEnd: flushAgentPondTracing, | ||
| onAbort: flushAgentPondTracing, | ||
| onError: flushAgentPondTracing, |
There was a problem hiding this comment.
Restrict forced flushes to short-lived CLI shutdown
When tracing uses a remote or slow Files SDK provider, these async integration hooks force an export after every successful, aborted, or failed turn, so stream completion can wait for network I/O or the exporter's timeout. Because the same telemetry object is attached by the shared StreamManager, long-lived Electron and server sessions also pay this CLI-durability cost and receive no batching benefit; force-flush only when an actual short-lived CLI process is exiting, or make the per-turn flush bounded and non-blocking.
AGENTS.md reference: AGENTS.md:L10-L10
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in a3e57c7. The AI SDK integration no longer registers per-turn onEnd / onAbort / onError flush hooks, so normal long-lived turns use the batch processor as intended; the explicit lifecycle/test flush helper remains available. The 105 focused tracing and stream-manager tests pass (1 existing credential-gated skip). A fresh production StreamManager.createStreamResult E2E run completed with the AI SDK mock model, then flushed at the validation lifecycle boundary and read back 1 object / 4 events: trace 7da03f7d77d9cc673d3d153ff9bc9cf3, generation 2ebfce5734f2b1c1, with null trace/observation input/output and no prompt/response sentinels in the raw store. make static-check also passed ESLint, both TypeScript targets, formatting, generated-content, eager-import, code-link, and shell checks before the local Homebrew Hadolint 2.15.0 rejected an unchanged Dockerfile line that the repo's pinned 2.12.0 accepts.
Summary
StreamManager → streamTextpathValidation
bun install --frozen-lockfilemake static-check(all project checks passed; Hadolint was rerun with the CI-pinned v2.12.0 because Homebrew v2.15 adds a warning for an unchanged Dockerfile line)bun test src/node/services/streamManager.test.ts src/node/services/streamManager.modelOnlyNotifications.test.ts— 105 passed, 1 existing credential-gated test skippedStreamManager.createStreamResultpath with AI SDK'sMockLanguageModelV3, consumed the stream, synced the local Files SDK store, and read trace970445ba8cfaea3856d3d6c1bcbbaac5backb6b86e88b4319dd1, providermux-agentpond-e2e, modelfixture-modelConfiguration and limitations
AgentPond tracing is independent of Mux's anonymous usage telemetry. It activates only when
FILES_SDK_PROVIDERand the selected Files SDK provider variables are present before startup. The integration intentionally records no prompt or response bodies.Generated with
mux• Model:codex/gpt-5• Thinking:high• Cost:$unknown