fix(agents): raise claude tui startup wait to 60s

This commit is contained in:
hh
2026-07-26 00:49:47 +02:00
parent 90fe92d014
commit 1ad8f2a475
2 changed files with 13 additions and 8 deletions
+11 -6
View File
@@ -153,14 +153,19 @@ class ClaudeCodeOptions(BaseModel):
caveats) as ``UserMessage`` events. Off by default — they're not
part of the real conversation."""
startup_delay: float = 10.0
startup_delay: float = 60.0
"""Upper bound (seconds) on waiting for claude's TUI to enable
bracketed-paste mode after spawn. claude-code-api polls PTY output
for the DECSET 2004 marker and returns as soon as it arrives; this
caps how long to wait if it never does. 10s by default is a free
headroom — on a fast host the marker arrives in well under a second
and we proceed immediately — but it saves slow hosts (Raspberry Pi
etc) where the TUI can take a few seconds to render."""
for the DECSET 2004 marker and returns as soon as it arrives, so a
generous cap costs nothing on a warm host — it only bounds the case
where the marker never shows.
It has to be generous, because timing out here means writing the
prompt into a terminal that hasn't enabled bracketed paste, where our
``ESC[200~`` framing is parsed as junk and the message is silently
dropped. Observed on a cold Raspberry Pi: 10s elapsed with *zero*
bytes of PTY output, the prompt went into the void, and the turn hung
until a human typed into the session by hand."""
file_wait_timeout: float = 30.0
"""How long to wait for the session JSONL to appear after spawn.