fix: tune gateway tran upload chunks

This commit is contained in:
Codex
2026-05-28 00:06:36 +08:00
parent 7ca065f0e8
commit c42131afaa
2 changed files with 10 additions and 6 deletions
+7 -3
View File
@@ -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 <gatewaySessionId>:/d/Work/HWLAB-workspace upload /app/skills/device-pod-cli/assets/device-host-cli.mjs tools/device-host-cli.mjs
+3 -3
View File
@@ -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:",