Expand description
Frontend-neutral session management, selection catalog, and session models.
Host applications implement SessionBackend to connect the stable
programmatic API to their persistence, agent, Git, and forge workflows.
Callers such as background callers use SessionService without
depending on terminal UI state.
Structs§
- Accept
Task Plan Request - Producing task and attempt selected by the user for plan acceptance.
- Accepted
Task Plan - Caller-supplied, explicitly accepted plan for an implementation attempt.
- Agent
CliInfo - One locally runnable agent CLI and the installed version refreshed at startup.
- Agent
Definition - One enabled agent loaded from a workspace agent definition.
- Agent
Definition Summary - Lightweight agent metadata returned by the definition catalog.
- Agent
Selection - Session-level agent selection that keeps provider kind and model together.
- Answer
Questions Request - Structured input for resuming one session from clarification questions.
- Chat
GptSign InOutcome - Account that a completed
ChatGPTplan sign-in stored. - Continue
Graph Node Request - An explicit action against the exact latest execution of a node.
- Create
Session Request - Explicit input for creating one session.
- Create
Task Request - A desired outcome to persist without admitting an attempt or starting work.
- Durable
Message Request - Idempotent turn submitted to one session.
- Execution
Graph - A revision of an arbitrary static execution graph owned by one session.
- Execution
Graph Progress - Read-only projection; operation/run records remain execution authorities.
- Generate
Graph Proposal Request - Idempotent generation admission; the host captures all other policy.
- Graph
Control Request - Revision-bound graph control; cancellation is terminal for this graph ID.
- Graph
Dependency - One prerequisite; multiple gates on one producer are permitted.
- Graph
Execution Profile - Requirements interpreted by a host before worker submission.
- Graph
Input Binding - A planned handoff; no attempt or result needs to exist when planning.
- Graph
Node - An agent invocation template, independent of built-in workflow roles.
- Graph
Node Progress - One node’s latest state plus immutable attempt/run history.
- Graph
Output - Named output containing one complete response under an existing schema.
- Graph
Proposal Approval - Receipt for one exact-version approval, separate from output acceptance.
- Graph
Proposal Limits - Captured ceilings shared by generation, inspection, and approval.
- Graph
Proposal Resolution - Host-owned inputs captured before generation; no external work occurs here.
- Graph
Proposal State - Original immutable host capture, independent of executable graphs.
- Graph
Proposal Version - A generation reservation becomes terminal once; later work gets a new version.
- Graph
Question Answer - One answer to the exact question produced by the source execution.
- Graph
Resolved Input - Exact input captured with a newly admitted execution.
- Graph
Result - Snapshot supplied by the host’s authoritative result store.
- Graph
Result Ref - Immutable address of one persisted output version, excluding its body.
- Harness
Model Option - One harness model a user can choose, with its cost, readiness, and context window.
- Project
- Persisted project metadata used for multi-project management.
- Project
List Item - Aggregated project snapshot for list and switcher views.
- Question
Answer - One structured response to a persisted clarification question.
- Question
Item - One extracted question with predefined answer choices.
- Resolved
Env - Host-resolved local environment for execution in a shared session worktree.
- Resume
Execution Graph Request - Explicit restart of dispatch, never an implicit retry of an admitted node.
- Review
Request - Persisted forge linkage for one session.
- Review
Request Summary - Normalized remote summary for one linked review request.
- Served
Model - Model an OpenAI-compatible server serves, identified as
openai-compatible/<served model>. - Session
- Complete persisted session aggregate returned by the programmatic API.
- Session
Id - Shared stable identifier for one session.
- Session
Message - One persisted transcript message for a session.
- Session
Message Kind Parse Error - Error returned when a stored session message kind is unknown.
- Session
Service - Stable programmatic facade for session lifecycle operations.
- Session
Settings - Complete session-scoped execution settings returned by the API.
- Session
Stats - Token and diff usage statistics associated with one agent session or isolated prompt.
- Session
Transcript - Ordered transcript view assembled from persisted session messages.
- Start
Execution Graph Request - Explicit static-graph launch, separate from ordinary chat.
- Static
Agent Availability Probe - Availability probe that returns one caller-provided snapshot.
- Submit
Agent Task Request - Explicit role-aware attempt, separate from legacy session-context tasks.
- Submit
Task Request - An explicit attempt to advance a task in an existing idle session.
- Task
- A desired outcome with retained attempt history, scoped to one session.
- Task
Agent Assignment - Immutable role and provider/model selection assigned to one task.
- Task
Agent Context - Durable identity of one task’s conversation and runtime resources.
- Task
Agent History - Durable task conversation, independent of ordinary session messages.
- Task
Agent Input - Explicit input for a task’s own conversation, excluding session replay.
- Task
Agent Turn - One response retained in an isolated task conversation.
- Task
Attempt - One turn and its ordered post-processing, backed by a unique operation.
Enums§
- Agent
CliVersion - Automatic update and version probe state for one locally runnable agent CLI.
- Agent
Definition Parse Error - Error returned when one agent definition cannot be parsed safely.
- Agent
Definition Source - Location from which a catalog resolved a definition.
- Agent
Kind - Supported agent provider families.
- Agent
Model - Supported agent model names across all providers.
- Create
Session Mode - Creation strategy for a new session.
- Durable
Message Visibility - Transcript treatment for one durable prompt.
- EnvId
- Stable identity and lifecycle owner of an execution environment.
- Execution
Graph Status - Graph completion means every node settled without clarification.
- Focused
Review Status - Durable state of one focused-review generation attempt.
- Forge
Kind - Shared forge family enum reused by persistence and forge adapters.
- Graph
Blocked Reason - Stable reasons why a pending node cannot currently dispatch.
- Graph
Completion Gate - Completion condition, distinct from desired-outcome task completion.
- Graph
Context - Provider conversation lifetime and existing execution authority.
- Graph
Contract Error - A structural graph or exact-result binding violation.
- Graph
Execution Ref - Link to existing execution records; never a second execution status.
- Graph
Node Continuation - Provider retries stay inside an attempt; these actions create a new one.
- Graph
Node Status - Node state never overwrites authoritative operation/run status.
- Graph
Post Processing - Host mutation effects, independent of model tools and response schema.
- Graph
Proposal Action - Explicit mutation of an inspected proposal version.
- Graph
Proposal Reply Outcome - First decision recorded for a chat reply to one proposal version.
- Graph
Proposal Version Outcome - Generation outcome; only a resolved preview can be approved.
- Graph
Result State - Host-attested output state, separate from attempt/run lifecycle.
- Graph
Workspace Access - Resource requirement within one Env, not a security sandbox.
- Harness
Model Status - Whether a harness model can run a turn now.
- Model
Cost - Who pays for a harness model’s tokens and, for a hosted model, its price
class as the
ag-harnessprovider catalog declares it. - Permission
Mode - Supported permission mode values for agent execution workflows.
- Reasoning
Level - Supported reasoning-effort levels for task execution.
- Response
Style - Preferred amount of detail in user-facing session responses.
- Review
Request State - Normalized remote lifecycle state for one linked review request.
- Session
Diff State - Known availability of a session worktree diff.
- Session
Error - Stable error returned by
crate::SessionServiceoperations. - Session
Message Kind - Durable category for one saved session transcript message.
- Session
Status - High-level lifecycle state for one session.
- Setting
Name - Stable keys used in the
settingandproject_settingtables. - Speed
Mode - Response-speed preference applied to one agent session.
- Task
Agent Role - Built-in role contracts for a planner-to-implementer workflow.
- Task
Attempt Status - Operation lifecycle exposed by the task read model.
- Transcript
Notice - Canonical labels for bracketed workflow notices appended to a session transcript.
Constants§
- AGENT_
PROFILE_ PROMPT_ MAX_ BYTES - Maximum UTF-8 byte length retained for one agent prompt.
- MINIMUM_
RUNNING_ CONTEXT_ WINDOW - Smallest context window, in tokens, a local server may run a model with for harness turns. The system prompt, tool definitions, output schema, and response reservation leave too little room for a conversation below it, and Ollama fills a smaller window by silently dropping the start of the conversation.
Traits§
- Agent
Availability Probe - Detects which provider CLIs and harness models are runnable on the current machine.
- Agent
Selection Metadata - Human-readable metadata for slash-menu selectable items.
- Session
Backend - Host implementation boundary for session persistence and workflows.
Functions§
- activity_
day_ key_ with_ offset - Converts Unix timestamp seconds to a day key after applying a UTC offset.
- agent_
definition_ identity - Reads an identity even for a disabled definition, which masks a bundled ID.
- build_
apply_ review_ prompt - Builds the agent-facing
/applyprompt from focused-review suggestions. - bundled_
agent_ definitions - Bundled agents are available even when a repository has no
.agentsdirectory. - default_
harness_ model - Returns the model new harness sessions start on.
- default_
option_ index - Returns the initial highlighted option for a clarification question.
- has_
actionable_ review_ suggestions - Returns whether focused-review markdown contains suggestions that
/applycan act on. - mru_
project_ order - Returns indices into
project_itemsordered most-recently-opened first. - node_
question_ notice - Returns the chat message announcing one graph node’s clarification
questions, after the answer they refer to, or
Nonewhen every question is blank. The numbered questions record what was asked; the frontend answers them in its question panel, as for an ordinary turn. - normalized_
message_ content - Returns raw persisted message content with only outer whitespace removed.
- ordered_
project_ items - Returns the project rows named by
project_order, skipping stale indices. - parse_
agent_ definition - Parses one
.agentsagent definition. - parse_
agent_ summary - Parses lightweight picker metadata from one
.agentsagent definition. - parse_
persisted_ session_ agent_ model - Parses one persisted session agent/model pair without deriving the agent from the model when the saved agent kind is available.
- project_
name_ from_ path - Derives a readable project name from its filesystem path.
- push_
numbered_ questions - Appends each question on its own numbered line, with any predefined options in parentheses.
- resolve_
agent_ kind_ for_ model - Resolves a provider kind that can run
modelfrom the available provider list. - resolve_
agent_ selection_ for_ model - Resolves an
AgentSelectionfor a model-only setting. - resolve_
model_ for_ available_ agent_ kinds - Resolves one model against the currently available agent kinds.
- resolve_
prompt_ model_ agent_ kind - Resolves the agent kind used for prompt-side
/modelselection. - review_
suggestions - Extracts actionable suggestion content from focused-review markdown.
- session_
branch - Returns the default worktree branch name for a session.
- stored_
message_ content - Returns the durable message content for one kind.
Type Aliases§
- Chat
GptSign InUrl Handler - Receives the browser URL of a
ChatGPTsign-in once it is ready for the user, so the host can open it and show it as a fallback.