Skip to content

Report official Turn error codes on the stream - #847

Merged
SaladDay merged 2 commits into
mainfrom
report-official-turn-error-codes-on-the-stream
Oct 23, 2026
Merged

SaladDay merged 2 commits into
mainfrom
report-official-turn-error-codes-on-the-stream

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Journaled Turn snapshots stripped the whole outcome, so agent.session.turn.failed events always reported internal_error while Turn reads reported the classified official code. Snapshots now keep only Core's error_code and the normalized model category; native codes, text, HTTP status and the Runtime result stay out of the journal.
  • runtime_unavailable also covers Core failing to dispatch a Turn (execution_unavailable), so it now reports internal_error. Only a Runtime that disconnected or failed its preparation reports sandbox_error.
  • Docs that still described the generic Turn error or the "never repeat caller input" rule (now broken by the official unknown-tool-call message) are corrected, with zh.

Checks

  • go test sessions and api; go vet on both.
  • DB: TestNativeClassificationPostgresRoundTripAndPublicPrivacy (now also asserts the streamed failed Turn carries the same public code).
  • node --test website/tests/translations.test.mjs: hash tests pass; the inline-literals test needs vitepress, which is not installed locally.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Journaled Turn snapshots dropped the whole outcome, so every agent.session.turn.failed event reported internal_error while reads reported the classified code. Snapshots now keep Core's error code and the normalized model category, and nothing native.

runtime_unavailable also covers Core failing to dispatch a Turn, so it reports internal_error; only a Runtime that disconnected or failed its preparation is sandbox_error. Docs that still described the generic Turn error and the old message rule are corrected.
@SaladDay
SaladDay merged commit fc7f7df into main Oct 23, 2026
19 checks passed
@SaladDay
SaladDay deleted the report-official-turn-error-codes-on-the-stream branch October 23, 2026 21:17
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