Notifications not delivered in `claude agents` mode — hook subprocesses have no TTY and terminalSequence is not forwarded
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start with emit-terminal-sequence.sh, especially _warp_resolve_tty(), and reproduce the notification failure in claude agents mode alongside a plain claude session. Trace the /dev/tty, terminalSequence, and process-tree paths, then verify that Warp Agent View receives status notifications without selecting another session's TTY.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
When running Claude Code via claude agents (the multi-agent/headless mode), the Warp plugin notifications are silently dropped. The Warp Agent View panel does not show any status updates (running, idle, waiting for input, etc.).
Root Cause
In claude agents mode, Claude Code spawns hook subprocesses as children of a daemon process that has no controlling terminal:
hook → zsh → claude (bg-spare) → claude (pty-host) → claude (daemon) → launchd
(all TTY = ??)
The actual TTY belongs to the claude agents process, which is a sibling of the daemon — not an ancestor. This breaks both delivery paths in emit-terminal-sequence.sh:
-
/dev/ttypath: Hook subprocesses have no controlling terminal, sottyreturns "not a tty" and writes to/dev/ttyfail silently (masked by2>/dev/null || true). -
terminalSequenceJSON path (CC >= 2.1.141): The hook scripts correctly output{"terminalSequence": "..."}to stdout, but in agents/daemon mode, this output is not forwarded to the terminal by the Claude Code daemon. The JSON is simply discarded. -
Parent process tree walk: Walking up the process tree from the hook subprocess only finds daemon processes (all TTY =
??), never reaching theclaude agentsprocess that owns the Warp pane's PTY.
Environment
- Claude Code: 2.1.158
- Warp: v0.2026.05.27.15.44.stable_01
- Plugin: warp@claude-code-warp v2.1.0
- OS: macOS (Darwin 24.6.0)
WARP_CLI_AGENT_PROTOCOL_VERSION=1is correctly set
Reproduction
- Open Warp terminal
- Run
claude agents(orclaude agents --dangerously-skip-permissions) - Send a prompt to an agent
- Observe: no status notifications appear in Warp's Agent View panel
- Compare: running plain
claudein Warp works correctly — notifications appear
Workaround
I modified emit-terminal-sequence.sh to add a fallback in _warp_resolve_tty() that searches all claude processes for one with a real TTY when the parent-tree walk fails:
# 3. In `claude agents` mode, the TTY belongs to a sibling process.
# Find any claude process that has a real TTY.
tty_dev=$(ps -eo tty,comm 2>/dev/null \
| grep -E 'claude' \
| grep -vE '^\?\?' \
| head -1 \
| awk '{print $1}')
if [ -n "$tty_dev" ]; then
echo "/dev/$tty_dev"
return 0
fi
With this change, the hook scripts write OSC 777 sequences directly to the TTY device (e.g., /dev/ttys000) of the claude agents process, and Warp correctly receives the notifications.
However, this workaround has limitations:
- It picks the first claude process with a TTY, which may be wrong if multiple
claudesessions are running in different Warp panes. - Plugin updates will overwrite the modification.
Suggested Fix
Ideally, one of these approaches would be adopted:
- Claude Code side: Forward
terminalSequenceJSON from hook subprocess stdout to the terminal in agents/daemon mode, just like in interactive mode. - Plugin side: Add the cross-process TTY discovery fallback to
_warp_resolve_tty()with session-awareness (usingWARP_TERMINAL_SESSION_UUIDor similar to disambiguate when multiple sessions exist).
Related Issues
This is the same underlying cause as #43, #47, #49, #53, #54, #55, #58 — all report /dev/tty being unavailable in hook subprocesses. This issue specifically identifies the claude agents (daemon) mode as the trigger and proposes a concrete workaround.
- Lingua principale
- Shell
- Stelle
- 233
- Fork
- 59
- Merge medio
- 2g 8h
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di warpdotdev/claude-code-warp
-
on-stop.sh slurps the entire transcript with jq -s every turn — ~1 GB RSS on long sessions, triggered a host OOMForse già presa @GeiserX l’ha presa 10 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
warpdotdev/claude-code-warp#63 · 2 commenti ·
Tutte le issue di warpdotdev/claude-code-warp
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 2 giorni
-
headers-parser: `forRegExp` does not escape regexp characters in path segments that contain `*`Forse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
mattpocock/skills#1307 ·
I maintainer di solito rispondono entro 1 giorno
-
status: ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
melodic-software/claude-code-plugins#8537 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
vladmandic/sdnext#5161 ·
I maintainer di solito rispondono entro 1 giorno