diff --git a/packages/agent-loop/src/loop.ts b/packages/agent-loop/src/loop.ts index d1ea117811..359329e062 100644 --- a/packages/agent-loop/src/loop.ts +++ b/packages/agent-loop/src/loop.ts @@ -560,8 +560,6 @@ async function runStep( }) // signal CAN flip during the await above (abort() inside a tool); // the analyzer can't see through the await boundary. - // signal can flip during the await above (abort() inside a tool); - // the analyzer can't see through the await boundary. /* v8 ignore start -- signal.reason default unreachable via agent.abort() */ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (signal.aborted) throw new Error(String(signal.reason ?? 'aborted')) diff --git a/packages/agent/src/index.ts b/packages/agent/src/index.ts index 5d43f87c25..c9181081a3 100644 --- a/packages/agent/src/index.ts +++ b/packages/agent/src/index.ts @@ -71,6 +71,9 @@ export interface AgentFactory { resume(options: ResumeAgentOptions): Promise } +/** Thrown when create/resume is called before an agent factory is registered. */ +const NO_FACTORY_MESSAGE = 'no agent factory registered (load an agent-loop plugin)' + /** * Agent registry (`ctx.agents`): tracks live agents so UI, hook, and * orchestrator plugins can find them without depending on the concrete loop @@ -107,7 +110,7 @@ export class AgentRegistry extends Service { * registered. */ create(options: CreateAgentOptions): Agent { - if (this.factory === undefined) throw new Error('no agent factory registered (load an agent-loop plugin)') + if (this.factory === undefined) throw new Error(NO_FACTORY_MESSAGE) return this.factory.createAgent(options) } @@ -117,7 +120,7 @@ export class AgentRegistry extends Service { * session persistence is not configured. */ async resume(options: ResumeAgentOptions): Promise { - if (this.factory === undefined) throw new Error('no agent factory registered (load an agent-loop plugin)') + if (this.factory === undefined) throw new Error(NO_FACTORY_MESSAGE) return this.factory.resume(options) } diff --git a/packages/agent/src/types.ts b/packages/agent/src/types.ts index b0587b7e6b..2b0c02d78e 100644 --- a/packages/agent/src/types.ts +++ b/packages/agent/src/types.ts @@ -72,8 +72,9 @@ export interface Agent { * (inject is synchronous): a failing flush is reported via `agent/error` * (step `0`) and the logger, never thrown into the caller. * - * TODO(review): exact envelope/rendering rules live in dsh-session and need - * review once a real adapter exists. + * TODO(review): verify the tagged-envelope rendering against live model + * behavior; the real adapters that were the original precondition now exist + * (see the twin-adapter RFC). */ inject(content: ContentBlock[], options?: SendOptions): void diff --git a/packages/session/src/index.ts b/packages/session/src/index.ts index c64af8d0e4..fd7dc74dd5 100644 --- a/packages/session/src/index.ts +++ b/packages/session/src/index.ts @@ -42,7 +42,9 @@ declare module 'cordis' { * synthetic user-role message (the system-reminder pattern: zero adapter * burden, models distinguish it from real user prompts by the envelope). * - * TODO(review): revisit the envelope once a real adapter exists. + * TODO(review): verify the tagged-envelope rendering against live model + * behavior; the real adapters that were the original precondition now exist + * (see the twin-adapter RFC). */ function renderTagged(tag: string, content: ContentBlock[], source: MessageSource): ContentBlock[] { const open = `<${tag} source=${JSON.stringify(source.kind)}>`