Summary
The per-account capacity family in dashboard settings (proxyAccountResponseCreateLimit, proxyAccountStreamLimit, proxyAccountStreamRecoveryReserve, and now proxyApiKeyFairShareCongestionThresholdPct from #1536) shares a tri-state limitation: once a dashboard override is stored, an operator cannot clear it back to null-inherits-environment. The update path treats an explicit null as "keep stored value" (model_fields_set → repository skips None), so the only recovery is setting an explicit value that happens to match the env var — which then stops tracking future env changes.
Raised by Codex review on #1536 (P2); the new field deliberately matched the existing fields' semantics rather than diverging, so the fix belongs to the whole family at once.
Proposed behavior
- Settings API: distinguish "field absent" (keep) from "field explicitly null" (clear override → inherit env) for the four capacity fields, using the
model_fields_set machinery that already detects explicit nulls.
- Repository: accept a clear sentinel (the
_UNSET pattern already exists in api_keys repository).
- Frontend: an "inherit environment" affordance (e.g. clear button / placeholder showing the env value).
- Settings-trace/audit rows record the clear.
Notes
- Rows created after first boot are seeded with concrete env values, so NULL currently only occurs for migrated rows — this is a small operational gap, not a correctness bug.
- Should cover the OpenSpec
frontend-architecture scenarios for all four fields in one change.
Summary
The per-account capacity family in dashboard settings (
proxyAccountResponseCreateLimit,proxyAccountStreamLimit,proxyAccountStreamRecoveryReserve, and nowproxyApiKeyFairShareCongestionThresholdPctfrom #1536) shares a tri-state limitation: once a dashboard override is stored, an operator cannot clear it back to null-inherits-environment. The update path treats an explicitnullas "keep stored value" (model_fields_set→ repository skipsNone), so the only recovery is setting an explicit value that happens to match the env var — which then stops tracking future env changes.Raised by Codex review on #1536 (P2); the new field deliberately matched the existing fields' semantics rather than diverging, so the fix belongs to the whole family at once.
Proposed behavior
model_fields_setmachinery that already detects explicit nulls._UNSETpattern already exists in api_keys repository).Notes
frontend-architecturescenarios for all four fields in one change.