mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 16:38:27 +00:00
refactor(agents): dedupe transient error copy (#16324)
This commit is contained in:
committed by
GitHub
parent
3e6d1e9cf8
commit
d714ac7797
@@ -1,3 +1,4 @@
|
||||
import type { AgentMessage } from "@mariozechner/pi-agent-core";
|
||||
import type { InlineCodeState } from "../markdown/code-spans.js";
|
||||
import type {
|
||||
EmbeddedPiSubscribeContext,
|
||||
@@ -569,6 +570,12 @@ export function subscribeEmbeddedPiSession(params: SubscribeEmbeddedPiSessionPar
|
||||
resetAssistantMessageState(0);
|
||||
};
|
||||
|
||||
const noteLastAssistant = (msg: AgentMessage) => {
|
||||
if (msg?.role === "assistant") {
|
||||
state.lastAssistant = msg;
|
||||
}
|
||||
};
|
||||
|
||||
const ctx: EmbeddedPiSubscribeContext = {
|
||||
params,
|
||||
state,
|
||||
@@ -576,6 +583,7 @@ export function subscribeEmbeddedPiSession(params: SubscribeEmbeddedPiSessionPar
|
||||
blockChunking,
|
||||
blockChunker,
|
||||
hookRunner: params.hookRunner,
|
||||
noteLastAssistant,
|
||||
shouldEmitToolResult,
|
||||
shouldEmitToolOutput,
|
||||
emitToolSummary,
|
||||
|
||||
Reference in New Issue
Block a user