Fix: list_background_processes prints (Exit Code: null) for signal-killed processes - #29237
Fix: list_background_processes prints (Exit Code: null) for signal-killed processes#29237laxanarana1513 wants to merge 1 commit into
Conversation
…signals correctly in output
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where background process listings incorrectly displayed '(Exit Code: null)' for processes that were killed by signals or lacked a numeric exit code. By tightening the validation logic, the tool now correctly omits the exit code clause in these cases, improving the clarity of the process status output. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
📊 PR Size: size/M
|
There was a problem hiding this comment.
Code Review
This pull request updates the list_background_processes tool in packages/core to correctly handle cases where a background process's exit code is null or undefined. Specifically, it changes the check from p.exitCode !== undefined to typeof p.exitCode === 'number' to ensure that exit codes are only displayed when they are numeric. Additionally, several unit tests have been added to verify this behavior under various scenarios (null exit code, undefined exit code, exit code 0, and signaled exits). There are no review comments, so I have no feedback to provide.
🛑 Action Required: Evaluation ApprovalSteering changes have been detected in this PR. To prevent regressions, a maintainer must approve the evaluation run before this PR can be merged. Maintainers:
Once approved, the evaluation results will be posted here automatically. |
Summary
(Exit Code: null)fromlist_background_processeswhen a background process has no numeric exit code (signal kill /exitCode: null).typeof p.exitCode === 'number'inshellBackgroundTools.ts.null, undefined,0, and signal-only listings insrc/tools/shellBackgroundTools.test.ts.Details
No design decisions were made for this change.
Related Issues
Fixes #29167
How to Validate
Run
npx vitest run src/tools/shellBackgroundTools.test.ts.Pre-Merge Checklist