Skip to content

fix(commands): use background Bash to avoid shell timeout killing servers#608

Open
akdoan1 wants to merge 1 commit intobacknotprop:mainfrom
akdoan1:fix/slash-command-timeout
Open

fix(commands): use background Bash to avoid shell timeout killing servers#608
akdoan1 wants to merge 1 commit intobacknotprop:mainfrom
akdoan1:fix/slash-command-timeout

Conversation

@akdoan1
Copy link
Copy Markdown

@akdoan1 akdoan1 commented Apr 23, 2026

Summary

  • Replace ! shell preprocessing with run_in_background: true Bash instructions in review, annotate, and annotate-last slash commands
  • Fixes servers being killed after ~2 minutes due to Claude Code's shell preprocessing timeout
  • Prevents annotation loss when the server dies mid-review

Problem

The /plannotator-review, /plannotator-annotate, and /plannotator-last slash commands use the ! preprocessing syntax, which runs plannotator as a blocking shell command. The server blocks on waitForDecision() 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:

  1. The draft file survives on disk, but only contains annotations up to the last successful auto-save
  2. Auto-save failures are silent (.catch(() => {})), so the user has no indication their work isn't being saved
  3. Reopening recovers partial annotations but anything after the last save is lost

Fix

Replace !plannotator review $ARGUMENTS`` with skill instructions that tell Claude to run the command via the Bash tool with run_in_background: true. Background Bash tasks have no timeout and notify Claude when complete.

No server code changes, no build required — only the 3 .md skill files are modified.

Test results

Tested with run_in_background: true Bash tasks (the approach this PR uses). Both servers survived 135 seconds (past the old 120s kill threshold) and successfully captured annotations on submission:

Test Survived 135s Annotations submitted Feedback captured
plannotator review Yes Yes Yes — review feedback on diff
plannotator annotate Yes Yes Yes — annotation on markdown

Review output (after 135s wait):

# Code Review Feedback

## test.txt

### Line 1 (new) — ``hello world`` (chars 0-11)
test

The reviewer has identified issues above. You must address all of them.

Annotate output (after 135s wait):

# File Feedback

I've reviewed this file and have 1 piece of feedback:

## 1. Feedback on: "Test file"
> test

Environment

  • Claude Code v2.1.108
  • Plannotator v0.19.0
  • macOS 26.4

…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>
@akdoan1 akdoan1 force-pushed the fix/slash-command-timeout branch from 537b313 to f324282 Compare April 24, 2026 03:17
@backnotprop
Copy link
Copy Markdown
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.

Fixes servers being killed after ~2 minutes due to Claude Code's shell preprocessing timeout

And now the slash command would force the agent to call it, where before it was deterministic and happened automatically.

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