refactor(agent): require explicit send options

This commit is contained in:
_Kerman
2026-07-24 18:23:24 +08:00
parent b56628ced7
commit 879bc71864
21 changed files with 69 additions and 73 deletions
+2 -2
View File
@@ -90,10 +90,10 @@ export class ReactLoopAgent extends Agent {
/** Accept and route one unified send item. */
send(
content: ContentBlock[],
options: SendOptions = { target: 'next-turn', wakeup: true, source: { kind: 'user' } },
options: SendOptions,
): AgentMessageId {
const id = AgentMessageId(randomUUID())
const { target, wakeup, source } = options
const id = AgentMessageId(randomUUID())
if (target === 'next-step' && !wakeup) {
if (this.turnOpen) {
this.outbox.push({ content, source })