refactor(codemode): split runtime into focused interpreter modules (#36540)

This commit is contained in:
Aiden Cline 2026-07-12 12:47:56 -05:00 committed by GitHub
commit 49cb73b348
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 1911 additions and 2277 deletions

View file

@ -26,6 +26,22 @@ describe("CodeMode host failure boundary", () => {
})
})
test("does not rewrite explicit safe tool failures", async () => {
const result = await run(
Tool.make({
description: "Fail safely",
input: Schema.Struct({}),
output: Schema.String,
run: () => Effect.fail(toolError("File not found: /tmp/report.json")),
}),
)
expect(result.ok ? undefined : result.error).toStrictEqual({
kind: "ToolFailure",
message: "File not found: /tmp/report.json",
})
})
test("sanitizes unknown host failures and defects", async () => {
for (const failure of [
Effect.fail(new UnsafeHostError({ reason: "Authorization: Bearer typed-secret" })),