fix(web): stop tool card crashes from taking down the session view #54
No reviewers
Labels
No labels
Agent
Ignore
Agent
In Progress
Agent
Planned
Agent
Planning
Agent
Ready
Agent
Triage
Compat
Breaking
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lucas/omp-deck!54
Loading…
Reference in a new issue
No description provided.
Delete branch "53-ask-tool-card-crashes-the-session-view-on-options-without-a-label"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
An
askcall whose arguments were still streaming, or arrived with options that weren't{ label: string }objects, crashedAskToolonlabel.endsWith. With no error boundary around tool renderers, that one card replaced the whole session route with the router's error page. This PR makes the ask card tolerate malformed arguments and wraps every tool card body in its own error boundary.Decisions
origin/mainafter the branch was first cut from a stale localmain; upstream touched none of the changed files (comment).resetKeyisstream ?? args. Both are replaced on every streaming update, so a crashed card retries as soon as more data arrives (comment).Verification
bun testthat ranrenderToString(<AskTool>)with options[{}, "Plain", { label: "A (Recommended)" }], anullquestion and a selection containingundefinedrendered without throwing: it showedPlain(selected) andA (Recommended), and dropped{}. The test was removed afterwards.bun run typecheckinapps/webpassed, both before and after the rebase.Closes #53
While an ask call streams, its arguments are partial JSON, so an option can arrive as `{}` or as a plain string. The card assumed every option had a string label and threw on `endsWith`, taking the session route down. Options without a label are now skipped, plain-string options are accepted, and non-string selections in the result are ignored. Co-Authored-By: Claude Opus 5.5 via omp-deck