Skip to content

Commit 88eaf31

Browse files
orioltfclaude
andcommitted
fix(inbox): correct inverted exit code in collision check
process.exit(existsSync(p) ? 0 : 1) caused the Bash tool to report "Error: Exit code 1" on every normal capture (no collision). Swap to ? 1 : 0 so the happy path exits 0 and collision exits 1. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9d5b8b0 commit 88eaf31

3 files changed

Lines changed: 44 additions & 1 deletion

File tree

.claude/commands/inbox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Examples:
3333
node -e "
3434
const root = require('child_process').execSync('git rev-parse --show-toplevel').toString().trim();
3535
const p = require('path').join(root, 'docs', 'inbox', '<slug>.md');
36-
process.exit(require('fs').existsSync(p) ? 0 : 1);
36+
process.exit(require('fs').existsSync(p) ? 1 : 0);
3737
"
3838
```
3939

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: using pr-review on active ADO PRs wrongly identified as merged
3+
created: 2026-05-04
4+
---
5+
6+
using pr-review on active ADO PRs wrongly identified as merged
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Fix inverted exit code in `/inbox` collision check
2+
3+
**Status:** resolved
4+
**Category:** bug
5+
6+
> *This was generated by AI during triage.*
7+
8+
## Agent Brief
9+
10+
**Category:** bug
11+
**Summary:** The `/inbox` command's collision-check script exits with code 1 on the happy path (no collision), causing Claude Code's Bash tool to display a false "Error: Exit code 1" on every successful capture.
12+
13+
**Current behavior:**
14+
The collision check in `.claude/commands/inbox.md` uses:
15+
```js
16+
process.exit(require('fs').existsExists(p) ? 0 : 1);
17+
```
18+
Exit 0 (tool-success) means "file exists" (collision). Exit 1 (tool-error) means "file does not exist" (no collision). Since the no-collision path is the common case, every normal inbox capture shows a red "Error: Exit code 1" in the Bash tool output, even though the file is created successfully.
19+
20+
**Desired behavior:**
21+
The no-collision path should exit 0 (tool-success) and the collision path should exit 1 (tool-error). This way the Bash tool shows no error on a normal capture, and Claude correctly detects a collision (non-zero exit) and appends `-2`, `-3`, etc.
22+
23+
**Key interfaces:**
24+
- The collision-check `node -e` snippet in `.claude/commands/inbox.md` Step 2 — swap the exit code values
25+
26+
**Acceptance criteria:**
27+
- [ ] Running `/inbox <new-idea>` produces no "Error: Exit code 1" in tool output
28+
- [ ] Running `/inbox <existing-slug>` still detects the collision and appends `-2` to the slug
29+
- [ ] The same fix is applied to the copy at the installed path (`.claude/plugins/marketplaces/unic-agent-plugins/.claude/commands/inbox.md`) if it is managed in this repo
30+
31+
**Out of scope:**
32+
- Rewriting the collision-check with a different mechanism (fs.existsSync is fine)
33+
- Changes to other parts of the inbox skill
34+
35+
## Blocked by
36+
37+
None — can start immediately.

0 commit comments

Comments
 (0)