fix(agents): surface provider errors structurally instead of raw dumps#1653
Merged
Conversation
When a provider returns HTTP 404 (e.g. Databricks model not accessible), the error code was lost at the ACP process boundary and the desktop showed raw JSON to the user. Thread the JSON-RPC error code from buzz-agent through buzz-acp's observer payload to the desktop, so the UI dispatches on numeric codes (-32001 auth, -32002 model-not-found) instead of fragile string matching.
…s-agnostic Embed the JSON-RPC code in AcpError::AgentError's Display format so the log scraper can extract it for any harness, not just buzz-agent. Replace the string-prefix heuristics with structured parsing of the (code N) field. Add last_error_code to all ManagedAgentRecord construction sites, fix cargo fmt / Biome formatting, and pass lastErrorCode at the second UnifiedAgentsSection call site.
…guard agentSessionTranscript.ts crossed its 1167-line ceiling. Move the turn_error code coercion + copy fallback into the tested lib as a helper, shrinking the transcript hot path back under the limit.
Adds `agent-error-state-screenshots.spec.ts` capturing the three agent card error badge states added in the provider-error classification work: model-not-found (code -32002), generic error, and side-by-side. Extends the e2eBridge mock to carry `last_error_code` on seeded managed agents so specs can drive the structured code path without string matching.
Collaborator
Author
|
🤖 Screenshots of the UI changes in this PR. Model-not-found error badge (new structured classification)A stopped agent whose provider returned a JSON-RPC Generic error badge (unchanged behavior, for contrast)A stopped agent with an unclassified exit (no structured code) still shows the red CircleAlert badge, with the raw exit string as the tooltip. The badge appearance is identical — only the tooltip copy differs based on whether a structured code was present. Both agents in contextBoth error states side by side in the agents view, showing that every stopped agent with a |
wpfleger96
added a commit
that referenced
this pull request
Jul 8, 2026
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.



When a provider returns HTTP 404 (e.g. a Databricks account lacking access to
goose-claude-opus-4-8), the user sees either a raw JSON-RPC dump or a misleading config nudge. The root cause is thatAcpError::AgentErrorstringified the full JSON error object at the process boundary, destroying the typed code thatbuzz-agentalready emits. The desktop then fell back to prefix string matching, which only recognizedllm auth:and let everything else through as gray generic text.This PR threads the JSON-RPC error code structurally from
buzz-agentthroughbuzz-acpto the desktop so the UI dispatches on numeric codes instead of fragile string patterns — for all four harness types (buzz-agent, goose, claude, codex), not just buzz-agent.AgentError::LlmModelNotFound(String)variant with JSON-RPC code-32002, triggered on HTTP 404 inllm.rs:post()(shared across all providers)AcpError::AgentErrorfromStringto{ code: i64, message: String }and embed the code in the Display format ("Agent reported error (code N): ...") so it survives both the process boundary and log scrapingcodein theturn_errorobserver event payload — works for any harness that emits JSON-RPC errorsmeaningful_agent_error_from_logwith structured parsing of the(code N)field, making the log-scraping path harness-agnosticlast_error_codetoManagedAgentRecord/ManagedAgentSummaryand code-based dispatch infriendlyAgentLastError()(switches on-32001auth and-32002model-not-found before the legacy string fallback)lastErrorCodethrough all three UI surfaces: agent card badge, management row, and session transcript — model-not-found now renders in red with actionable copy instead of gray raw text