Files
Peter Steinberger 5d6918244e perf(cli): reclaim startup-memory headroom on status and validation paths (#131428)
* perf(cli): defer status usage runtime imports

Keep credential resolution and provider usage dependencies behind the
optional status --usage boundary. Default status no longer loads the
model/auth graph merely to collect runtime diagnostics.

Preserve agent selection, credential routing, and usage merging while
removing redundant private loader wrappers. Extend the existing cold-import
suite with a reproduction that fails when default status imports auth.

Six local Node 24 samples reduce status JSON median peak RSS by 19.29 MiB
before the separate schema import cleanup, with a 1.77 MiB sample spread.

* perf(cli): trim schema validation startup imports

Use TypeBox's schema compiler and guard APIs for config and plugin manifest
validation instead of loading unused value codecs and transformations.
Preserve checks, format scoping, defaults, and structured validation errors.

Remove 145 TypeBox modules from the status and plugin inventory import
graphs. Extend the existing validation suite to reject eager value/compiler
imports, and shrink the assertion baseline after removing an unnecessary
error-array cast.

* test(cli): cover failed status usage imports

Extend the cold-import regression to prove requested usage and formatting preserve lazy-import failures while default status remains available before and after failure. Keep production behavior unchanged.
2026-08-27 19:48:12 -07:00
..