fix gateway shell head-of-line blocking

This commit is contained in:
Codex
2026-05-25 03:16:55 +00:00
parent 1aff6bb414
commit a59bed9a2a
13 changed files with 245 additions and 23 deletions
+3
View File
@@ -36,6 +36,7 @@ async function main() {
const apiBaseUrl = stripTrailingSlash(args.apiBaseUrl || process.env.HWLAB_GATEWAY_SHELL_API_BASE_URL || DEFAULT_API_BASE_URL);
const traceId = args.traceId || `trc_gateway_shell_cli_${Date.now()}`;
const requestId = args.requestId || `req_gateway_shell_cli_${randomUUID()}`;
const operationId = args.operationId || `op_gateway_shell_cli_${randomUUID()}`;
const timeoutMs = boundedPositiveInteger(args.timeoutMs ?? process.env.HWLAB_GATEWAY_SHELL_TIMEOUT_MS, DEFAULT_GATEWAY_SHELL_TIMEOUT_MS, {
min: 1000,
max: MAX_GATEWAY_SHELL_TIMEOUT_MS
@@ -56,6 +57,7 @@ async function main() {
},
body: {
projectId: args.projectId || DEFAULT_PROJECT_ID,
operationId,
gatewaySessionId: args.gatewaySessionId || DEFAULT_GATEWAY_SESSION_ID,
resourceId: args.resourceId || DEFAULT_RESOURCE_ID,
capabilityId: args.capabilityId || DEFAULT_CAPABILITY_ID,
@@ -123,6 +125,7 @@ function printHelp() {
" --cwd WINDOWS_PATH Gateway-side working directory; prefer this over shell-level cd &&",
" --timeout-ms N Gateway command timeout, default 120000ms; can also use HWLAB_GATEWAY_SHELL_TIMEOUT_MS",
" --request-timeout-ms N HTTP wait timeout; defaults to command timeout plus a small response grace",
" --operation-id ID Stable operationId to preserve correlation if dispatch times out",
" --project-id ID Default prj_mvp_topology",
" --gateway-session-id ID Default gws_DESKTOP-1MHOD9I",
" --resource-id ID Default res_windows_host",