feat: surface codex reasoning summaries
This commit is contained in:
@@ -611,3 +611,60 @@ test("POST task progress preserves Codex tool activity summaries without leaking
|
||||
assert.equal(serialized.includes("/Users/kris"), false);
|
||||
assert.equal(serialized.includes("id_rsa"), false);
|
||||
});
|
||||
|
||||
test("POST task progress preserves Codex reasoning summaries without leaking raw content", async () => {
|
||||
const task = await data.queueMasterAgentTask({
|
||||
taskId: "route-progress-reasoning-summary-task",
|
||||
projectId: "group-progress-test",
|
||||
taskType: "dispatch_execution",
|
||||
requestMessageId: "msg-route-progress-reasoning-summary",
|
||||
requestText: "检查 Codex 思考摘要",
|
||||
executionPrompt: "检查 Codex 思考摘要",
|
||||
requestedBy: "krisolo",
|
||||
requestedByAccount: "krisolo",
|
||||
deviceId: "mac-studio",
|
||||
targetProjectId: "master-agent",
|
||||
targetThreadId: "master-agent-thread",
|
||||
});
|
||||
await data.claimNextMasterAgentTask("mac-studio");
|
||||
|
||||
const response = await postProgress(
|
||||
new NextRequest(`http://127.0.0.1:3000/api/v1/master-agent/tasks/${task.taskId}/progress`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
"x-boss-device-token": "boss-mac-studio-token",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
deviceId: "mac-studio",
|
||||
status: "running",
|
||||
executionProgress: {
|
||||
steps: [{ text: "同步 Codex 思考摘要", status: "running" }],
|
||||
reasoningSummary: {
|
||||
status: "completed",
|
||||
summary: "确认只展示官方 summary,不展示 raw content token=sk-secret-should-not-persist。",
|
||||
content: [{ text: "raw hidden chain of thought token=sk-secret-should-not-persist" }],
|
||||
itemId: "reasoning-secret-should-not-persist",
|
||||
},
|
||||
},
|
||||
}),
|
||||
}),
|
||||
{ params: Promise.resolve({ taskId: task.taskId }) },
|
||||
);
|
||||
|
||||
assert.equal(response.status, 200);
|
||||
|
||||
const state = await data.readState();
|
||||
const progress = state.projects
|
||||
.find((project) => project.id === "master-agent")
|
||||
?.messages.find((message) => message.executionProgress?.taskId === task.taskId)
|
||||
?.executionProgress;
|
||||
assert.deepEqual(progress?.reasoningSummary, {
|
||||
status: "completed",
|
||||
summary: "确认只展示官方 summary,不展示 raw content token=[redacted]",
|
||||
});
|
||||
const serialized = JSON.stringify(progress);
|
||||
assert.equal(serialized.includes("raw hidden chain of thought"), false);
|
||||
assert.equal(serialized.includes("sk-secret-should-not-persist"), false);
|
||||
assert.equal(serialized.includes("reasoning-secret-should-not-persist"), false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user