feat(api): accept a lane tool on create, start and binary probe
This commit is contained in:
@@ -988,3 +988,23 @@ exit 1
|
||||
assert.equal(r.body.checks[0].name, "tests");
|
||||
});
|
||||
});
|
||||
|
||||
describe("/api/lanes tool tests", () => {
|
||||
it("POST /api/lanes/ensure stores the requested tool", async () => {
|
||||
const res = await request("POST", "/api/lanes/ensure", {
|
||||
cwd: "/tmp/codex-lane",
|
||||
tool: "codex",
|
||||
});
|
||||
assert.equal(res.status, 201);
|
||||
assert.equal(res.body.lane.tool, "codex");
|
||||
});
|
||||
|
||||
it("POST /api/lanes/ensure rejects an unknown tool", async () => {
|
||||
const res = await request("POST", "/api/lanes/ensure", {
|
||||
cwd: "/tmp/bad-tool",
|
||||
tool: "cursor",
|
||||
});
|
||||
assert.equal(res.status, 400);
|
||||
assert.equal(res.body.error.code, "EBADTOOL");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -174,4 +174,15 @@ describe("/api/run", () => {
|
||||
assert.equal(status, 200);
|
||||
assert.ok(Array.isArray(body.items));
|
||||
});
|
||||
|
||||
it("GET /api/run/binary?tool=codex probes codex, not claude", async () => {
|
||||
const res = await fetchJson("/api/run/binary?tool=codex");
|
||||
assert.equal(res.status, 200);
|
||||
assert.equal(typeof res.body.found, "boolean");
|
||||
});
|
||||
|
||||
it("GET /api/run/binary rejects an unknown tool", async () => {
|
||||
const res = await fetchJson("/api/run/binary?tool=rm");
|
||||
assert.equal(res.status, 400);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user