Merge pull request #123 from pikasTech/fix/issue20-remote-codex-queues-smoke

fix: support remote Code Queue summaries
This commit is contained in:
Lyon
2026-05-23 15:40:16 +08:00
committed by GitHub
3 changed files with 15 additions and 7 deletions
+7 -1
View File
@@ -2935,7 +2935,7 @@ export async function codexJudgeQueryAsync(taskId: string, optionArgs: string[],
return codexTaskJudgeAsync(taskId, parseJudgeOptions(optionArgs), fetcher);
}
export { codexTasksQueryAsync };
export { codexQueuesQueryAsync, codexTasksQueryAsync };
function requireQueueId(args: string[], command: string): string {
const index = args.indexOf("--queue");
@@ -3144,6 +3144,12 @@ export function codexQueuesQueryForTest(optionArgs: string[], fetcher: CodexResp
return compactQueuesResponse(response.body, options, response.upstream);
}
async function codexQueuesQueryAsync(optionArgs: string[], fetcher: AsyncCodexResponseFetcher): Promise<unknown> {
const options = parseQueuesOptions(optionArgs);
const response = unwrapCodexResponse(await fetcher(codeQueueProxyPath("/api/queues")));
return compactQueuesResponse(response.body, options, response.upstream);
}
function codeQueues(optionArgs: string[] = []): unknown {
return codexQueuesQueryForTest(optionArgs, coreInternalFetch);
}
+7 -5
View File
@@ -4,7 +4,7 @@ import { type DebugDispatchCommand, isDebugDispatchCommand } from "./debug";
import { summarizeMicroserviceHealthResponse, summarizeMicroserviceObservation, summarizeMicroserviceProxyResponse } from "./microservices";
import { parseNetworkPerfOptions, runNetworkPerf } from "./network-perf";
import { isSshSkillDiscoveryArgs, parseSshArgs } from "./ssh";
import { codexJudgeQueryAsync, codexOutputQueryAsync, codexPrPreflightQueryAsync, codexTaskQueryAsync, codexTasksQueryAsync } from "./code-queue";
import { codexJudgeQueryAsync, codexOutputQueryAsync, codexPrPreflightQueryAsync, codexQueuesQueryAsync, codexTaskQueryAsync, codexTasksQueryAsync } from "./code-queue";
import { runDecisionCenterCommandAsync } from "./decision-center";
import {
artifactRegistryReadonlyResultFromCommand,
@@ -781,8 +781,8 @@ function dispatchedTaskShape(remoteCommandShape: string): string {
async function remoteCodeQueue(session: FrontendSession, args: string[]): Promise<unknown> {
const action = args[1] ?? "task";
if (action !== "task" && action !== "summary" && action !== "show" && action !== "tasks" && action !== "overview" && action !== "output" && action !== "judge" && action !== "pr-preflight" && action !== "runtime-preflight") {
throw new Error("remote codex command must be: codex task <taskId>, codex tasks, codex output <taskId>, codex judge <taskId> --attempt N, or codex pr-preflight [--remote]");
if (action !== "task" && action !== "summary" && action !== "show" && action !== "tasks" && action !== "overview" && action !== "queues" && action !== "queue-list" && action !== "output" && action !== "judge" && action !== "pr-preflight" && action !== "runtime-preflight") {
throw new Error("remote codex command must be: codex task <taskId>, codex tasks, codex queues, codex output <taskId>, codex judge <taskId> --attempt N, or codex pr-preflight [--remote]");
}
const taskId = args[2];
if ((action === "task" || action === "summary" || action === "show" || action === "output" || action === "judge") && (taskId === undefined || taskId.length === 0)) {
@@ -802,7 +802,9 @@ async function remoteCodeQueue(session: FrontendSession, args: string[]): Promis
transport: "frontend",
result: action === "tasks" || action === "overview"
? await codexTasksQueryAsync(args.slice(1), fetcher)
: action === "output"
: action === "queues" || action === "queue-list"
? await codexQueuesQueryAsync(args.slice(2), fetcher)
: action === "output"
? await codexOutputQueryAsync(requiredTaskId, args.slice(3), fetcher)
: action === "pr-preflight" || action === "runtime-preflight"
? await codexPrPreflightQueryAsync(args.slice(1), fetcher)
@@ -874,7 +876,7 @@ async function runRemoteCliOverFrontend(options: RemoteCliOptions, config: UniDe
emitRemoteJson(name, {
transport: "frontend",
baseUrl: session.baseUrl,
commands: ["debug health", "debug dispatch", "debug task", "ssh <providerId> <command>", "ssh <providerId> skills", "artifact-registry status|health", "ci publish-user-service --dry-run", "ci publish-backend-core --dry-run", "microservice list", "microservice status <id>", "microservice health <id>", "microservice diagnostics <id>", "microservice tunnel-self-test <id>", "microservice proxy <id> <path>", "decision upload <markdown-file>", "decision list", "decision show <id>", "codex task <taskId>", "codex tasks", "codex judge <taskId> --attempt N", "codex pr-preflight [--remote]", "network perf"],
commands: ["debug health", "debug dispatch", "debug task", "ssh <providerId> <command>", "ssh <providerId> skills", "artifact-registry status|health", "ci publish-user-service --dry-run", "ci publish-backend-core --dry-run", "microservice list", "microservice status <id>", "microservice health <id>", "microservice diagnostics <id>", "microservice tunnel-self-test <id>", "microservice proxy <id> <path>", "decision upload <markdown-file>", "decision list", "decision show <id>", "codex task <taskId>", "codex tasks", "codex queues", "codex judge <taskId> --attempt N", "codex pr-preflight [--remote]", "network perf"],
});
return 0;
}