fix(commands): use background Bash to avoid shell timeout killing servers#608
Open
akdoan1 wants to merge 1 commit intobacknotprop:mainfrom
Open
fix(commands): use background Bash to avoid shell timeout killing servers#608akdoan1 wants to merge 1 commit intobacknotprop:mainfrom
akdoan1 wants to merge 1 commit intobacknotprop:mainfrom
Conversation
…vers Replace ! preprocessing with run_in_background Bash instructions in review, annotate, and annotate-last commands. The ! syntax blocks on waitForDecision() which exceeds the ~120s shell timeout, killing the server and losing unsaved annotations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
537b313 to
f324282
Compare
Owner
|
Hey, I'm happy to review this. I'll give it a shot. I haven't actually run into this problem before. Usually it gets auto background.
And now the slash command would force the agent to call it, where before it was deterministic and happened automatically. |
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.
Summary
!shell preprocessing withrun_in_background: trueBash instructions in review, annotate, and annotate-last slash commandsProblem
The
/plannotator-review,/plannotator-annotate, and/plannotator-lastslash commands use the!preprocessing syntax, which runsplannotatoras a blocking shell command. The server blocks onwaitForDecision()until the user submits, but Claude Code's shell preprocessing has a ~120s timeout that kills the process during long sessions.Plan mode doesn't have this issue because it uses a PermissionRequest hook with a 96-hour timeout (
hooks.json).When the process is killed:
.catch(() => {})), so the user has no indication their work isn't being savedFix
Replace
!plannotator review $ARGUMENTS`` with skill instructions that tell Claude to run the command via the Bash tool withrun_in_background: true. Background Bash tasks have no timeout and notify Claude when complete.No server code changes, no build required — only the 3
.mdskill files are modified.Test results
Tested with
run_in_background: trueBash tasks (the approach this PR uses). Both servers survived 135 seconds (past the old 120s kill threshold) and successfully captured annotations on submission:plannotator reviewplannotator annotateReview output (after 135s wait):
Annotate output (after 135s wait):
Environment