Expand description
Session continuation and permission preset application.
apply_session is the single flag->QueryCommand mapper: it translates
an crate::engine::Config (session continuity, model/effort/agent, the
permission posture, caps, MCP, …) into the matching builder calls. It is
clap-free – the CLI’s run_ask builds a Config from its resolved
AskArgs (build_config) and the side-effect-free engine::run takes one
directly, so both share this one mapper with no second copy to drift.
Enums§
- Resolution
- Outcome of resolving a user-supplied
-c <value>against the known session ids of a project. Seeresolve_session_prefix.
Constants§
- BUILTIN_
AGENT_ NOTICE - The built-in advisory roba injects into the agent’s system prompt by
default. It states roba’s execution truth: the spawned agent is a
single, non-interactive
claude -pturn, not a persistent harness, so there are no cross-turn background-completion notifications. On by default; suppressed with--no-agent-notice, replaced with--agent-notice/ theagent_noticeconfig key. See issue #302.
Functions§
- apply_
permissions - Apply permission policy.
- apply_
session - Apply session-related flags (-c / -c=ID, –fork), the model override (–model), the subagent override (–agent), and then permission-related flags. Returns the configured QueryCommand.
- compose_
append_ system_ prompt - Compose the final
--append-system-promptvalue: the user’s own append text (if any) combined with the built-in agent notice (if enabled). - continue_
defeated_ by_ anon_ worktree - True when a continue/resume request will be silently defeated by an
anonymous (unnamed) worktree: the worktree mints a fresh dir every run, so
-cfinds no prior session there. A NAMED worktree is stable and composes fine, so it is excluded; a--session-id(a new session with a chosen id, i.e.Session::WithId) is not a continue/resume, so it is excluded too. - derive_
session_ name - Derive a display name from the resolved prompt for
claude --name. Shows up in theclaude --resumepicker, the terminal title, and the prompt box. Without it, sessions roba creates are effectively invisible to the picker. - resolve_
session_ prefix - Resolve
inputas a git-style session-id prefix against the project’s knownavailable_ids.