fix: support device-pod filename rg

This commit is contained in:
Codex Agent
2026-06-04 15:56:08 +08:00
parent ff7f07434d
commit 37f1b6af22
8 changed files with 112 additions and 25 deletions
+6 -5
View File
@@ -142,7 +142,7 @@ test("device pod executor lists and isolates multiple logical device pods", asyn
});
test("device-pod executor bounds gateway output text", async () => {
const longText = "z".repeat(13000);
const longText = "z".repeat(25000);
const cloudApi = createServer(async (request, response) => {
const body = await requestJson(request);
response.writeHead(200, { "content-type": "application/json; charset=utf-8" });
@@ -184,11 +184,12 @@ test("device-pod executor bounds gateway output text", async () => {
});
assert.equal(jobResponse.status, 202);
const output = await waitForJobStatus(service.port, "device-pod-test", "job_bounded_output_test", "completed");
assert.equal(output.output.text.length, 12000);
assert.equal(output.text.length, 12000);
assert.equal(output.bytes, 12000);
assert.equal(output.output.text.length, 24000);
assert.equal(output.text.length, 24000);
assert.equal(output.bytes, 24000);
assert.equal(output.truncation.truncated, true);
assert.equal(output.truncation.originalBytes, 13000);
assert.equal(output.truncation.originalBytes, 25000);
assert.equal(output.output.omitted.reason, "device_job_output_truncated");
assert.equal(JSON.stringify(output).includes(longText), false);
} finally {
await service.stop();
+2 -2
View File
@@ -15,7 +15,7 @@ const environment = process.env.HWLAB_ENVIRONMENT || process.env.HWLAB_GITOPS_PR
const cloudApiInternalUrl = normalizeBaseUrl(process.env.HWLAB_CLOUD_API_INTERNAL_URL || process.env.HWLAB_CLOUD_API_URL);
const internalToken = textOr(process.env.HWLAB_DEVICE_POD_INTERNAL_TOKEN, "");
const dispatchTimeoutMs = numberOr(process.env.HWLAB_DEVICE_POD_GATEWAY_DISPATCH_TIMEOUT_MS, 120000);
const DEVICE_JOB_OUTPUT_MAX_BYTES = 12000;
const DEVICE_JOB_OUTPUT_MAX_BYTES = 24000;
const jobs = new Map();
listen(createServer(async (request, response) => {
@@ -508,7 +508,7 @@ function deviceHostArgs(intent, args = {}) {
}
if (intent === "workspace.rg") {
const pattern = textOr(args.pattern ?? args.query, "");
return pattern ? ["workspace", "rg", pattern, textOr(args.path, "."), ...hostOptionArgs(args, ["glob", "g", "filesWithMatches", "l", "ignoreCase", "i", "maxCount"])] : null;
return pattern ? ["workspace", "rg", pattern, textOr(args.path, "."), ...hostOptionArgs(args, ["glob", "g", "filesWithMatches", "nameOnly", "names", "l", "ignoreCase", "i", "maxCount", "limit"])] : null;
}
if (intent === "workspace.put") {
const path = textOr(args.path, "");