Skip to content

fix(chat): show hook failure details in error cards - #27824

Merged
nwparker merged 3 commits into
mainfrom
nwparker/dis-cc-issues
Oct 12, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/dis-cc-issues

Conversation

@nwparker

@nwparker nwparker commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​203 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​203
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​45 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​45

ELI5

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.

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

Before After
Before: hook errors show raw event names After: hook errors show the hook name and failure

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.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 87482408-a5b8-4281-ad64-22d22448c256

📥 Commits

Reviewing files that changed from the base of the PR and between fcd887c and aed63ec.


📒 Files selected for processing (1)
  • src/main/daemon/daemon-init-macos-stable-launch-fallback.test.ts

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 | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning 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 Passed The title clearly and concisely describes the primary change: displaying hook failure details in chat error cards.
Description check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit 45fd65e into main Oct 12, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant