Skip to content

Open-source AI coworkers that each get a computer of their own: a browser, files and tools, with every action decided before it happens and recorded after. Bring any AG-UI agent.

Check text files out with LF, and find test paths on Windows (#680)

Omkar Chebalec14a99202e74
diff --git a/.gitattributes b/.gitattributes
index dfe07704..eebb4bb6 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1,3 @@
-# Auto detect text files and perform LF normalization
-* text=auto
+# Auto detect text files and perform LF normalization, and check them out with LF on every OS.
+# Biome formats to LF and the s6 files are copied into a Linux image, so a CRLF checkout breaks both.
+* text=auto eol=lf
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b2db4f28..61eb6651 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,14 @@ Newest first. `Unreleased` is what is on `main` and not yet tagged.
## Unreleased
+### A clone on Windows builds an image that starts
+
+On Windows, where Git converts line endings by default, a clone checked every text file out with
+CRLF. `docker build` copied the s6 service files into the image that way, so a service's `type`
+read `longrun\r` and its scripts stopped on `set: -: invalid option`, and `bun run format:check`
+failed on every file. `.gitattributes` now checks text files out with LF on every system. An
+existing clone with nothing uncommitted picks this up after `git rm -r --cached . && git reset --hard`.
+
### A routine switched back on gets a fresh count of failures
A routine that fails ten times in a row is switched off, and someone has to switch it back on.
diff --git a/agent-computer/tests/identity.test.ts b/agent-computer/tests/identity.test.ts
index f7110a98..d71ddd6c 100644
--- a/agent-computer/tests/identity.test.ts
+++ b/agent-computer/tests/identity.test.ts
@@ -3,8 +3,11 @@ import { mkdtemp, rm, writeFile } from "node:fs/promises";
import { createServer } from "node:net";
import { tmpdir } from "node:os";
import { join } from "node:path";
+import { fileURLToPath } from "node:url";
-const identityModule = new URL("../src/identity.ts", import.meta.url).pathname;
+const identityModule = fileURLToPath(
+ new URL("../src/identity.ts", import.meta.url),
+);
// A fresh process preserves the production once-only lookup and keeps the client trap local to
// this test. The filesystem is real; the trap must never forward to a workload identity service.
diff --git a/app/tests/serve.test.ts b/app/tests/serve.test.ts
index 15420079..65d1499b 100644
--- a/app/tests/serve.test.ts
+++ b/app/tests/serve.test.ts
@@ -41,7 +41,7 @@ Bun.serve = (options) => {
preload,
"serve.ts",
],
- cwd: import.meta.dir.replace(/\/tests$/, ""),
+ cwd: join(import.meta.dir, ".."),
env,
stdout: "pipe",
stderr: "pipe",
@@ -149,22 +149,22 @@ describe("what answers a request", () => {
describe("which file a path names", () => {
test("the root and any directory are the page", () => {
- expect(fileFor("/")).toEndWith("/dist/index.html");
- expect(fileFor("/channel/")).toEndWith("/dist/index.html");
+ expect(fileFor("/")).toEndWith(join("/dist/index.html"));
+ expect(fileFor("/channel/")).toEndWith(join("/dist/index.html"));
});
test("a built asset is itself", () => {
expect(fileFor("/assets/index-abc.js")).toEndWith(
- "/dist/assets/index-abc.js",
+ join("/dist/assets/index-abc.js"),
);
});
test("an encoded asset remains inside the static directory", () => {
expect(fileFor("/assets/hello%20world.js")).toEndWith(
- "/dist/assets/hello world.js",
+ join("/dist/assets/hello world.js"),
);
expect(fileFor("/assets/caf%C3%A9%25.js")).toEndWith(
- "/dist/assets/café%.js",
+ join("/dist/assets/café%.js"),
);
});
@@ -196,12 +196,12 @@ describe("which file a path names", () => {
});
test("only decoded NUL is refused by the invalid-path guard", () => {
- expect(fileFor("/assets/a%1Fb.js")).toEndWith("/dist/assets/ab.js");
+ expect(fileFor("/assets/a%1Fb.js")).toEndWith(join("/dist/assets/ab.js"));
});
test("a client route remains available for the router", () => {
expect(fileFor("/channel/channel_1ed78a89")).toEndWith(
- "/dist/channel/channel_1ed78a89",
+ join("/dist/channel/channel_1ed78a89"),
);
});
@@ -313,7 +313,7 @@ async function startProxy(upstreamPort: number) {
const port = await unusedPort();
const child = Bun.spawn({
cmd: [process.execPath, "--no-env-file", "serve.ts"],
- cwd: import.meta.dir.replace(/\/tests$/, ""),
+ cwd: join(import.meta.dir, ".."),
env: { APP_PORT: String(port), SERVER_PORT: String(upstreamPort) },
stdout: "pipe",
stderr: "pipe",