Expand description
The Claude CLI subprocess behind every ambient call: spawn it as bare text generation, race it against cancellation and a timeout, and parse its stream-json reply.
Constants§
- AMBIENT_
MODEL - The model every ambient call runs on.
Functions§
- ambient_
call_ 🔒cwd - Where ambient side calls run:
<data dir>/ambient-calls, created on demand;None(inherit srv’s cwd, as before) only if it cannot be made. No agent works there, so no agent’s history ever matches its transcripts (#3629). - invoke_
haiku - Invoke the Claude CLI on
AMBIENT_MODELfor one ambient call, withintimeout(the purpose’s own,purpose::Purpose::timeout). - parse_
cli_ 🔒stream - The last assistant text block (sanitized) and the usage from a
claude -p --output-format stream-jsontranscript. Text is empty when the model said nothing, or only wrapped nothing in a fence.