feat: surface codex image generation progress
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 image generation as a safe activity and artifact", async () => {
|
||||
const previous = process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_IMAGE_GENERATION_EVENTS;
|
||||
process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_IMAGE_GENERATION_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-image-generation-events",
|
||||
taskType: "conversation_reply",
|
||||
targetCodexThreadRef: "019d-app-server-thread",
|
||||
targetCodexFolderRef: repoRoot,
|
||||
executionPrompt: "检查 Codex imageGeneration item",
|
||||
});
|
||||
|
||||
assert.equal(result.status, "completed");
|
||||
assert.deepEqual(result.executionProgress.toolActivities, [
|
||||
{
|
||||
kind: "image_generation",
|
||||
name: "imageGeneration",
|
||||
status: "completed",
|
||||
detail: "generated-secret-image.png",
|
||||
},
|
||||
]);
|
||||
assert.deepEqual(result.executionProgress.artifacts, [
|
||||
{
|
||||
id: "artifact-1",
|
||||
label: "generated-secret-image.png",
|
||||
kind: "image",
|
||||
},
|
||||
]);
|
||||
const serialized = JSON.stringify(result.executionProgress);
|
||||
assert.equal(serialized.includes("image-generation-secret-should-not-leak"), false);
|
||||
assert.equal(serialized.includes("raw-secret-should-not-leak"), false);
|
||||
assert.equal(serialized.includes("sk-secret-should-not-leak"), false);
|
||||
assert.equal(serialized.includes("/Users/kris"), false);
|
||||
assert.equal(serialized.includes("internal prompt"), false);
|
||||
} finally {
|
||||
if (previous === undefined) {
|
||||
delete process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_IMAGE_GENERATION_EVENTS;
|
||||
} else {
|
||||
process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_IMAGE_GENERATION_EVENTS = previous;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
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";
|
||||
|
||||
Reference in New Issue
Block a user