feat(coding-agent/hindsight): added per-session HindsightSessionState
- Added `HindsightSessionState` to `AgentSession` and bound hindsight lifecycle hooks to session state. - Removed global hindsight state/queue handling and replaced it with per-session `HindsightRetainQueue` batching and scoped flushing. - Reworked recall, reflect, and retain tools to use `session.getHindsightSessionState()` instead of sessionId-based lookup. - Updated SDK/task/backend/controller flows to pass `session`/`parentHindsightSessionState`, scope `/memory` behavior, and document it in changelog.
This commit is contained in:
@@ -17,6 +17,7 @@ import { SETTINGS_SCHEMA, type SettingPath } from "../config/settings-schema";
|
||||
import type { CustomTool } from "../extensibility/custom-tools/types";
|
||||
import { runExtensionCompact, runExtensionSetModel } from "../extensibility/extensions/compact-handler";
|
||||
import type { Skill } from "../extensibility/skills";
|
||||
import type { HindsightSessionState } from "../hindsight/state";
|
||||
import type { LocalProtocolOptions } from "../internal-urls";
|
||||
import { callTool } from "../mcp/client";
|
||||
import type { MCPManager } from "../mcp/manager";
|
||||
@@ -163,6 +164,7 @@ export interface ExecutorOptions {
|
||||
settings?: Settings;
|
||||
/** Override local:// protocol options so subagent shares parent's local:// root */
|
||||
localProtocolOptions?: LocalProtocolOptions;
|
||||
parentHindsightSessionState?: HindsightSessionState;
|
||||
}
|
||||
|
||||
function parseStringifiedJson(value: unknown): unknown {
|
||||
@@ -979,6 +981,7 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
||||
hasUI: false,
|
||||
spawns: spawnsEnv,
|
||||
taskDepth: childDepth,
|
||||
parentHindsightSessionState: options.parentHindsightSessionState,
|
||||
parentTaskPrefix: id,
|
||||
agentId: id,
|
||||
agentDisplayName: agent.name,
|
||||
|
||||
Reference in New Issue
Block a user