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.
Constants§
- RECORD_
HEAD_ 🔒CHARS - How much of the continuation record the continued-session note reads: the running summary at its head, the latest exchange at its tail.
- RECORD_
TAIL_ 🔒CHARS - TASK_
HEAD_ 🔒CHARS - How much of a subagent’s task prompt a name call reads. Task prompts run to many kilobytes; what the task is comes first, and the whole prompt only made the call slower and gave the model more to mistake for its own instructions.
- TASK_
TAIL_ 🔒CHARS
Functions§
- finish 🔒
- generate_
ambient_ 🔒narration - Generate a short user-facing line narrating an autonomous action.
- generate_
continued_ 🔒note - The note a pane shows once a fresh session continues its conversation from
AgentMux’s
record(backend::continued_note). Keyed on the block, so a newer spawn’s note supersedes an older one still in flight. Best-effort: every failure isNone, and the pane says nothing. - 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_
dispatch_ 🔒name - Generate the one Haiku display name for a Workflow-kind dispatch,
eagerly, the first time its first member is observed live, or for an
unnamed historical dispatch via
SubagentWatcher::resolve_unnamed_backlogwhen the Swarm pane opens (never called for a Solo dispatch — a Solo dispatch’s name IS its one member’sdisplay_name, already covered bygenerate_subagent_name; never called during cold-backfill replay — see thelivegate onprocess_jsonl_change’strigger_eager_namingcall incrates/srv/src/backend/subagent_watcher/jsonl.rs). - generate_
name_ 🔒from_ task_ prompt - Admit
purposeforentity, readinfo’s own task prompt off its JSONL, borrow its parent block’s CLI, and runbuild_prompt’s prompt through the name check. - generate_
recovered_ 🔒title - A session title recovered from the session’s recent activity, for an agent
that has none — called by the background sweep in
backend::reactive::activity_watcher, which writes an accepted result toterm:ambient_summaryitself. Goes through the same Ambient Model Call gateway (admission, cancellation-of-superseded, token accounting) under the distinctpurpose::ACTIVITY_SUMMARY_PUSHEDpurpose, so it never contends with the pane’s own title request. The prompt is the pane’s own title prompt (build_session_title_prompt), given the activity instead of a message, not a “what is happening now” summary: the result is shown as the session’s title. - 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). - provider_
fallback_ 🔒target - The provider’s own CLI with an EMPTY auth env, for a block that no longer
exists or names no CLI.
Nonewhen the provider’s CLI isn’t installed. - 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.