feat: sync codex thread names

This commit is contained in:
AI Bot
2026-06-03 14:06:15 +08:00
parent 0bcdcbfb9d
commit cc31b0d836
11 changed files with 311 additions and 2 deletions

View File

@@ -1618,6 +1618,34 @@ test("codex app-server runner archives and unarchives a thread without starting
assert.doesNotMatch(serialized, /private unarchived thread name should not leak/);
});
test("codex app-server runner renames a thread without starting a normal turn", async () => {
const runnerConfig = getCodexAppServerRunnerConfig(process.env, {
codexAppServerEnabled: true,
codexAppServerCommand: process.execPath,
codexAppServerArgs: ["tests/fixtures/codex-app-server-runtime.mjs"],
codexAppServerWorkdir: repoRoot,
codexAppServerTimeoutMs: 5000,
});
const result = await executeCodexAppServerTask(runnerConfig, {
taskId: "task-thread-rename",
taskType: "conversation_reply",
intentCategory: "thread_rename",
targetCodexThreadRef: "019d-app-server-thread",
targetCodexFolderRef: repoRoot,
threadRenameName: "Boss 量产治理线程",
executionPrompt: "同步 Codex 线程名称。",
});
assert.equal(result.status, "completed");
assert.equal(result.threadId, "019d-app-server-thread");
assert.equal(result.turnControl, "rename");
assert.equal(result.threadRename?.name, "Boss 量产治理线程");
assert.match(result.replyBody, /已同步 Codex 线程名称/);
assert.equal(result.turnId, undefined);
assert.doesNotMatch(JSON.stringify(result), /thread-name-secret-should-not-leak/);
});
test("codex app-server runner stays disabled unless feature flag is explicit", () => {
const runnerConfig = getCodexAppServerRunnerConfig(process.env, {
codexAppServerCommand: process.execPath,