chore: trim stale comments and duplicate strings

This commit is contained in:
Tianyi Cui
2026-06-19 01:49:02 +08:00
parent 914c7e9858
commit 0334b4ad2e
4 changed files with 11 additions and 7 deletions
+5 -2
View File
@@ -71,6 +71,9 @@ export interface AgentFactory {
resume(options: ResumeAgentOptions): Promise<Agent>
}
/** 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<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.resume(options)
}
+3 -2
View File
@@ -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