Surface autonomous provider errors in chat - #102
Draft
k2v7n24cbf-cyber wants to merge 4 commits into
Draft
Conversation
k2v7n24cbf-cyber
added a commit
to k2v7n24cbf-cyber/openacme
that referenced
this pull request
Jul 22, 2026
Merge staged copy of sandydasari#102 into local-stage.
Author
|
Added the session title refresh fix to this PR via commit 51bb406 (Broadcast session title updates). What changed:
Validation completed on the local-stage branch carrying the same fix:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Surface provider/model failures from dispatcher-driven autonomous turns in the chat UI instead of leaving users with a silent run/idle cycle.
This change:
streamTexterrors inAgent.runAutonomous()via the existingrunStream({ onError })hookdata-upstream-errormessage for autonomous failuresextractErrorText()helper so thrown plain objects and nested provider responses do not render or log as[object Object]/api/chatupstream provider failures with session, agent, provider, status, and the same sanitized message shown in the UIObservation
During an autonomous agent session, a provider-side model rejection was visible in the daemon logs but the browser UI showed no useful error. The session appeared to hang or silently return to idle because no assistant message was appended to the conversation.
Interactive
/api/chatturns already had a visible provider-error path: failed turns append adata-upstream-errorpart that the existing message bubble renders as a Provider error card. Dispatcher-run autonomous turns did not have the same behavior.A related logging/display failure could still collapse thrown plain objects into
[object Object], which hid the useful provider detail even after the visible error path existed. The interactive chat path also persisted the visible error but did not emit a matching structured daemon log line for that captured upstream failure.Root Cause
runAutonomous()drove the model stream directly and let provider failures propagate to the dispatcher. The dispatcher logged the error and attempted task parking, but that does not guarantee a session-visible message:messages_appendedeventThe UI was therefore missing the same error-surfacing contract already used by interactive chat.
Separately, several fallback paths converted unknown thrown values with
String(error). For plain provider objects, that produces[object Object]instead of the nested message/body that operators need for debugging.Impact
This is provider-agnostic. It is not specific to ChatGPT OAuth. Any provider/model error that reaches the AI SDK stream error path should now become visible in the autonomous session as a Provider error card, while still being treated as a failed turn by the dispatcher.
The same formatter is now used across the critical agent/provider failure path, so UI messages, dispatcher logs, task parking comments, subagent helper failures, extractor failures, compression failures, and interactive chat upstream-error logs get a readable bounded string when a provider throws a non-
Errorvalue.Timeout handling is unchanged.
Validation
Local validation completed:
pnpm buildpnpm --filter @openacme/agent-core test -- error-classifier.test.ts subagent.test.ts extractor.test.ts compression.test.tspnpm --filter @openacme/agent-core test -- error-classifierpnpm --filter @openacme/agent-core check-typespnpm --filter @openacme/server check-typespnpm --filter @openacme/server test -- dispatcher.test.tspnpm --filter @openacme/server test -- app-upstream-log.test.tspnpm buildpnpm --filter @openacme/server test:e2eThe full server e2e push-hook run passed: 13 test files, 27 tests.