Skip to content

fix(zarvis): surface the full cause chain on provider errors#201

Merged
edwin-zvs merged 1 commit into
mainfrom
zarvis-provider-error-cause
May 24, 2026
Merged

fix(zarvis): surface the full cause chain on provider errors#201
edwin-zvs merged 1 commit into
mainfrom
zarvis-provider-error-cause

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Context

Debugging the vscode style scrollbar - webui session (zarvis, codex-oauth:gpt-5.5): it showed provider error: codex-oauth SSE stream after the model's streaming response dropped mid-turn. The transcript stored literally just "codex-oauth SSE stream" — the underlying transport cause was thrown away, so the failure wasn't diagnosable.

Root cause

The error is raised at codex_oauth.rs:595 (ev.context("codex-oauth SSE stream")? inside the SSE read loop) — a mid-stream transport drop. The anyhow error carries the full chain (context: source: root), but both agent loops formatted it with {e}, which renders only the outermost context.

Change (fix #1 only)

Format provider-complete() errors with {e:#} (anyhow alternate Display = full cause chain) at every emit site:

  • interactive.rs — the provider-error path and the over-budget-retry path (term.note + SessionEvent::Error).
  • agent.rs (headless) — the equivalent two sites.

So the same failure now reads e.g.:

codex-oauth SSE stream: error reading a body from connection: connection reset by peer

The "empty response" messages are constructed strings (not anyhow chains), so they're left as-is. Pure formatting change to the error paths — no control-flow change.

(Not included: fix #2, auto-retrying transient stream drops — deferred per request.)

Verification

  • agentd-adapter-zarvis suite (126) green; --locked workspace build clean.

🤖 Generated with Claude Code

A zarvis turn that hit a provider failure emitted only the outermost
anyhow context — e.g. the bare "codex-oauth SSE stream" a user saw when a
streaming response from chatgpt.com dropped mid-turn. The underlying
transport cause (connection reset / EOF / timeout) was formatted away by
`{e}`, leaving the error undiagnosable.

Format provider-`complete()` errors with `{e:#}` (anyhow alternate Display
= full `context: source: root` chain) at every emit site — the interactive
loop's provider-error and over-budget-retry paths, and the headless
agent loop's equivalents. So the example now reads e.g. "codex-oauth SSE
stream: error reading a body from connection: connection reset by peer".

Pure formatting change to the error paths; no control-flow change.
@edwin-zvs
edwin-zvs merged commit 10efe36 into main May 24, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the zarvis-provider-error-cause branch May 24, 2026 19:16
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