coder / coder/xum

🤖 Provider stream error on advisor({question: ""}) retries forever and hangs the app on "Loading Xum..."

Open
#4,228 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2k
Forks
134
Avg merge
14h 57m
Merged PRs (30d)
307

Description

## Summary

Instructing an Exec-mode agent to call `advisor({ question: "" })` (Anthropic model through the dev AI gateway) produced a provider-side stream error that xum then retried indefinitely. The Stop button did not end the retry loop, and while it ran every browser session, including brand-new ones, hung on "Loading Xum..." with a React `Maximum update depth exceeded` warning. Only restarting the backend cleared it.

Observed during remote dogfood UAT of #4227 on branch `mike/advisor-invalid-input-error` at `b5a71760992758f13d286437f9145617e2dbc418`; the failing path is independent of that diff (the error arrives as a provider `error` stream part before any tool-call part exists).

## Provider error

```
processing error: accumulate event: error converting content block to JSON: json: error calling MarshalJSON for type json.RawMessage: invalid character '}' looking for beginning of value
```

Logged by `streamManager.ts` as `Stream processing error` (`processStreamWithCleanup`), then repeated on every retry at roughly 0.5 to 1.5 s intervals for the same workspace until the process was killed.

## Reproduction (as observed, reproduced twice)

1. Enable the Advisor Tool experiment and configure a working advisor model (Sonnet 5, reasoning medium was used).
2. In an Exec chat, tell the agent to call `advisor({question: ""})`.
3. Observe the Stream Error card with the message above and the stream retrying; click Stop.
4. Reload the page or open a fresh browser session: the app stays on "Loading Xum...".

## Two separable problems

1. The auto-retry has no bound for a deterministic provider error (each retry re-sends the same request and gets the same gateway error), and Stop does not cancel the server-side retry.
2. The frontend fails to load any workspace while that retry state exists (`Maximum update depth exceeded`), so a single broken stream takes down the whole app.

The gateway-side JSON accumulation failure itself is a separate dev.coder.com gateway concern.

---

_Generated with `xum` • Model: `anthropic:claude-fable-5-1` • Thinking: `xhigh`_

Contributor guide

No contributing guide indexed for this repository

Research direction

Read streamManager.ts, especially processStreamWithCleanup, and trace the Stop path for provider error retries. Then trace the frontend workspace-loading path associated with the retry state and the React maximum-update-depth warning. Done means deterministic provider errors stop retrying, Stop cancels server-side work, and a fresh session can load the workspace normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
backend, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.