Expand description
The background and one-shot ambient Haiku callers: pushed and per-definition
activity summaries, subagent and workflow-batch names, and narration. Each is
best-effort — every failure path returns None and the caller carries on
without. They all go through call::admit / Slot::run, so admission,
cancellation, concurrency caps and reply validation are the same for each.
The two pull RPCs (session:activity_summary, session:next_prompt_suggestion)
use the same path from server::app_api::session.
Structs§
- Generated
- What a background call produced.
Nonefrom a task means it did not run to completion (superseded, capped out, nothing to send, CLI failed), so a caller that tracks progress should try again later.Somemeans the CLI ran:textisNonewhen the model had nothing usable to say (the reply failed validation, or was empty), which is a finished attempt, not a failure, andtokensis the spend either way.
Functions§
- generate_
ambient_ narration - Generate a short user-facing line narrating an autonomous action.
- generate_
definition_ activity_ summary - Generate (and persist) a short activity summary for a definition whose
AgentPicker row has no structured
output.state.jsonconversation snapshot to preview — legacy rows predating snapshot persistence, perhas_snapshotinagent_handlers::session::listrecentsessions. Built from the instance’s raw terminal capture (the"output"filestore file, written unconditionally by the CLI pipeline, independent of the newer structured snapshot), reusingread_recent_activity_digest— the same extractiongenerate_recovered_titleabove uses. - generate_
subagent_ name - Generate (or return the already-cached) concise Haiku display name for a
subagent. Called on-demand the first time a client expands that
subagent’s row in the Swarm view — see
("subagent", "GenerateName")inserver::service::misc. Subagents have noBlock/meta of their own, so this borrows the parent block’s CLI path + auth env, and reads the subagent’s own initial task prompt directly off its JSONL (available immediately even for a still-running subagent, unlike a transcript summary which needs output to summarize). - resolve_
provider_ cli_ path_ readonly - Read-only CLI path lookup for
provider_id— checks the versioned local-install dir, then falls back to system PATH. Deliberately never installs anything (unlike theresolvecliRPC handler /agent_open.rs’s launch-time resolution, which both trigger an npm install as a fallback): this is a best-effort BACKGROUND call, not a user-initiated launch — silently installing a CLI as a side effect of a picker preview summary would be a surprising, unwanted cost. ReturnsNone(not an error) for an unknown provider or a CLI that isn’t already available either way; the caller treats that the same as any other unresolvable case.