Skip to content

feat(core): align agent streams and scoped usage across ports - #74

Open
upsetbit wants to merge 4 commits into
masterfrom
feat/stream-contracts
Open

upsetbit wants to merge 4 commits into
masterfrom
feat/stream-contracts

Conversation

@upsetbit

@upsetbit upsetbit commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Claude Code now selects the final root answer across partial messages, task notifications and intermediate results. The event API exposes parent tool-use IDs, task metrics and summaries, structured results, thinking tokens and typed startup failures.
  • Codex CLI now exposes cache writes, message phases, checklist updates, web-search actions and optional results, and MCP arguments, results and errors. Requests can fork a thread. Reports prefer the latest root final_answer and fall back to the last completed root message.
  • Grok Build now preserves failed command status when a tool returns a nonzero exit code. The Messages stream supports opt-in partial events and structured results. The documentation explains which token counters its alternate native stream can report.
  • All five language APIs expose optional invocation and session usage alongside the existing usage fields. This keeps a resumed session's cumulative balance from being counted as new consumption. Raw events remain available.
  • Rust consumers with exhaustive event matches may need to handle the added variants.

Regression coverage

  • Replay stale Claude results after newer assistant messages, including duplicate text across parent and child scopes. Verify failure reason precedence on error frames and the latest structured value across multiple result frames.
  • Replay Codex commentary-only streams and optional JSON fields containing explicit nulls. Verify typed .NET decode errors carry the offending line and raw JSON. Exercise independent Go usage snapshots by mutating the invocation counters and per-model map.

Verification

The full local suite passed with devbox run -- just ci, including packaging checks.

  • Added shared JSONL regressions and tests for Go, Rust, Node.js, Python and .NET. CI runs all five implementations when the shared streams change.
  • Ran the Go wrapper against Codex 0.173, Claude Code 2.1.336 and Grok Build 1.0.98. Each returned the requested JSON. Claude and Grok also returned structured values and partial frames. Codex returned JSON in the final answer text.
  • A separate unified Grok CLI 2.0.13 executable returned Not signed in and num_turns: 0 in three probes. The Grok changes target the Build CLI's Messages stream.

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