Uh oh!
There was an error while loading. Please reload this page.
feat(runtime): add FormatJson builtin tool - #603
Conversation
luojiyin1987
commented
Jul 7, 2026
CI Status NoteThe failing Verification
FixI opened #608 which removes the stale If the maintainers prefer a different fix (e.g. re-adding the |
jackwener
commented
Jul 8, 2026
Thanks — the implementation itself is clean (the proto preservation test and recursive sort coverage are genuinely good). Closing on first-principles grounds rather than code quality: The tool's economics don't work as a string→string function. The capability already exists in-session. For on-disk JSON the agent uses Bash ( Every builtin has a standing cost — a slot in every session's tool list that all prompts pay for and the model must consider. That budget should go to tools that unlock something the model can't do: side effects, host access, privileged data. A version of this that WOULD carry its weight: |
Summary
Closes#602
Adds
FormatJsonbuiltin tool — see issue #602 for full design.Changes
packages/runtime/src/builtin-tools.ts: +39 lines (FormatJson tool definition +sortKeysDeephelper)packages/runtime/src/__tests__/builtin-tools.test.ts: +69 lines (7 test cases)Verification
Notes
upstream/mainbefore opening this PR__proto__preservation behavior is documented in the testsortKeysDeepusesObject.fromEntriesto avoid the__proto__setter prototype pollution risk