fix(consult): pin daily entrypoint domains and sentence-filter thinking (BUG-612/613)
Independent Staging Quality Gate / validate (push) Successful in 10m6s
Independent Staging Quality Gate / publish (push) Successful in 2m4s

Homepage「深入看今日」was rewritten to natal 综合, then each compose slice burned its only step on a tool call, so the answer stayed empty. Pin the route theme, write the three daily sections with tools disabled, and filter thinking by sentence so English word-salad cannot leak.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-09-09 17:38:08 +08:00
co-authored by Cursor
parent 3005e36d6c
commit 17b36f3a9f
18 changed files with 647 additions and 34 deletions
+13 -3
View File
@@ -747,6 +747,7 @@ export async function POST(request: Request) {
let logged = false;
const markFirstActivity = () => { if (firstActivityMs < 0) firstActivityMs = Date.now() - agentStartedAt; };
const markFirstText = () => { if (firstTextMs < 0) firstTextMs = Date.now() - agentStartedAt; };
const consultEntrypoint = parsed.success ? parsed.data.entrypoint : undefined;
const logRun = async (
errorCode: string | undefined,
settlementResult: AgentSettlementResult,
@@ -837,7 +838,9 @@ export async function POST(request: Request) {
}
};
const cacheBoundary = cachedSystemMessage("【上下文缓存边界】后续内容为本轮请求输入。", selectedModel.model);
const natalInstruction = "先加载 Jyotish Skill;如需新的个人星盘结论,必须调用服务器绑定的排盘工具。事业/财富/婚恋/家庭按 skill Level 2 模板写:原始结构、六步宫位、Yoga 表、时机、综合、文末技法审计表,然后才是现代生活措辞。不要复述内部 JSON 字段。";
const natalInstruction = consultEntrypoint === "daily_starlanguage"
? "先加载 Jyotish Skill;如需新的个人星盘结论,必须调用服务器绑定的排盘工具。按三节写:今日趋势、适合推进 / 需要避开、一个行动(把技法审计表和「探索性日提示,不是确定预测」放进最后一节)。不要复述内部 JSON 字段。"
: "先加载 Jyotish Skill;如需新的个人星盘结论,必须调用服务器绑定的排盘工具。事业/财富/婚恋/家庭按 skill Level 2 模板写:原始结构、六步宫位、Yoga 表、时机、综合、文末技法审计表,然后才是现代生活措辞。不要复述内部 JSON 字段。";
const adoptedRangeNote = consultationMode === "verified_chart"
&& prepared.serverChart?.truth.birthTimeStatus === "accepted"
&& prepared.serverChart.toolInput.candidate_range
@@ -1105,6 +1108,7 @@ export async function POST(request: Request) {
consultationMode: consultationMode === "verified_chart" ? "verified_chart" : "unverified_birth_time",
plan: prepared.preReserveResult,
theme: consultationTheme,
entrypoint: consultEntrypoint,
serverChart: prepared.serverChart,
abortSignal: agentAbortSignal,
state,
@@ -1148,14 +1152,20 @@ export async function POST(request: Request) {
usages.push(continued.totalUsage);
return continued.fullStream;
};
const composeSection = async (heading: string, priorOutput: string) => {
const composeSection = async (
heading: string,
priorOutput: string,
reason: "write" | "empty-retry" = "write",
) => {
const sliced = await agent.stream([
...baseMessages,
...(priorOutput.trim() ? [{ role: "assistant" as const, content: priorOutput }] : []),
{ role: "user" as const, content: consultationSectionPrompt(heading, priorOutput) },
{ role: "user" as const, content: consultationSectionPrompt(heading, priorOutput, { reason }) },
], {
...streamOptions,
maxSteps: AGENT_SLICE_MAX_STEPS,
// 原值:分段可调工具 → 新值:分段禁用 → 决策 3
toolChoice: "none",
...consultationSliceGenerationSettings(selectedModel.model),
});
usages.push(sliced.totalUsage);