refactor(agent-loop): simplify message machine

This commit is contained in:
_Kerman
2026-07-24 11:46:06 +08:00
parent 7b7f793ee5
commit aaa42d5844
25 changed files with 1205 additions and 2622 deletions

View File

@@ -2522,9 +2522,9 @@ export function createTuiChat(
if (agent.status === 'disposed') {
appendNotice(`Agent "${agent.id}" is disposed.`, 'error')
} else if (agent.status === 'running') {
agent.steer(content, { contexts })
agent.steer(content, { source: { kind: 'user' }, contexts })
} else {
agent.send(content, { contexts })
agent.send(content, { source: { kind: 'user' }, contexts })
}
}