agy-cli 0.1.14: tool schema patterns are turned into RE2 or dropped, so an ECMA-262 pattern no longer aborts the turn (klarkxy #946)
Tool input schemas' `pattern` and `patternProperties` keys are translated to RE2 (re2-pattern.mjs) before they reach agy; a pattern RE2 can't hold is dropped with a hint, and `additionalProperties: false` is lifted when every patternProperties key was dropped. Closes #944. Reviewed head 99093088 (onc27ba5f7), landed onto maina0b1e491with the version moved to 0.1.14. Run at the reviewed head: WSL2 bun test packages/agy-cli 9 of 9, check.mjs ok; Windows 8 pass, 1 fail, the same smoke red as main (#973). A fuzz of 1,033 kept patterns compiled every one with Go's regexp (go1.26.8), against 222 failures before the `[:` fix. Broken by hand: the `[:` reject, the sanitizePatternFields call, the propertyNames / contains / if / then / else / unevaluated* recursion and the additionalProperties lift each turn re2-pattern-unit.mjs red. Run at this commit (WSL2 Ubuntu 24.04, Bun 1.4.2, temp HOME): bun test packages/agy-cli 9 of 9 pass; bun scripts/check.mjs agy-cli ok. Not tried: macOS (mote refused ssh), a real agy. Closes #946 Co-authored-by: klarkxy <klarkxy@users.noreply.github.com>
This commit is contained in:
@@ -30,6 +30,13 @@ for (const [name, mocks] of [
|
||||
}, 250_000)
|
||||
}
|
||||
|
||||
|
||||
test("test/re2-pattern-unit.mjs", () => {
|
||||
const { code, output } = run([path.join(dir, "re2-pattern-unit.mjs")], 60_000)
|
||||
expect(output).toMatch(/ALL OK/)
|
||||
expect(code).toBe(0)
|
||||
}, 70_000)
|
||||
|
||||
test("test/smoke.mjs against a fake agy", () => {
|
||||
const { code, output } = run([path.join(dir, "smoke.mjs")], 240_000)
|
||||
expect(output).toMatch(/ALL OK \(\d+ checks\)/)
|
||||
|
||||
Reference in New Issue
Block a user