Skip to content

[NO-JIRA] Add kind and message to session/prompt turn_failed error data (R15) - #24

Merged
johnnymo87 merged 2 commits into
patched/v1.60.2from
r15-turn-error-kind
Nov 22, 2026
Merged

johnnymo87 merged 2 commits into
patched/v1.60.2from
r15-turn-error-kind

Conversation

@johnnymo87

Copy link
Copy Markdown
Owner

Description

Port of fork patch 15 onto v1.60.2 (R15, bead workstation-6w7i.26.4.5).

  • v1.60.2 already fails a failed turn's session/prompt with -32603 (auth: -32000) and data: {reason: "turn_failed"}. This adds kind and message (capped at 2048 bytes) to that data, so it becomes {reason, kind, message}.
  • Kinds: authentication, compaction, context_length, credits_exhausted, max_turns, network, provider, refusal, resource_exhausted, retry_exhausted. The kind is read from the stored error message: its MessageErrorKind first, then the text the provider-error, retry and compaction paths write (prefix constants shared with those producers).
  • Replaces 1.54's _meta.goose.turnError on a successful response. Consumers already read the new shape: honkd (honk#47) and stall-watch (eng-agent-platform#460).
  • Fork code is in the new crates/goose/src/acp/turn_error.rs; upstream files get registration lines and two exported prefix checks.
  • Tests: 7 lib tests plus 3 acp_server_test end-to-end assertions, all added to patched-test.yml.

Behaviour to know: upstream now fails the prompt when max turns is reached (the max-turns message carries ResourceExhausted), so a prompt bounded by maxTurns ends with kind: "max_turns" rather than success.

References

  • Bead workstation-6w7i.26.4.5 (epic workstation-6w7i.26)

…message (R15)

Upstream fails a failed turn's session/prompt with -32603 (or -32000 for auth)
and data {reason: "turn_failed"}. Clients that branch on the cause need a kind:
stall-watch's circuit breaker treats authentication as a provider outage, and
honk records the kind in its turn log. The data becomes
{reason, kind, message}, message capped at 2048 bytes.

The kind is read back from the stored error message (the only thing the server
has once the turn ends): its MessageErrorKind first, then the text written by
the provider-error, retry and compaction paths. Kinds: authentication,
compaction, context_length, max_turns, network, provider, refusal,
retry_exhausted. This replaces fork patch 15 (_meta.goose.turnError on a
successful response), which upstream's error contract made obsolete.
@johnnymo87
johnnymo87 merged commit a6551d6 into patched/v1.60.2 Nov 22, 2026
12 checks passed
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