mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-18 12:14:32 +00:00
fix(agents): address review feedback on #61481 phase-integrity hardening
This commit is contained in:
@@ -313,13 +313,15 @@ export function handleMessageUpdate(
|
||||
}
|
||||
const next =
|
||||
phaseAwareVisibleText ||
|
||||
ctx
|
||||
.stripBlockTags(ctx.state.deltaBuffer, {
|
||||
thinking: false,
|
||||
final: false,
|
||||
inlineCode: createInlineCodeState(),
|
||||
})
|
||||
.trim();
|
||||
(deliveryPhase === "final_answer"
|
||||
? ""
|
||||
: ctx
|
||||
.stripBlockTags(ctx.state.deltaBuffer, {
|
||||
thinking: false,
|
||||
final: false,
|
||||
inlineCode: createInlineCodeState(),
|
||||
})
|
||||
.trim());
|
||||
if (next) {
|
||||
const wasThinking = ctx.state.partialBlockState.thinking;
|
||||
const visibleDelta = chunk ? ctx.stripBlockTags(chunk, ctx.state.partialBlockState) : "";
|
||||
|
||||
@@ -363,7 +363,8 @@ describe("session history HTTP endpoints", () => {
|
||||
|
||||
const visible = await appendAssistantMessageToSessionTranscript({
|
||||
sessionKey: "agent:main:main",
|
||||
text: JSON.stringify({
|
||||
text: "Done.",
|
||||
message: {
|
||||
role: "assistant",
|
||||
content: [
|
||||
{
|
||||
@@ -377,7 +378,7 @@ describe("session history HTTP endpoints", () => {
|
||||
textSignature: JSON.stringify({ v: 1, id: "item_final", phase: "final_answer" }),
|
||||
},
|
||||
],
|
||||
}),
|
||||
},
|
||||
storePath,
|
||||
});
|
||||
expect(visible.ok).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user