feat: surface codex hook lifecycle progress

This commit is contained in:
AI Bot
2026-06-01 18:48:45 +08:00
parent 32a9c9a26a
commit b0a778ee68
9 changed files with 163 additions and 6 deletions

View File

@@ -849,6 +849,64 @@ rl.on("line", (line) => {
},
});
}
if (process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_HOOK_EVENTS === "1") {
send({
method: "hook/started",
params: {
threadId: message.params?.threadId,
turnId: "turn-fixture",
run: {
id: "hook-secret-should-not-leak",
eventName: "postToolUse",
handlerType: "command",
executionMode: "async",
scope: "turn",
sourcePath: "/Users/kris/code/boss/.codex/hooks/private-hook.toml",
source: "project",
displayOrder: 1,
status: "running",
statusMessage: "running token=sk-secret-should-not-leak",
startedAt: Date.now(),
completedAt: null,
durationMs: null,
entries: [
{
kind: "context",
text: "internal hook output token=sk-secret-should-not-leak",
},
],
},
},
});
send({
method: "hook/completed",
params: {
threadId: message.params?.threadId,
turnId: "turn-fixture",
run: {
id: "hook-secret-should-not-leak",
eventName: "postToolUse",
handlerType: "command",
executionMode: "async",
scope: "turn",
sourcePath: "/Users/kris/code/boss/.codex/hooks/private-hook.toml",
source: "project",
displayOrder: 1,
status: "completed",
statusMessage: "completed token=sk-secret-should-not-leak",
startedAt: Date.now() - 42,
completedAt: Date.now(),
durationMs: 42,
entries: [
{
kind: "feedback",
text: "private hook result token=sk-secret-should-not-leak",
},
],
},
},
});
}
if (process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_REASONING_PLAN_EVENTS === "1") {
send({
method: "item/completed",