Skip to content

Keep a Run's classification across later errors - #708

Merged
SaladDay merged 1 commit into
mainfrom
keep-a-runs-classification-across-later-errors
Oct 14, 2026
Merged

SaladDay merged 1 commit into
mainfrom
keep-a-runs-classification-across-later-errors

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Found while verifying #704 on mx: claude_sdk Turns against an unresolvable model host failed at the right time but diagnostics said harness_error. The bridge classified connection_failed correctly (checked inside a generation-3 sandbox), then:

  1. the bridge reports a failed Turn's settlement as unconfirmed (packages/claude-sdk-adapter/src/adapter.ts),
  2. the Claude adapter turns that into a settlement error (claudesdk/executor_turn.go),
  3. the daemon forwards a second error frame, "executor Turn settlement failed", without a code (dispatch/prepared_handoff.go),
  4. Core's Result.mergeObservation replaced engine_error_code on every error frame, so the second frame erased it.

All three stored claude outcomes on mx were {"error":"executor Turn settlement failed","error_code":"engine_failed"} with no engine_error_code, so every hosted Claude failure (authentication, rate limits, …) reached diagnostics unclassified.

A frame without an accepted code now leaves the stored classification in place; a later accepted code still replaces it. docs/runtime-protocol.md (and zh) states the rule. Harness-neutral, one place, used by both live delivery and terminal journal draining.

Checks: go test ./internal/execution/ (whole package), go vet; translation coverage and freshness.


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

@SaladDay
SaladDay merged commit 1816225 into main Oct 14, 2026
19 checks passed
@SaladDay
SaladDay deleted the keep-a-runs-classification-across-later-errors branch October 14, 2026 11:22
On hosted Claude Sessions the bridge sends its classified error and then reports the Turn settlement as unconfirmed; the daemon forwards that as a second error frame, "executor Turn settlement failed", without a code, and Core overwrote the stored engine_error_code with every error frame. Every Claude failure therefore reached diagnostics as harness_error. A frame without an accepted code now leaves the stored classification in place; a later accepted code still replaces it. The Core–Runtime protocol states the rule.
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