Files
ai-kit/test
CatoandClaude Opus 5 7959bb16bd feat: resolveChain may carry the env — keys move with the chain, or the probe lies (#38)
0.11.0 let a probe resolve its CHAIN per call, for an app whose provider
list lives in a database. It left the KEYS behind, and that is half a
feature: an admin screen that stores a per-provider api_key next to the
model is the ordinary case, not an exotic one. Resolving links from the
database while reading credentials from a process.env captured at
construction makes the probe report "no key" for a provider that is
configured and working — a false alarm from the module whose entire
purpose is to prevent false alarms.

resolveChain may now return { chain, env }. A bare Link[] keeps whatever
env the probe was built with, so 0.11.0's shape is unchanged.

Found immediately, wiring evig — the same app that motivated
resolveChain. Worth noting that the first version was shipped and
published before the gap showed up: the use case was understood and the
implementation still only covered half of it.

Both shapes verified by mutation: ignoring the resolved env turns exactly
the test that names it red, and the bare-array test proves the old
behaviour is intact.


Claude-Session: https://claude.ai/code/session_01NHDLTKGirKU7He8q2YR2y4

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-06 16:04:51 -07:00
..