mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-26 03:03:04 +00:00
fix(timeline): exclude attachments from canonical prompt text
Structured provider prompts can include hidden history attachments before the user's text. Persist only plain prompt blocks so authoritative user messages match what the composer displayed while provider input remains unchanged.
This commit is contained in:
@@ -8183,9 +8183,20 @@ test("authoritative timeline includes provider-emitted submitted user prompt", a
|
||||
workspaceId: undefined,
|
||||
});
|
||||
|
||||
await manager.runAgent(snapshot.id, "hello from composer", {
|
||||
clientMessageId: "msg-client-1",
|
||||
});
|
||||
await manager.runAgent(
|
||||
snapshot.id,
|
||||
[
|
||||
{
|
||||
type: "text",
|
||||
mimeType: "text/plain",
|
||||
contextKind: "chat_history",
|
||||
title: "Chat history",
|
||||
text: "<chat-history-summary>hidden fork history</chat-history-summary>",
|
||||
},
|
||||
{ type: "text", text: "hello from composer" },
|
||||
],
|
||||
{ clientMessageId: "msg-client-1" },
|
||||
);
|
||||
|
||||
const liveEvents = events.filter(
|
||||
(event): event is Extract<AgentManagerEvent, { type: "agent_stream" }> =>
|
||||
|
||||
@@ -95,7 +95,7 @@ function submittedPromptText(prompt: AgentPromptInput): string {
|
||||
return prompt;
|
||||
}
|
||||
return prompt
|
||||
.flatMap((block) => (block.type === "text" ? [block.text] : []))
|
||||
.flatMap((block) => (block.type === "text" && !("mimeType" in block) ? [block.text] : []))
|
||||
.join("\n")
|
||||
.trim();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user