-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
The _server_prompt_active boolean in claude_wrapper.py is set True before the prompt is sent and False after run() returns. The background watcher uses it to decide whether to suppress on_user_message callbacks. Two timing issues:
- Leftover entries suppressed — If JSONL entries exist from before the prompt (e.g. from a previous tmux-typed interaction), the watcher may incorrectly suppress them because the flag is already set.
- Flag clears too early — If the watcher polls right after
run()clears the flag but before the turn's entries are fully processed, a server-initiated user message leaks through as a "tmux-typed" message, causing a duplicate entry in chat.
Impact
- Low — worst case is a duplicate or missing chat entry on the dashboard/phone.
Possible Fixes
- Track the JSONL line offset when the server prompt was sent, and use that to distinguish pre-prompt vs post-prompt entries instead of a boolean flag.
- Use per-prompt request IDs in the JSONL entries (if Claude Code supports it).
From PR #49 reliability audit (concurrency item 2).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels