Unverified 提交 d8e54d9a authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Parameterize sys prompt (#1082)

<!-- This is an auto-generated description by cubic. --> ## Summary by cubic Parameterized the system prompt and tokenized it in e2e dumps to make snapshots smaller and stable. No runtime behavior changes; future prompt edits won’t churn tests. - **Refactors** - Exported BUILD_SYSTEM_PREFIX and BUILD_SYSTEM_POSTFIX from system_prompt.ts. - Updated test_helper to replace the full prompt with ${BUILD_SYSTEM_PREFIX}/${BUILD_SYSTEM_POSTFIX} tokens in message dumps. - Regenerated e2e snapshots to use tokens, reducing ~270 lines per snapshot. <!-- End of auto-generated description by cubic. -->
上级 b14177b0
......@@ -6,6 +6,10 @@ import path from "path";
import os from "os";
import { execSync } from "child_process";
import { generateAppFilesSnapshotData } from "./generateAppFilesSnapshotData";
import {
BUILD_SYSTEM_POSTFIX,
BUILD_SYSTEM_PREFIX,
} from "@/prompts/system_prompt";
const showDebugLogs = process.env.DEBUG_LOGS === "true";
......@@ -1144,6 +1148,8 @@ function prettifyDump(
const content = Array.isArray(message.content)
? JSON.stringify(message.content)
: message.content
.replace(BUILD_SYSTEM_PREFIX, "\n${BUILD_SYSTEM_PREFIX}")
.replace(BUILD_SYSTEM_POSTFIX, "${BUILD_SYSTEM_POSTFIX}")
// Normalize line endings to always use \n
.replace(/\r\n/g, "\n")
// We remove package.json because it's flaky.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论