feat: fork codex threads

This commit is contained in:
AI Bot
2026-06-03 14:49:43 +08:00
parent 5537fde7a6
commit 0c3437a36f
11 changed files with 393 additions and 1 deletions

View File

@@ -705,6 +705,32 @@ rl.on("line", (line) => {
return;
}
if (message.method === "thread/fork") {
send({
id: message.id,
result: {
thread: {
id: `${message.params?.threadId}-fork`,
sessionId: "fork-session",
forkedFromId: message.params?.threadId,
name: "Forked working thread",
preview: "Fork preview should be safe",
ephemeral: message.params?.ephemeral === true,
status: "idle",
path: "/private/path/that-should-not-leak",
cwd: "/private/cwd/that-should-not-leak",
turns: [],
internalForkSecret: "thread-fork-secret-should-not-leak",
},
model: "gpt-5.4",
modelProvider: "openai",
cwd: "/private/cwd/that-should-not-leak",
instructionSources: ["/private/AGENTS.md"],
},
});
return;
}
if (message.method === "thread/read") {
send({
id: message.id,