AgentSdkQuestResume class final
Resumes the conversation recorded in the VS Code window's quest history file, read-only.
Reads {questHistoryRoot}/{questId}/history/{sessionKey}.session.json and
pulls its sessionId field. The sessionKey selects which of the quest's
sessions to reuse — typically default (the quest's default session) or
chat (the chat session). A missing / empty file degrades to a fresh
session, as a provider with no strategy does. The caller never writes back into the
quest's history: record is a no-op, and evict writes nothing either.
A rejected id is remembered, not re-tried. The file belongs to the VS
Code window and may hold an id Claude Code no longer knows. The file is
re-read on every call — so an id the editor writes mid-run is picked up —
and without a memory the same stale id would cost one failed attempt on
every call until the editor next rewrote it. So evict records the id
this strategy last answered as rejected, and resumeIdFor answers null
for a rejected id: a stale id costs one wasted attempt per strategy
instance, and a new id in the file is resumed as soon as it appears.
- Implemented types
Constructors
- AgentSdkQuestResume({required String questHistoryRoot, required String questId, required String sessionKey})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- questHistoryRoot → String
-
Root folder holding the per-quest history subfolders.
final
- questId → String
-
The quest id whose history is read.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sessionKey → String
-
Which session file to read (e.g.
default,chat).final
Methods
-
evict(
LlmOptions options) → Future< void> -
Remembers the id last answered as rejected. The file is left alone.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
record(
LlmOptions options, String conversationId) → Future< void> -
Records the conversation id a successful call produced, so a later
call of the same session can resume it. A no-op for read-only strategies
(AgentSdkQuestResume).
override
-
resumeIdFor(
LlmOptions options) → Future< String?> -
The conversation id to resume for this call, or
nullto start a fresh session (an unknown key, a missing quest file).override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited