mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-04-06 13:51:29 -07:00
fix: trigger agentStatusChanged hook and heartbeat even when framework yields no message
memeloopTaskAgentWorkerHandler yields { state } without a message field (worker-side
bindWorkerConversation handles message materialization). The old code gated hook dispatch
and heartbeat startup inside if (lastResult?.message), so they were never triggered for
memeloop agents. Extract hook + heartbeat into if (lastResult) so they run regardless of
whether the framework attached a message to the terminal yield.
This commit is contained in:
parent
b6988c57db
commit
143496fdf2
1 changed files with 5 additions and 1 deletions
|
|
@ -997,8 +997,12 @@ export class AgentInstanceService implements IAgentInstanceService {
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger agentStatusChanged hook with actual terminal state (completed, input-required, etc.)
|
||||
if (lastResult) {
|
||||
// Trigger agentStatusChanged hook with actual terminal state (completed, input-required, etc.).
|
||||
// This must run even when the framework yields no message (e.g. memeloopTaskAgentWorkerHandler
|
||||
// yields { state } without a message; worker-side updates handle message materialization).
|
||||
const terminalState = (lastResult.state ?? 'completed') as 'working' | 'completed' | 'failed' | 'canceled' | 'input-required';
|
||||
await frameworkHooks.agentStatusChanged.promise({
|
||||
agentFrameworkContext: frameworkContext,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue