feat: surface codex app server hook governance

This commit is contained in:
AI Bot
2026-06-03 11:03:45 +08:00
parent 3c6a0c546b
commit 0071dec860
13 changed files with 154 additions and 13 deletions

View File

@@ -73,6 +73,19 @@ test("codex app-server discovery includes governance and MCP summaries without l
rootCount: 2,
rootLabels: ["boss-shared-skills", "team-skills"],
});
assert.deepEqual(metadata.hookSummary, {
workspaceCount: 1,
hookCount: 2,
enabledHookCount: 1,
managedHookCount: 1,
trustedHookCount: 1,
modifiedHookCount: 1,
untrustedHookCount: 0,
warningCount: 1,
errorCount: 1,
eventNames: ["PreToolUse", "SessionStart"],
handlerTypes: ["command", "prompt"],
});
assert.equal(metadata.threadSummary.threadCount, 3);
assert.equal(metadata.threadSummary.loadedThreadCount, 2);
assert.equal(metadata.threadSummary.activeThreadCount, 1);
@@ -117,6 +130,14 @@ test("codex app-server discovery includes governance and MCP summaries without l
assert.equal(serialized.includes("private active turn text should not leak"), false);
assert.equal(serialized.includes("private item content should not leak"), false);
assert.equal(serialized.includes("private idle turn text should not leak"), false);
assert.equal(serialized.includes("private-hook.toml"), false);
assert.equal(serialized.includes("private-user-hook.toml"), false);
assert.equal(serialized.includes("broken-hook.toml"), false);
assert.equal(serialized.includes("private hook status"), false);
assert.equal(serialized.includes("private hook warning"), false);
assert.equal(serialized.includes("private hook error"), false);
assert.equal(serialized.includes("session-start-private-key"), false);
assert.equal(serialized.includes("sk-secret-should-not-leak"), false);
});
function encodeWsTextFrame(value) {