You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(agent): P1.3 — structured tool-error signal to the model (is_error)
Tool failures previously reached the model only as an "Error:" text prefix; the
computed is_error boolean was used for telemetry but dropped before the provider.
Now a failed tool call carries the failure through to the API:
- ChatMessage gains an internal-only `is_error: Option<bool>` (#[serde(default,
skip_serializing)]), so the OpenAI-compatible wire is byte-identical and strict
endpoints can't reject an unknown message field.
- The Anthropic message builder (convert_messages) sets the native `is_error: true`
on the tool_result content block on failure (absent on success).
- ChatMessage::tool_with_error sets it; both the parallel and sequential
tool-dispatch paths now use it. The "Error:" text prefix is preserved as the
OpenAI-compatible signal.
Self-correction (the heart of loop robustness): Anthropic models get a first-class
failure signal instead of inferring it from text.
Tests: native is_error only on failure (success/legacy omit it); is_error never on
the OpenAI wire. cargo test --lib green (302); clippy adds no new warnings.
0 commit comments