Merge pull request #2685 from pikasTech/fix/2684-sub2api-trace-help

修复 codex-pool trace 的本地 scoped help
This commit is contained in:
Lyon
2026-07-20 23:51:37 +08:00
committed by GitHub
2 changed files with 32 additions and 0 deletions
+11
View File
@@ -1038,6 +1038,17 @@ async function loadHelp(loader: () => Promise<unknown>, fallback: unknown): Prom
export async function staticNamespaceHelp(args: string[]): Promise<unknown | null> {
const [top, sub] = args;
if (!args.slice(1).some(isHelpToken)) return null;
if (
top === "platform-infra"
&& sub === "sub2api"
&& args[2] === "codex-pool"
&& args[3] === "trace"
) {
return loadHelp(
async () => (await import("./platform-infra-sub2api-codex")).codexPoolTraceHelp(),
{ command: "platform-infra sub2api codex-pool trace", mutation: false },
);
}
if (
top === "platform-infra"
&& sub === "sub2api"
@@ -397,6 +397,27 @@ export interface CodexLocalConsumerTomlOptions {
responsesWebSocketsV2: boolean;
}
export function codexPoolTraceHelp(): Record<string, unknown> {
return {
command: "platform-infra sub2api codex-pool trace",
usage: "bun scripts/cli.ts platform-infra sub2api codex-pool trace --request-id <id> [options]",
options: {
"--request-id <id>": "Required client or internal request ID; --id is an alias.",
"--target <id>": "YAML-selected Sub2API target.",
"--since <duration>": "Search window such as 2h or 24h; default 24h.",
"--tail <count>": "Bounded runtime log tail from 100 to 200000; default 20000.",
"--context-seconds <count>": "Context around indexed events from 0 to 3600; default 300.",
"--show-lines": "Include bounded matched runtime log lines.",
"--full | --raw": "Explicit expanded or machine-readable disclosure.",
},
state: {
mutation: false,
remoteJobSubmitted: false,
helpSource: "local",
},
};
}
export function codexPoolHelp(): unknown {
const pool = readCodexPoolConfig();
const runtimeTarget = codexPoolRuntimeTarget();