fix(consult): BUG-950~953 Pass 4 按句放行,无分钟按句丢弃
正文不再整段 hold:闭合句立刻过 Pass 4,无 reject 即发(950)。 无出生分钟改为按句丢弃,全丢才用兜底句(951);该模式日期记 observe(952)。 校正流 token 级 thinking 死链按 P2 删除,测试翻转成否定合同(953)。
This commit is contained in:
@@ -22,7 +22,6 @@ import {
|
||||
type PublicRectificationPhase,
|
||||
type PublicRectificationTool,
|
||||
} from "./public-receipt";
|
||||
import { acceptThinkingFragment } from "../../think-step-gate";
|
||||
import { isToolInputRejection, toolResultFromChunk } from "./host-fallback";
|
||||
|
||||
export type PublicPhaseStreamEvent = Readonly<{
|
||||
@@ -176,28 +175,11 @@ export function mapStreamChunkToPhase(chunk: AgentChunkType): PublicPhaseStreamE
|
||||
return null;
|
||||
default:
|
||||
// Raw reasoning, payloads, step internals and provider metadata stay off
|
||||
// the answer channel. Chinese thinking is mapped separately.
|
||||
// the public stream. Provider CoT is never mapped to an outward event.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export type InternalThinkingDeltaEvent = Readonly<{
|
||||
type: "thinking.delta";
|
||||
text: string;
|
||||
}>;
|
||||
|
||||
export function toPublicThinkingDelta(text: string): InternalThinkingDeltaEvent | null {
|
||||
const cleaned = acceptThinkingFragment(text);
|
||||
if (!cleaned) return null;
|
||||
return { type: "thinking.delta", text: cleaned };
|
||||
}
|
||||
|
||||
export function mapStreamChunkToThinking(chunk: AgentChunkType): InternalThinkingDeltaEvent | null {
|
||||
if (chunk.type !== "reasoning-delta") return null;
|
||||
const text = typeof chunk.payload?.text === "string" ? chunk.payload.text : "";
|
||||
return toPublicThinkingDelta(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Project real public tool lifecycle events for the live UI. This stream is
|
||||
* deliberately separate from the durable phase receipt: it never exposes
|
||||
|
||||
Reference in New Issue
Block a user