feat: surface codex reasoning summaries
This commit is contained in:
@@ -718,6 +718,58 @@ test("codex app-server runner maps tool, search, image, review, and command acti
|
||||
}
|
||||
});
|
||||
|
||||
test("codex app-server runner maps item plan and reasoning summary without leaking raw reasoning", async () => {
|
||||
const previous = process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_REASONING_PLAN_EVENTS;
|
||||
process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_REASONING_PLAN_EVENTS = "1";
|
||||
try {
|
||||
const runnerConfig = getCodexAppServerRunnerConfig(process.env, {
|
||||
codexAppServerEnabled: true,
|
||||
codexAppServerCommand: process.execPath,
|
||||
codexAppServerArgs: ["tests/fixtures/codex-app-server-runtime.mjs"],
|
||||
codexAppServerWorkdir: repoRoot,
|
||||
codexAppServerTimeoutMs: 5000,
|
||||
masterAgentModel: "gpt-5.4",
|
||||
});
|
||||
|
||||
const result = await executeCodexAppServerTask(runnerConfig, {
|
||||
taskId: "task-app-server-reasoning-plan-events",
|
||||
taskType: "conversation_reply",
|
||||
targetCodexThreadRef: "019d-app-server-thread",
|
||||
targetCodexFolderRef: repoRoot,
|
||||
executionPrompt: "检查 Codex plan 和 reasoning item",
|
||||
});
|
||||
|
||||
assert.equal(result.status, "completed");
|
||||
assert.deepEqual(result.executionProgress.steps, [
|
||||
{
|
||||
id: "plan-item-1",
|
||||
text: "回读官方 App Server item 协议",
|
||||
status: "pending",
|
||||
},
|
||||
{
|
||||
id: "plan-item-2",
|
||||
text: "补充 reasoning summary 安全映射",
|
||||
status: "pending",
|
||||
},
|
||||
]);
|
||||
assert.deepEqual(result.executionProgress.reasoningSummary, {
|
||||
status: "completed",
|
||||
summary: "确认只展示官方 summary,不展示 raw content。",
|
||||
});
|
||||
const serialized = JSON.stringify(result.executionProgress);
|
||||
assert.equal(serialized.includes("raw hidden reasoning"), false);
|
||||
assert.equal(serialized.includes("raw hidden chain of thought"), false);
|
||||
assert.equal(serialized.includes("sk-secret-should-not-leak"), false);
|
||||
assert.equal(serialized.includes("reasoning-secret-should-not-leak"), false);
|
||||
} finally {
|
||||
if (previous === undefined) {
|
||||
delete process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_REASONING_PLAN_EVENTS;
|
||||
} else {
|
||||
process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_REASONING_PLAN_EVENTS = previous;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test("codex app-server runner bridges source thread context into target thread through inject_items", async () => {
|
||||
const previous = process.env.BOSS_CODEX_APP_SERVER_FIXTURE_INTER_THREAD;
|
||||
process.env.BOSS_CODEX_APP_SERVER_FIXTURE_INTER_THREAD = "1";
|
||||
|
||||
Reference in New Issue
Block a user