This repository was archived by the owner on Sep 22, 2026. It is now read-only.
Repository navigation
fix(frontend): derive the admin types from the OpenAPI spec - #1553
Merged
Merged
Conversation
|
Warning Review limit reachedNext included review available in 30 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: mozilla-ai/clawbolt/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5 of 6 tasks
njbrake
force-pushed
the
simplify/09-dedupe
branch
from
September 21, 2026 15:12
f381a27 to
bdc25ef
Compare
njbrake
force-pushed
the
simplify/10-frontend-generated-types
branch
from
September 21, 2026 15:12
1e430a6 to
864da2c
Compare
njbrake
force-pushed
the
simplify/09-dedupe
branch
from
September 21, 2026 18:47
bdc25ef to
9bf5244
Compare
njbrake
force-pushed
the
simplify/10-frontend-generated-types
branch
from
September 21, 2026 18:47
864da2c to
1cfcd65
Compare
7 of 8 tasks
njbrake
force-pushed
the
simplify/09-dedupe
branch
from
September 21, 2026 18:49
9bf5244 to
773ca35
Compare
njbrake
force-pushed
the
simplify/10-frontend-generated-types
branch
from
September 21, 2026 18:49
1cfcd65 to
2e3f2d3
Compare
njbrake
force-pushed
the
simplify/09-dedupe
branch
from
September 21, 2026 19:00
773ca35 to
e8d1071
Compare
njbrake
force-pushed
the
simplify/10-frontend-generated-types
branch
from
September 21, 2026 19:00
2e3f2d3 to
245bcea
Compare
njbrake
force-pushed
the
simplify/09-dedupe
branch
from
September 21, 2026 19:10
e8d1071 to
253cd36
Compare
njbrake
force-pushed
the
simplify/10-frontend-generated-types
branch
from
September 21, 2026 19:10
245bcea to
063ef19
Compare
admin-api.ts hand-declared 80 interfaces under a comment claiming they "match backend schemas exactly". Twenty-one had an exact counterpart in src/generated/api.d.ts and are now aliases to it, matching what src/types.ts already does. The generated types are stricter: tool_calls and args come out optional, because a Pydantic default_factory emits no `default` key and openapi-typescript marks a property required only when it is in `required` or carries a default. That is a spec artifact, not an API behavior. FastAPI serializes with exclude_unset=False, so those fields are always present on the wire; a route returning SharedDataTurn with only turn_index set still emits "tool_calls": []. The nullish guards added at the 14 call sites satisfy the type checker and change nothing at runtime. Aliasing also surfaced a real inconsistency: LLMEndpointItem typed cache_control, reasoning, and pricing as plain strings while LLMEndpointUpsert typed the same three as Literals, so a value read from a GET could not be handed back to a PUT. The three sets now live in enums.py and are used by the ORM column, both schemas, and the service writer. openapi.json and api.d.ts regenerated. 4268 passed; frontend typecheck, knip, and 425 vitest tests pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
njbrake
force-pushed
the
simplify/10-frontend-generated-types
branch
from
September 21, 2026 19:18
063ef19 to
c71a8aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fourth of six stacked PRs. Targets #1552.
admin-api.tshand-declared 80 interfaces under a comment claiming they "match backend schemas exactly". Twenty-one had an exact counterpart insrc/generated/api.d.tsand are now aliases to it, matching whatsrc/types.tsalready does.The generated types are stricter:
tool_callsandargscome out optional. That is a spec artifact, not an API behavior. A Pydanticdefault_factoryemits nodefaultkey, and openapi-typescript marks a property required only when it is inrequiredor carries a default. FastAPI serializes withexclude_unset=False, so those fields are always on the wire. The nullish guards added at the 14 call sites satisfy the type checker and change nothing at runtime.Aliasing did surface a real inconsistency:
LLMEndpointItemtypedcache_control,reasoning, andpricingas plain strings whileLLMEndpointUpserttyped the same three asLiterals, so a value read from a GET could not be handed back to a PUT. The three sets now live inenums.pyand are used by the ORM column, both schemas, and the service writer.openapi.jsonandapi.d.tsregenerated and committed.Type
Checklist
uv run pytest -v): 4268 passed, 6 skipped; frontend 425 passed, tsc and knip cleanruff check backend/ && ruff format --check backend/)AI Usage
🤖 Generated with Claude Code