v0.21.2 — desktop API hardening + drift-proof typed client
Two things: the new desktop API (chimera/api) got its first adversarial review, and the frontend's types are now generated from the backend so they can't drift.
Fixed — 8 findings from the 17th adversarial review (2 security-relevant)
- 🔒
.envwrite couldn't be injected via a value. The config-write endpoint allowlisted the key but not the value — a newline in a value could inject extra.envlines (e.g. a provider key). Values with\r/\nare now rejected. - 🔒 Read endpoints are guarded when a token is set. With
CHIMERA_SERVER_TOKENconfigured, transcripts / memory / config now require the token too (not just mutations). The token is injected into the SPA only for a loopback client, so the local browser authenticates while a remotely-exposed instance never hands the secret to remote clients. - The token guard reads settings fresh, so a token set at runtime takes effect immediately.
- Concurrent turns on the same session serialize behind a per-session lock (no more racing the transcript).
- The live-session cache is LRU-bounded (no unbounded growth from random session ids).
memorysearchkis clamped; an unknown/api/*path returns 404 instead of the SPA; the in-flight-cost-on-disconnect limit is documented.
Clean: SSE auth, secret masking, session/SPA path-traversal, project HITL (no token spend on approve/deny).
Added
- The frontend API types are generated from the backend's OpenAPI schema (
python -m chimera.api.schema_dump→npm run gen:api), and a CI job fails if they drift — a backend model change becomes a TypeScript build error, not a silent runtime mismatch.
Gate: 1482 passed / 4 skipped, mypy + ruff green; frontend build clean; OpenAPI types in sync.
Upgrade: `pip install --upgrade 'chimera-agent[desktop]'`