feat: map codex thread collaboration progress

This commit is contained in:
AI Bot
2026-06-01 17:52:29 +08:00
parent defa3da185
commit 2a5dccf5cb
11 changed files with 317 additions and 7 deletions

View File

@@ -595,6 +595,53 @@ test("codex app-server runner maps account, quota, verification, and notices wit
}
});
test("codex app-server runner maps collab tool calls and context compaction without leaking thread internals", async () => {
const previous = process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_COLLAB_EVENTS;
process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_COLLAB_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-collab-events",
taskType: "conversation_reply",
targetCodexThreadRef: "019d-app-server-thread",
targetCodexFolderRef: repoRoot,
executionPrompt: "让目标线程协作推进",
});
assert.equal(result.status, "completed");
assert.deepEqual(result.executionProgress.threadCollaboration, {
tool: "send_input",
status: "completed",
target: "已有线程",
agentStatus: "completed",
});
assert.deepEqual(result.executionProgress.compaction, {
status: "completed",
message: "上下文已压缩",
});
const serialized = JSON.stringify(result.executionProgress);
assert.equal(serialized.includes("thread-source-secret-should-not-leak"), false);
assert.equal(serialized.includes("thread-target-secret-should-not-leak"), false);
assert.equal(serialized.includes("internal prompt"), false);
assert.equal(serialized.includes("sk-secret-should-not-leak"), false);
assert.equal(serialized.includes("context-compaction-secret-should-not-leak"), false);
} finally {
if (previous === undefined) {
delete process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_COLLAB_EVENTS;
} else {
process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_COLLAB_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";