fix(agents): skip thinking tags in code spans
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { AgentEvent, AgentMessage } from "@mariozechner/pi-agent-core";
|
||||
|
||||
import type { ReasoningLevel } from "../auto-reply/thinking.js";
|
||||
import type { InlineCodeState } from "../markdown/code-spans.js";
|
||||
import type { EmbeddedBlockChunker } from "./pi-embedded-block-chunker.js";
|
||||
import type { MessagingToolSend } from "./pi-embedded-messaging.js";
|
||||
import type {
|
||||
@@ -27,7 +28,7 @@ export type EmbeddedPiSubscribeState = {
|
||||
|
||||
deltaBuffer: string;
|
||||
blockBuffer: string;
|
||||
blockState: { thinking: boolean; final: boolean };
|
||||
blockState: { thinking: boolean; final: boolean; inlineCode: InlineCodeState };
|
||||
lastStreamedAssistant?: string;
|
||||
lastStreamedReasoning?: string;
|
||||
lastBlockReplyText?: string;
|
||||
@@ -56,7 +57,10 @@ export type EmbeddedPiSubscribeContext = {
|
||||
|
||||
shouldEmitToolResult: () => boolean;
|
||||
emitToolSummary: (toolName?: string, meta?: string) => void;
|
||||
stripBlockTags: (text: string, state: { thinking: boolean; final: boolean }) => string;
|
||||
stripBlockTags: (
|
||||
text: string,
|
||||
state: { thinking: boolean; final: boolean; inlineCode?: InlineCodeState },
|
||||
) => string;
|
||||
emitBlockChunk: (text: string) => void;
|
||||
flushBlockReplyBuffer: () => void;
|
||||
emitReasoningStream: (text: string) => void;
|
||||
|
||||
Reference in New Issue
Block a user