Skip to content

A self-improving RLM agent for coding workflows and long-running autonomous tasks.

Rust

fix trace upload failing with und_err_invalid_arg on undici 7.28 (#243)

kt64f54978fd27
diff --git a/packages/coding-agent/src/core/agent-traces.ts b/packages/coding-agent/src/core/agent-traces.ts
index f1227c5187..160a706aa1 100644
--- a/packages/coding-agent/src/core/agent-traces.ts
+++ b/packages/coding-agent/src/core/agent-traces.ts
@@ -446,7 +446,6 @@ async function performAgentTraceUpload(options: AgentTraceUploadOptions): Promis
Authorization: `Bearer ${credential.apiKey}`,
"Content-Type": "application/x-ndjson",
Accept: "application/json",
- "Content-Length": String(bodyBytes),
"X-Trace-Id": traceContext.traceId,
"X-Cwd": header.cwd,
"X-Agent-Version": VERSION,
diff --git a/packages/coding-agent/test/agent-traces.test.ts b/packages/coding-agent/test/agent-traces.test.ts
index 73d96e7e7c..72ee37cb7b 100644
--- a/packages/coding-agent/test/agent-traces.test.ts
+++ b/packages/coding-agent/test/agent-traces.test.ts
@@ -1,4 +1,3 @@
-import { Buffer } from "node:buffer";
import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
@@ -226,7 +225,7 @@ describe("agent trace upload", () => {
expect(headers.get("x-parent-session")).toBe("parent-session");
expect(headers.get("x-cwd")).toBe(cwd);
expect(headers.get("x-agent-version")).toBeTruthy();
- expect(headers.get("content-length")).toBe(String(Buffer.byteLength(call.init.body as string, "utf8")));
+ expect(headers.get("content-length")).toBeNull();
});
it("uses the production trace API unless a trace-specific base URL is configured", async () => {