From 2a22359865c24a4c53ca6ea861957fd987694629 Mon Sep 17 00:00:00 2001 From: Codex Date: Wed, 27 May 2026 12:27:11 +0800 Subject: [PATCH] feat: preload gateway tran helper --- .../code-agent-session-registry.test.mjs | 22 +- internal/cloud/codex-stdio-session.mjs | 16 +- package.json | 2 +- scripts/g14-ci-plan.test.mjs | 2 +- scripts/src/g14-ci-plan-lib.mjs | 2 +- tools/hwlab-gateway-tran.mjs | 467 ++++++++++++++++++ web/hwlab-cloud-web/message-markdown.test.mjs | 6 +- web/hwlab-cloud-web/scripts/check.mjs | 38 +- .../scripts/trace-scroll.test.mjs | 8 +- 9 files changed, 514 insertions(+), 49 deletions(-) create mode 100644 tools/hwlab-gateway-tran.mjs diff --git a/internal/cloud/code-agent-session-registry.test.mjs b/internal/cloud/code-agent-session-registry.test.mjs index 0d4f07a9..8b041eed 100644 --- a/internal/cloud/code-agent-session-registry.test.mjs +++ b/internal/cloud/code-agent-session-registry.test.mjs @@ -790,14 +790,16 @@ test("Code Agent PC gateway prompt reaches Codex stdio instead of internal hardw assert.equal(providerCalled, false); const turn = calls.find((call) => call.method === "turn/start"); assert.ok(turn, "Codex stdio turn/start should be called"); - assert.match(turn.args.prompt, /\/app\/tools\/hwlab-gateway-shell\.mjs/u); + assert.match(turn.args.prompt, /\/app\/tools\/hwlab-gateway-tran\.mjs/u); + assert.match(turn.args.prompt, /gws_DESKTOP-1MHOD9I:\/f\/work/u); + assert.match(turn.args.prompt, /gws_DESKTOP-1MHOD9I:f:\/work\/hwlab\/\.tmp/u); + assert.match(turn.args.prompt, /improve \/app\/tools\/hwlab-gateway-tran\.mjs first/u); assert.match(turn.args.prompt, /C:\\Users\\liang\\\.agents\\skills/u); assert.match(turn.args.prompt, /cmd \/c echo HWLAB-PC-GW && hostname/u); - assert.match(turn.args.prompt, /--powershell-stdin/u); - assert.match(turn.args.prompt, /-EncodedCommand/u); - assert.match(turn.args.prompt, /Windows filesystem inventory/u); - assert.match(turn.args.prompt, /Select-Object -First/u); - assert.match(turn.args.prompt, /ConvertTo-HwlabJson/u); + assert.match(turn.args.prompt, /cmd -- /u); + assert.match(turn.args.prompt, /ps --