Skip to content

feat: exit 75 when the memory is busy - #295

Merged
dacorvo merged 1 commit into
mainfrom
feat/busy-exit-code
Nov 13, 2026
Merged

dacorvo merged 1 commit into
mainfrom
feat/busy-exit-code

Conversation

@dacorvo

@dacorvo dacorvo commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

A command that found another funes holding the memory exited 1, like any failure. It now exits 75, sysexits' EX_TEMPFAIL, so a hook can tell a run the next turn catches up from one that failed. The lock's error is a typed Busy, which index returns too, and main maps it to the exit status.

A command that found another funes holding the memory exited 1, like
any failure. It now exits 75, sysexits' EX_TEMPFAIL, so a hook can tell
a run the next turn catches up from one that failed. The lock's error
is a typed Busy, which index returns too, and main maps it to the exit
status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI 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.

🟢 Approval recommended

No active review issues block the change to report temporary memory-lock contention with exit code 75.

No open issues 🎉

What changed in this PR

This PR lets automation distinguish temporary memory-lock contention from other failures by returning exit code 75 (EX_TEMPFAIL), allowing hooks to defer indexing until a later turn.

Changes:

  • Introduces a typed Busy error for memory-lock contention and maps it to exit code 75.
  • Adds a subprocess regression test for non-interactive indexing while the memory is locked.
  • Documents the exit code and deferred catch-up behavior for hook authors.
File Description
tests/​store_lock.rs Tests the CLI’s contention exit code and error message.
src/​memory/​lock.rs Adds the typed Busy error while preserving the existing message.
src/​main.rs Maps propagated Busy errors to exit code 75.
src/​commands/​index.rs Returns the shared Busy error when lock acquisition remains blocked.
docs/​automation.md Documents exit code 75 for contended hook-driven indexing.
CONTRIBUTING.md Explains how integrations should interpret temporary contention.

Review effort: Balanced

@dacorvo
dacorvo merged commit 013d0ea into main Nov 13, 2026
13 checks passed
@dacorvo
dacorvo deleted the feat/busy-exit-code branch November 13, 2026 14:54
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.

2 participants