Preserve and display classified agent turn failures (#1659)#1675
Preserve and display classified agent turn failures (#1659)#1675trippyogi 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
|
🤖 Closing this due to a week of inactivity. We're getting a high volume of PRs and this just helps maintainers keep the queue manageable. It's nothing about this PR or you personally! Please reopen (or drop a comment) if it's still needed. |
|
Still interested in carrying this forward. #1659 remains open, and this PR covers both the harness classification and desktop persistence portions. It had been awaiting review rather than abandoned when the inactivity sweep closed it. I now see the newer overlapping PRs #2240 and #2289. Before rebasing and reopening, would you prefer that I revive the full implementation here, consolidate around #2240, or narrow this to any pieces not covered by the newer work? I’m happy to rebase onto current main, run the full just ci gate, and complete the manual validation immediately. |
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