feat: expose codex thread action capabilities

This commit is contained in:
AI Bot
2026-06-03 11:14:12 +08:00
parent 0071dec860
commit b0526215c5
12 changed files with 113 additions and 6 deletions

View File

@@ -37,8 +37,18 @@ if (args[0] === "app-server" && args[1] === "generate-json-schema") {
anyOf: [
{ properties: { method: { const: "thread/start" } } },
{ properties: { method: { const: "thread/inject_items" } } },
{ properties: { method: { const: "thread/archive" } } },
{ properties: { method: { const: "thread/unarchive" } } },
{ properties: { method: { const: "thread/fork" } } },
{ properties: { method: { const: "thread/compact/start" } } },
{ properties: { method: { const: "thread/rollback" } } },
{ properties: { method: { const: "thread/name/set" } } },
{ properties: { method: { const: "thread/metadata/update" } } },
{ properties: { method: { const: "thread/shellCommand" } } },
{ properties: { method: { const: "thread/unsubscribe" } } },
{ properties: { method: { const: "skills/extraRoots/set" } } },
{ properties: { method: { const: "hooks/list" } } },
{ properties: { method: { const: "turn/interrupt" } } },
{ properties: { method: { const: "turn/start" } } }
]
}, null, 2));
@@ -80,11 +90,31 @@ process.exit(2);
assert.equal(manifest.supports.threadInjectItems, true);
assert.equal(manifest.supports.skillsExtraRoots, true);
assert.equal(manifest.supports.hooksList, true);
assert.equal(manifest.supports.threadArchive, true);
assert.equal(manifest.supports.threadUnarchive, true);
assert.equal(manifest.supports.threadFork, true);
assert.equal(manifest.supports.threadCompactStart, true);
assert.equal(manifest.supports.threadRollback, true);
assert.equal(manifest.supports.threadNameSet, true);
assert.equal(manifest.supports.threadMetadataUpdate, true);
assert.equal(manifest.supports.threadShellCommand, true);
assert.equal(manifest.supports.threadUnsubscribe, true);
assert.equal(manifest.supports.turnInterrupt, true);
assert.deepEqual(manifest.methods, [
"hooks/list",
"skills/extraRoots/set",
"thread/archive",
"thread/compact/start",
"thread/fork",
"thread/inject_items",
"thread/metadata/update",
"thread/name/set",
"thread/rollback",
"thread/shellCommand",
"thread/start",
"thread/unarchive",
"thread/unsubscribe",
"turn/interrupt",
"turn/start",
]);
assert.match(

View File

@@ -154,6 +154,15 @@ test("device detail exposes Codex App Server discovered model and extension summ
},
],
},
threadActionSummary: {
actionCount: 11,
lifecycleActionCount: 5,
metadataActionCount: 2,
liveTurnActionCount: 2,
shellActionAvailable: true,
userInitiatedOnly: true,
labels: ["归档", "恢复", "分叉", "压缩", "回滚", "改名", "元数据", "活跃干预", "中断", "Shell", "取消订阅"],
},
},
},
};
@@ -172,6 +181,7 @@ test("device detail exposes Codex App Server discovered model and extension summ
assert.equal(cards.capabilities.items.codexHooks, "Hook2 个 · 启用 1 个 · 警告 1 个");
assert.equal(cards.capabilities.items.codexThreads, "线程3 个 · 已加载 2 个 · 活跃 1 个 · 最新 2026-06-03 16:20");
assert.equal(cards.capabilities.items.codexTurns, "轮次3 个 · 运行中 1 个 · 完成 2 个 · 最新 2026-06-03 16:21");
assert.equal(cards.capabilities.items.codexThreadActions, "线程操作11 项 · 生命周期 5 项 · 活跃干预 2 项 · Shell 可用");
});
test("device detail exposes folder and project conflict skeleton from workspace policy", async () => {

View File

@@ -114,6 +114,15 @@ test("codex app-server discovery includes governance and MCP summaries without l
latestTurnStatus: "running",
latestTurnUpdatedAt: "2026-06-03T08:21:00.000Z",
});
assert.deepEqual(metadata.threadActionSummary, {
actionCount: 11,
lifecycleActionCount: 5,
metadataActionCount: 2,
liveTurnActionCount: 2,
shellActionAvailable: true,
userInitiatedOnly: true,
labels: ["归档", "恢复", "分叉", "压缩", "回滚", "改名", "元数据", "活跃干预", "中断", "Shell", "取消订阅"],
});
const serialized = JSON.stringify(metadata);
assert.equal(serialized.includes("sk-secret-should-not-leak"), false);