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.
- Expand
Execution Graph Request - An append-only change to a launched graph. The new revision is the
expected current revision plus
nodes; existing nodes, their executions, and their pinned inputs never change. - Extend
Graph Budget Request - A user-initiated, recorded increase of one launched budget’s provider calls. Launch limits stay fixed; each extension is a separate record, so resuming never refills spent credit on its own.
- Generate
Graph Proposal Request - Idempotent generation admission; the host captures all other policy, including whether the proposal adds nodes to the session’s graph that can still run or proposes a new graph.
- 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.
- Host
Context - The project a host creates new sessions in, and how it creates them.
- Host
Project - One project a host lists, as its project switcher shows it.
- Host
Project Status - One of the host’s projects, the active one unless a request named another, as a session list shows it.
- Host
Project Sync - One explicit sync of a project’s branch with its upstream.
- Host
Session Mode - One creation mode a host serves, and how its new sessions start.
- Message
Image - One encoded image a frontend sends with a chat message, whose bytes the host writes to its own prompt-image directory and attaches to the turn.
- Project
- Persisted project metadata used for multi-project management.
- Project
List Item - Aggregated project snapshot for list and switcher views.
- Project
Sessions - One project’s session list and status.
- 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
Diff File - One file a session’s diff changes.
- Session
File Entry - One file or directory in a session’s worktree or the active project’s checkout.
- Session
Graph - The selected graph of a
SessionGraphsread with its live progress. - Session
Graph Action Request - One inspector action on a session’s graph, bound to the snapshot it was chosen from.
- Session
Graph Approval - One node output that waits for the user’s approval.
- Session
Graph Entry - One graph of a session in a
SessionGraphslisting. - Session
Graph Node - One node of a
SessionGraphwith what a frontend shows about it. - Session
Graph Output - One output of the selected node with its stored body.
- Session
Graph Proposal - A session’s latest graph proposal with its rendered preview.
- Session
Graph Requirement - One dependency of a
SessionGraphNode. - Session
Graph Summary - What a frontend shows beside a session’s chat about its latest graph proposal and, once approved, the graph that proposal launched.
- Session
Graphs - A session’s graphs as an inspector shows them, without any action.
- Session
Graphs Request - Which graph a
SessionGraphsread selects, and which of its nodes. - Session
Id - Shared stable identifier for one session.
- Session
List Entry - Listing entry for one session, with the figures a dense session list shows when the host provides them.
- Session
List Stats - Figures a dense session list shows beside 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
Settings Change - Settings to change on one session;
Nonekeeps a setting as it is. - Session
Stats - Diff statistics of one session worktree. Token usage is recorded
separately as
crate::TurnUsage. - Session
Summary - Listing entry for one session, without its transcript or settings.
- 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.
- Task
Worktree Id - Identity of a task worktree inside its owning session.
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
Output Reply Outcome - First decision recorded for a chat reply to one output awaiting acceptance.
- 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.
- Host
Project Sync Phase - How far an explicit project sync has come.
- Message
Image Format - File format of one
MessageImage. - 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.
- Project
Scope - Project that a request which takes a project is for.
- 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 File Status - How a session’s diff changes one file.
- Session
Diff State - Known availability of a session worktree diff.
- Session
Error - Stable error returned by
crate::SessionServiceoperations. - Session
Focused Review - Outcome of a session’s latest focused review.
- Session
Graph Action - What a
SessionGraphActionRequestdoes. - Session
Graph Action Kind - An action a graph inspector offers on a graph, one of its nodes, or one of the selected node’s outputs.
- Session
Graph Proposal Phase - Where a graph proposal version stands.
- Session
Message Kind - Durable category for one saved session transcript message.
- Session
Operation - Operation a host may choose to serve to frontends that check
SessionService::supportsfirst, such as remote control. - 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.
- TASK_
WORKTREE_ LIMIT - Most task worktrees one session may keep at once, including ones still being created or removed, so parallel writers cannot exhaust disk space.
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.