Preserve and display classified agent turn failures (#1659)#1675
Open
trippyogi wants to merge 2 commits into
Open
Preserve and display classified agent turn failures (#1659)#1675trippyogi wants to merge 2 commits into
trippyogi wants to merge 2 commits into
Conversation
b0cab42 to
cd7feb6
Compare
Classify turn failures (exited, timeout, transport, agent_error, etc.) so the desktop can render actionable error badges instead of collapsing all PromptOutcome::Error variants to a generic outcome string. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Jeremy <peace@trippyogi.com>
Keep turn_error tombstones in activeAgentTurnsStore with errorClass labels, surface them on agent/sidebar/profile badges, and use harness error_class for transcript titles. Errors clear on the next turn_started or turn_completed. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Jeremy <peace@trippyogi.com>
cd7feb6 to
74e6441
Compare
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
Fixes #1659 — agent turn failures were collapsed to a generic, transient "Turn error" badge that vanished before the user could act on it. The harness already knew how to classify failures; that information was discarded at the harness boundary and the desktop store immediately deleted turns on
turn_error.This PR adds
error_classto harnessturn_errorobserver payloads and keeps classified error tombstones in the desktop store until the next successful turn.Branch hygiene
Rebased onto current
main(2 commits only). No unrelated history.Changes
Commit 1 — Harness (
buzz-acp)error_classtoturn_errorJSON payloads (exited,timeout,transport,agent_error,idle_timeout,hard_timeout,protocol, …)is_acp_transport_erroragent_errorcode-32001)Commit 2 — Desktop
activeAgentTurnsStore:turn_error/agent_panic→ error tombstone (isError,errorClass,errorLabel) instead of immediateendTurnturn_started(same channel) orturn_completedturnErrorTitle(): mapserror_class+ code → "Auth error", "Transport error", "Timed out", etc.Tests added
Addresses the test gaps called out in #1659:
error_classmappingcrates/buzz-acp/src/lib.rsturn_error_class_tests::classifies_all_failure_variantscrates/buzz-acp/src/lib.rserror_outcome_emission_tests::*(exited, timeout, transport, agent_error incl.-32001)desktop/src/features/agents/activeAgentTurnsStore.test.mjsturn_error tombstones— preserves "Auth error" untilturn_started; clears onturn_completeddesktop/src/features/agents/lib/friendlyAgentLastError.test.mjsturnErrorTitlefor all harnesserror_classvaluesdesktop/src/features/agents/agentWorkingSignal.test.mjsisError,errorLabel)UI badge components are thin renderers over store state; behavior is covered at the store/signal layer above.
Test plan
cargo test -p buzz-acp error_outcomecargo test -p buzz-acp turn_error_classnpx tsx --test src/features/agents/activeAgentTurnsStore.test.mjsnpx tsx --test src/features/agents/lib/friendlyAgentLastError.test.mjsnpx tsx --test src/features/agents/agentWorkingSignal.test.mjsnpx tsx --test src/features/agents/ui/agentSessionTranscript.test.mjsjust ci(full gate)turn_error) → badge shows "Auth error" (or classified label) and stays until next message succeedsFollow-ups (out of scope)
turn_idinemit_turn_errorcontext for precise turn correlation (harness currently emitsturnId: null)error_classtoagent_panicharness payload