Repository navigation
feat: exit 75 when the memory is busy - #295
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
🟢 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
Busyerror 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
1 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.