Skip to content

Log error details on session kill failure - #19381

Merged
AmethystLiang merged 1 commit into
mainfrom
debug-orca-perf-issue
Sep 8, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
debug-orca-perf-issue

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$\u200b3 $\color{#cf222e}{\Huge{\mathbf{−}}}$\u200b1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$\u200b2
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$\u200b5 $\color{#cf222e}{\Huge{\mathbf{−}}}$\u200b1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$\u200b4

ELI5

When closing a terminal session fails, we now write down why it failed in the logs, so perf/issue investigations have something to look at instead of just "kill failed".

What Changed

  • session-kill-failed log in DaemonRequestRouter.kill() now includes errorName and error (message) alongside the existing sessionId / immediate / clientId attribution.
  • Updated daemon-server-kill-attribution.test.ts to assert the new fields.

Why

Kill failures were logged with attribution only and no error details, making it impossible to distinguish failure modes during the Orca perf-issue investigation. Including the error name/message preserves the existing log shape (spread over attribution) while giving debuggability.

Linked Issue

N/A — small observability improvement surfaced during perf-issue debugging.

Visual Proof

N/A — logging-only change, no UI or user-facing behavior change.

Testing

  • Automated tests added/updated, or explained why not below
  • pnpm test src/main/daemon/daemon-server-kill-attribution.test.ts — 3 passed locally (macOS)

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

When a session kill operation fails, capture the error name and message
in the log to aid debugging and performance issue investigation.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Enriched session-kill-failed daemon log — DaemonRequestRouter.kill now spreads attribution and adds errorName and error so a failed kill's reason is captured in the daemon file log instead of being rethrown silently.
  • Updated kill-attribution test — the failure case now asserts the exact errorName: 'Error' and error: 'kill refused' fields.

The error-extraction idiom mirrors the existing error instanceof Error ? error.name : typeof error pattern in src/main/crash-reporting/process-gone-diagnostics.ts:157, and DaemonFileLog.log already fails open on non-serializable details, so this is safe to ship. Test passes locally.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: ddfe499b-1f5b-4437-bbfa-2099e6ac7fe4

📥 Commits

Reviewing files that changed from the base of the PR and between 2265fce and ada1bad.

📒 Files selected for processing (2)
  • src/main/daemon/daemon-request-router.ts
  • src/main/daemon/daemon-server-kill-attribution.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The daemon’s kill method now logs the error name and message when a session kill fails. The kill-attribution test verifies the errorName and error fields in the session-kill-failed log entry.

Merge Risk: ⚪ Minimal · up to ada1b

Failed session kills now include error details in daemon logs for diagnosis, with coverage verifying the expected fields. No merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the change, rationale, testing, and lack of visual impact. However, the required Linked Issue section contains “N/A,” even though the template requires an issue link, and the fu… Add the required linked issue in the “Linked Issue” section. Complete the validation checklist or state that CI will run the remaining commands: pnpm lint, pnpm typecheck, pnpm test, and pnpm build.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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.
Title check ✅ Passed The title clearly and concisely describes the main change: adding error details to session-kill failure logs.
Full details: Description check

Explanation

The description covers the change, rationale, testing, and lack of visual impact. However, the required Linked Issue section contains “N/A,” even though the template requires an issue link, and the full validation command checklist remains incomplete.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@AmethystLiang AmethystLiang changed the title Debug orca perf issue Log error details on session kill failure Sep 8, 2026
@AmethystLiang
AmethystLiang merged commit 2171253 into main Sep 8, 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