Files
anomalyco_opencode/packages/opencode
Kit Langton 7df8cd1de7 fix(server): truncate schema-rejection reason to bound response + log size
Edge-case audit on PR #26631 caught two real exposures:

1. DoS amplification: Effect's Issue formatter recursively dumps the
   rejected `actual` value with no truncation. A 5K-element invalid
   array produced a 358 KB 400 response. Cap to 1 KB.

2. Secret echo: a token mis-posted to a typed endpoint (e.g.
   `{aggregate:"sk-..."}`) was mirrored verbatim in `data.message` AND
   in the warn log. Same cap mitigates — the field path is preserved,
   the rejected value is truncated.

Adds two regression tests:
- Query rejection (was uncovered; reachable in production)
- 50 KB invalid payload → response body stays < 2 KB
2026-05-09 23:28:37 -04:00
..
2026-02-25 01:48:10 -05:00
2026-03-27 15:00:26 +01:00
2026-02-14 04:19:02 +00:00
2026-02-18 13:54:23 -05:00

js

To install dependencies:

bun install

To run:

bun run index.ts

This project was created using bun init in bun v1.2.12. Bun is a fast all-in-one JavaScript runtime.