Repository navigation
fix(anthropic): log requested speed metadata - #986
Merged
Abhijeet Prasad (AbhiPrasad) merged 1 commit intoOct 20, 2026
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Abhijeet Prasad (AbhiPrasad)
added a commit
that referenced
this pull request
Oct 20, 2026
…PyPI (#987) claude-agent-sdk 0.1.9–0.1.17 were deleted from PyPI, so `test_claude_agent_sdk(0.1.10)` can no longer install and fails every `nox` shard (seen on #986; `main` breaks the same way on its next run). The `exclude-newer` cutoff in the logs is not the cause. **Matrix** - Swap the old-version entry from 0.1.10 to 0.1.18, the oldest installable release. Re-recorded `cassettes/0.1.18/` and removed `cassettes/0.1.10/`. - `min_version` stays `0.1.10`; comments explain why the tested floor is higher. - 0.1.18 still needs the mcp 1.x constraint (`Server.list_tools()`). **Tracing fix (old CLIs)** CLIs bundled before 2.1 (2.0.72 in SDK 0.1.18) call the subagent tool `Task` and emit no `task_started` / `task_notification` messages, so subagent runs produced no task spans. Both tool names are now recognised. When a subagent message arrives with no task span yet, a task span is synthesized from the tool call under its `Task`/`Agent` tool span. It ends when the orchestrator gets that tool's result. In every latest cassette `task_started` arrives before the subagent's messages, so the fallback doesn't fire there. **Tests** - Version gates assumed only 0.1.10 vs latest. Bisecting PyPI sdists gave the real versions: string prompts over stream-json in 0.1.31, top-level assistant `error` parsing in 0.1.29. - SDK API fields (`verbatim_prompts`, `AssistantMessage.usage`, `ResultMessage.model_usage`) are feature-detected instead of version-pinned. - Removed dead 0.1.10 branches, including silent early `return`s that reported passes without asserting. - The bundled-subagent tests now run on 0.1.18. The background-agent case skips only when the run streamed no subagent messages or task events. - The cassette transport won't save a recording with no `result` message, so a failed or hung recording can't leave a truncated cassette. Gate waits use `transport.wait_timeout` (short on replay, long when recording). **Test consolidation** - Merged the interleaved and five-parallel subagent cassette tests into the concurrent subagent test. It now also asserts per-subagent tool pairing, task-to-`Agent`-tool parenting and end ordering, and that parallel `Agent` calls share one orchestrator LLM span despite relay user messages. - Dropped four `FakeClaudeSDKClient` subagent tests whose claims those cassettes now assert on real streams. **Span ordering fix** A subagent's last LLM span stayed open until request cleanup after its TASK span closed. This happened on the existing `task_notification` path (latest) and on the synthesized path. The LLM span is now finalized first. **Orchestrator parenting fix** `_llm_parent_for_message` fell back to the most recent open task span for any assistant message without a `parent_tool_use_id`. Every supported SDK tags subagent messages, so the fallback only caught orchestrator turns (e.g. `TaskOutput` polling while background subagents run) and nested them under a subagent's task. Those turns now parent to the root, asserted in `test_multiple_bundled_subagents_keep_outer_orchestration_separate`. That made the `llm_parent_export` merge guard and `_message_starts_subagent_tool` dead, so they're removed. **Validation** - `nox -s "test_claude_agent_sdk(0.1.18)"` (CI mode): 37 passed, 6 skipped - `nox -s "test_claude_agent_sdk(latest)"` (CI mode): 43 passed - `make check-stale-cassettes`, `make check-unused-cassettes INTEGRATIONS=claude_agent_sdk`, pre-commit, pylint: clean Separate from #986's Anthropic `speed` change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Abhijeet Prasad (AbhiPrasad)
force-pushed
the
abhi/anthropic-speed-metadata-d8651289
branch
from
October 20, 2026 19:14
24f51cb to
56dfa50
Compare
Abhijeet Prasad (AbhiPrasad)
deleted the
abhi/anthropic-speed-metadata-d8651289
branch
October 20, 2026 23:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
speedparameter in span metadata.Closes #972