You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(chat): show hook failure details in error cards - #27824
When a hook fails, Chat UI now shows its name and error instead of an unexplained event name. For example, codex · notification:hook/completed becomes Codex SessionStart hook failed: hook exited with code 1.
What Changed
The existing provider-event formatter reads Codex's nested error entries and Claude's hook output. Claude errors also include the exit code when available. Failed hooks stay red, successful hooks stay hidden, and the original bounded payload remains available under Details.
Regression tests cover missing or malformed fields, multiple errors, output fallbacks, text limits, successful hooks, and projection into chat messages.
Why
The providers already report these errors, but the generic formatter misses the fields containing them. Formatting the existing journal text gives desktop and paired clients the same explanation without a protocol change or duplicate UI parsing. Hiding the cards would conceal genuine failures.
This PR fixes the error-card presentation. The reporter's underlying Windows hook failure still needs expanded Details; follow-up requested.
Visual Proof
Before
After
Rendered using the real notice components in a hidden Orca Electron window on macOS. The Codex row comes from a captured real codex-cli 0.162.0 hook failure replayed through Orca's translator; the Claude row uses a synthetic failure frame.
Testing
Manually verified the rendered cards and expandable Details through Playwright CDP in this worktree's hidden Electron app.
Automated regression tests added: 90 targeted tests passed across the new hook tests and existing fallback, classification, and Codex stream-translation tests.
pnpm tc:node passed.
pnpm run check:code-quality:changed passed.
Current Orca-managed hook succeeded in the real Codex control run; its notifications remain hidden.
Windows, Linux, SSH, and mobile were not exercised directly. No platform commands or wire fields change; older clients receive the clearer text through the existing status field.
Review
Self-reviewed the provider-specific field handling, malformed-input fallbacks, preservation of Details, and existing text bounds.
Agent skill upstream boundary
Not applicable: no upstream skill source or artifacts are copied.
Notes
This does not change hook installation or execution and does not rewrite previously stored error-card text.
Checklist
This PR is small and focused.
Explained the user-facing change, mechanism, and choice of approach.
Before/after screenshots attached.
Self-reviewed for correctness, security, and performance.
Cross-platform, SSH/remote, and compatibility impact considered.
Full lint, typecheck, test suite, and build: CI to cover beyond the targeted local checks above.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
📝 Walkthrough
Walkthrough
Codex and Claude hook failure frames now use provider-specific text in error-surface frames when their payloads match supported hook responses. Other frames retain the existing readable-message behavior. Tests cover formatting, fallbacks, successful hooks, truncation, payload preservation, and native-chat projection. A daemon handoff-budget test now uses a fixed Date.now() value.
Priority: ⬇️ Low
Merge Risk:⚪ Minimal · up to aed63
The hook failures are formatted for chat error cards while existing fallback behavior remains intact. The test clock is scoped and restored; no material merge risk remains.
Pre-merge checks | 4 | 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name
Status
Explanation
Title check
The title clearly and concisely describes the primary change: displaying hook failure details in chat error cards.
Description check
The description is substantially complete. It explains the user-facing change, implementation, rationale, testing, visual proof, compatibility considerations, and scope. It does not provide a linked i…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
ELI5
When a hook fails, Chat UI now shows its name and error instead of an unexplained event name. For example,
codex · notification:hook/completedbecomesCodex SessionStart hook failed: hook exited with code 1.What Changed
The existing provider-event formatter reads Codex's nested error entries and Claude's hook output. Claude errors also include the exit code when available. Failed hooks stay red, successful hooks stay hidden, and the original bounded payload remains available under Details.
Regression tests cover missing or malformed fields, multiple errors, output fallbacks, text limits, successful hooks, and projection into chat messages.
Why
The providers already report these errors, but the generic formatter misses the fields containing them. Formatting the existing journal text gives desktop and paired clients the same explanation without a protocol change or duplicate UI parsing. Hiding the cards would conceal genuine failures.
Linked Issue
Discord report.
This PR fixes the error-card presentation. The reporter's underlying Windows hook failure still needs expanded Details; follow-up requested.
Visual Proof
Rendered using the real notice components in a hidden Orca Electron window on macOS. The Codex row comes from a captured real codex-cli 0.162.0 hook failure replayed through Orca's translator; the Claude row uses a synthetic failure frame.
Testing
pnpm tc:nodepassed.pnpm run check:code-quality:changedpassed.Review
Self-reviewed the provider-specific field handling, malformed-input fallbacks, preservation of Details, and existing text bounds.
Agent skill upstream boundary
Notes
This does not change hook installation or execution and does not rewrite previously stored error-card text.
Checklist