Skip to content

feat: trace Agent execution and MCP preparation - #1161

Draft
ustccjw001 wants to merge 17 commits into
volcengine:mainfrom
ustccjw001:feat/performance-diagnostics
Draft

ustccjw001 wants to merge 17 commits into
volcengine:mainfrom
ustccjw001:feat/performance-diagnostics

Conversation

@ustccjw001

@ustccjw001 ustccjw001 commented Oct 10, 2026 •

Copy link
Copy Markdown

Adds per-call timing for Codex model requests, remote Worker requests/SSE subscriptions, retrieval/memory operations and database-backed session event persistence through the existing OTel provider/exporter. Storage timing preserves explicit database URL precedence and caller-owned services, measures ADK storage operations rather than individual SQL statements, and does not collect payloads or database URLs.

Restores ordinary MCP discovery/calls by avoiding recursive session locking, forwarding native ADK transport/session arguments and retaining non-vendor headers. Adds fixed-metadata mcp.tools.prepare and mcp.session.acquire spans to Trusted toolsets and native/VeIdentity instances assembled by VeADK Agent. Instance adaptation retains managers, callbacks, credentials, caches and retries; it is idempotent and deepcopy preserves copied ownership. Shared ADK classes and unrelated tools are unchanged. Overlapping preparation/acquisition durations must not be summed or interpreted as pure network time.

VeIdentity sends only current W3C traceparent/tracestate in each MCP request's meta, leaving credential headers and pool keys unchanged. No-span calls preserve the original shape; extraction failures do not block or repeat business calls. Retry logs retain function/error type without private exception text.

Synchronized to current main c1d4096, retaining its request/model/first-output timing documentation in both languages. The upstream explicit-URL regression now checks real SQLite session creation/readback and URL precedence rather than the old internal constructor mock. Documentation type checking generates Next route types before the MDX index, preventing an empty generated server module without changing compiler checks, dependencies or site configuration.

Validation on ecba26a:

  • Full parallel Python regression: 8,050 passed, 50 skipped, four xfailed and 88 warnings in 442.61 seconds; codex_smoke and piagent_smoke excluded. Endpoint/persistence/model timing regression: 90 passed. All-files pre-commit passed, including both secret scanners and runtime dependency policy. The first full run's obsolete constructor-mock failure and its correction remain in the bilingual synchronization design.
  • Python 3.12.14, Google ADK 2.7.1, OpenTelemetry 1.42.1 and MCP 1.26.0; runtime dependency metadata and lock files unchanged. Tested follow-up hashes and the production Python tree were checked after the final documentation commit.
  • Documentation production build and the corrected types:check script passed. Initial TS2306 failures remain recorded; generated files were not patched.
  • Earlier local HTTP MCP/archive/tracer fixture checks cover distinct per-call parents, context restoration, session close, wrong-base rejection and bootstrap tracer reuse. Earlier isolated cloud fixtures verify Trusted/native preparation and automatic Agent instrumentation in APMPlus. V28 uses synthetic model configuration and verifies the VeIdentity post-credential path; it does not invoke a real identity provider or model.
  • Earlier SDK ASGI checks cover /run, /run_sse and /invoke with real SQLite saves under the request Trace/diagnostic Run. Receiver-side per-call association is tracked separately in feat(runtime): correlate request traces and execution timing agentkit-sdk-python#188.

Hosted verification workflows await maintainer approval; release workflows are outside this validation scope. Real credential-provider authorization, deployed direct-URL persistence, Sandbox internal phases and remote Worker receipt remain separate acceptance checks. Non-streaming calls do not provide model TTFT; SSE duration includes consumer time. Draft only; no merge, publication or deployment.

@ustccjw001 ustccjw001 changed the title feat(codex): trace model requests under agent invocation feat: trace Codex model and remote Worker requests Oct 10, 2026
@ustccjw001 ustccjw001 changed the title feat: trace Codex model and remote Worker requests feat: trace Codex, Worker and retrieval operations Oct 10, 2026
@ustccjw001 ustccjw001 changed the title feat: trace Codex, Worker and retrieval operations feat: trace Codex, Worker, retrieval and session persistence Oct 10, 2026
@ustccjw001
ustccjw001 force-pushed the feat/performance-diagnostics branch 2 times, most recently from ef6a40b to 2706f43 Compare October 27, 2026 04:07
@ustccjw001 ustccjw001 changed the title feat: trace Codex, Worker, retrieval and session persistence feat: trace Agent execution and MCP preparation Oct 27, 2026
@ustccjw001
ustccjw001 force-pushed the feat/performance-diagnostics branch from b62f217 to ecba26a Compare October 28, 2026 13:28

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant