From c42131afaa680f70ce8c0f852cfbdfa12654085c Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 28 May 2026 00:06:36 +0800 Subject: [PATCH] fix: tune gateway tran upload chunks --- skills/device-pod-cli/SKILL.md | 10 +++++++--- tools/hwlab-gateway-tran.mjs | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/skills/device-pod-cli/SKILL.md b/skills/device-pod-cli/SKILL.md index 779506aa..cb2cee2a 100644 --- a/skills/device-pod-cli/SKILL.md +++ b/skills/device-pod-cli/SKILL.md @@ -42,8 +42,9 @@ device pod, debug probe control, or I/O probe reads such as UART boot logs. development tool that HWLAB internal code agents, including DeepSeek-backed runners, may keep improving on the target Windows workspace when hardware, Keil, probe, UART, or filesystem operations are not smooth enough. Hot fixes - must be validated through the real device-pod/gateway route first, then copied - back into the HWLAB repo asset for the next CI/CD preinstall. + are expected whenever host-side behavior is awkward or missing; validate them + through the real device-pod/gateway route first, then copy the result back into + the HWLAB repo asset for the next CI/CD preinstall. ## Windows Host CLI Bootstrap @@ -64,7 +65,10 @@ use the same remote channel that backs cmd passthrough. In HWLAB coder images, `/app/tools/hwlab-gateway-tran.mjs` is only the compatible explicit wrapper for the same transport. If the compatible wrapper exists but `/app/tools/tran.mjs` is missing, report a CI/CD preinstall gap instead of adding a device-pod -workaround. +workaround. `tran.mjs upload` uses bounded base64 chunks tuned for the Windows +cmd passthrough limit; do not raise the chunk size above the documented default +to hide slow transfers. If upload/download becomes awkward again, fix `tran.mjs` +or the gateway transport first. ```text node /app/tools/tran.mjs :/d/Work/HWLAB-workspace upload /app/skills/device-pod-cli/assets/device-host-cli.mjs tools/device-host-cli.mjs diff --git a/tools/hwlab-gateway-tran.mjs b/tools/hwlab-gateway-tran.mjs index 08391dcb..7cbb399b 100644 --- a/tools/hwlab-gateway-tran.mjs +++ b/tools/hwlab-gateway-tran.mjs @@ -17,8 +17,8 @@ const DEFAULT_RESOURCE_ID = "res_windows_host"; const DEFAULT_CAPABILITY_ID = "cap_windows_cmd_exec"; const DEFAULT_TIMEOUT_MS = 120000; const MAX_TIMEOUT_MS = 600000; -const DEFAULT_CHUNK_SIZE = 900; -const MAX_CHUNK_SIZE = 3000; +const DEFAULT_CHUNK_SIZE = 2000; +const MAX_CHUNK_SIZE = 2000; const REQUEST_TIMEOUT_GRACE_MS = 10000; const POWERSHELL_PROLOGUE = [ "$ErrorActionPreference = 'Stop';", @@ -444,7 +444,7 @@ function printHelp(exitCode = 0) { " --api-base-url URL Default http://127.0.0.1:6667 or HWLAB_GATEWAY_TRAN_API_BASE_URL.", " --timeout-ms N Gateway command timeout, default 120000ms.", " --request-timeout-ms N HTTP wait timeout; defaults to command timeout plus grace.", - " --chunk-size N Upload/download base64 chunk size, default 900, max 3000.", + " --chunk-size N Upload/download base64 chunk size, default 2000, max 2000.", " --json Print the full JSON response for cmd/ps or transfer summary.", "", "Examples:",