This repository was archived by the owner on Sep 22, 2026. It is now read-only.
Repository navigation
fix: address the findings from reviewing this stack - #1555
Merged
Merged
Conversation
|
Warning Review limit reachedNext included review available in 7 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 selected for processing (35)
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 |
njbrake
force-pushed
the
simplify/11-test-consolidation
branch
from
September 21, 2026 18:49
21369f4 to
cb0774d
Compare
njbrake
force-pushed
the
simplify/12-review-fixes
branch
from
September 21, 2026 18:49
8795f15 to
7fcd8c2
Compare
njbrake
force-pushed
the
simplify/11-test-consolidation
branch
from
September 21, 2026 19:00
cb0774d to
9af0d19
Compare
njbrake
force-pushed
the
simplify/12-review-fixes
branch
from
September 21, 2026 19:00
7fcd8c2 to
fbb339e
Compare
njbrake
force-pushed
the
simplify/11-test-consolidation
branch
from
September 21, 2026 19:10
9af0d19 to
b9b0ded
Compare
njbrake
force-pushed
the
simplify/12-review-fixes
branch
from
September 21, 2026 19:10
fbb339e to
0ba5404
Compare
njbrake
force-pushed
the
simplify/11-test-consolidation
branch
from
September 21, 2026 19:19
b9b0ded to
6bbd533
Compare
njbrake
force-pushed
the
simplify/12-review-fixes
branch
from
September 21, 2026 19:19
0ba5404 to
31b6b76
Compare
njbrake
force-pushed
the
simplify/11-test-consolidation
branch
from
September 21, 2026 19:29
6bbd533 to
a7a7a6f
Compare
njbrake
force-pushed
the
simplify/12-review-fixes
branch
from
September 21, 2026 19:29
31b6b76 to
c353bfa
Compare
… guide Review of the first PR in this stack found the helper migration applied to roughly half the eligible sites, leaving both idioms live inside the same function bodies. user_profile.get_heartbeat_logs was the clearest case: a hand-rolled count matching count_rows' own docstring example, two lines above a fetch_all the earlier pass did convert. Converted the remaining 13 sites, 4 multi-line and 9 single-line. AGENTS.md still told contributors to hand-roll the shapes the helpers now cover, which is how the half-migration would have become permanent. Both SQLAlchemy bullets now name the helpers and say when to hand-roll instead. Also removed, all flagged by the same review: - a byte-identical copy of iso_or_none in admin_llm_eval - 14 redundant paren wrappers left by the mechanical pass - a list() around a value fetch_all already returns as a list - the sync get_or_404, which had no callers anywhere in the tree 4268 passed, 6 skipped, unchanged. The exported OpenAPI spec is unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review of the split PR found four kinds of residue. AGENTS.md pointed at four files the split deleted: backend/app/models.py, backend/app/schemas.py, routers/admin.py, and routers/admin_shared_data.py. Every agent session reads that file first, so a stale path there sends the next one hunting. Updated to the package paths, and noted that importing the models package is what registers the mappers. TODOS.md had one too. heartbeat_frequency.py carried dead copies of _HISTORY_LOOKBACK_DAYS and SCHEDULED_TASK_PREFIX. The live ones are in heartbeat.py; nothing imported either from the new module. The prefix's own comment says both sides import it so the strings cannot drift, and the extraction made a third copy of it. Moved DeleteMessagesResponse, BatchDeleteRequest, and DeleteMessageResponse out of schemas/heartbeat.py, where they had nothing to do with heartbeats, and in with the session schemas that user_sessions.py already imports. Dropped three dead things: the routerless APIRouter in shared-data consent.py, the sync resolve_heartbeat_route that no caller has used since before this stack, and the two route-side get_settings_store patches in the admin fixture. Those last patches deserve a note. The fixture comment claimed both were needed or a PUT to /channels/config would hit the real DbSettingsStore and fail an FK on users.id. Removing both leaves all 86 tests in that file green, and the same holds before the split, so the comment described a failure that does not happen. pytest-randomly is not installed, so there is no ordering in which it would. Deleted rather than documented. 4268 passed, 6 skipped, unchanged. OpenAPI spec unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
From the same review that caught the webchat message change, which is now
fixed in the commit that caused it:
- AGENTS.md still listed agent/file_store.py under "Key store modules"
after the shim was deleted, and stores.py's docstring still named it
- _user_dir in media_staging became dead when _disk_path_for went
- trimmed the change-narration out of tool_assembly's module docstring
assemble_turn_tools now primes the tool registry itself. Every caller was
responsible for that separately, and sampling.py documents what happens
when one forgets: the registry is empty, both models are offered no
tools, they agree perfectly, and the eval report reads as a clean pass.
The call is guarded and cached, so doing it in the one place that
assembles tools costs nothing and closes the trap.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…d row 500ing
Review of the generated-types PR found its premise overstated. tool_calls
and args are optional in the generated types only because a Pydantic
default_factory emits no `default` key, and openapi-typescript marks a
property required iff it is in `required` or carries a default. FastAPI
serializes with exclude_unset=False, so the API always sends them: a route
returning SharedDataTurn(turn_index=0) emits "tool_calls": []. The
hand-written required typing matched runtime and the guards are no-ops.
That PR is a type-hygiene change, not a bug fix, and its description now
says so.
The header comment in admin-api.ts still promised that every type matched
the backend exactly, over 59 that are hand-written because the backend
name differs. Two of those had genuinely drifted:
CompactUserContextResult was missing previous_event_id and EvalModelTotals
was missing pricing_unknown_reason. Both are now aliases, and aliasing the
second immediately failed the build because the eval fixtures were missing
that field too.
Also:
- guarded JSON.stringify(c.args), which sat unguarded three lines under
a guarded loop over the same collection
- hoisted (turn.tool_calls ?? []) into a local; it appeared four times
in two functions, three of them inside one template expression
- ProviderInfo was aliased in two modules; admin-api re-exports it now
- config.tsx's dropdown options are typed against the spec, so removing
a value backend-side fails the build instead of offering an option
every PUT would reject. Confirmed by adding a bogus value: TS2322.
endpoint_item no longer reports a mode column verbatim. The columns are
plain String(16), so a hand-written UPDATE can put an out-of-set value in
one, and narrowing the read model turned that into a 500 for the whole
endpoint list rather than one bad row. It now falls back to auto with a
warning, which is how the agent path already handles the same case in
_reasoning_style_for.
4268 passed, 6 skipped. Frontend typecheck, knip, and 425 vitest tests
pass. Regenerating the spec and types produces no diff.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
njbrake
force-pushed
the
simplify/12-review-fixes
branch
from
September 21, 2026 19:42
c353bfa to
4c39b8b
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
Sixth of six stacked PRs. Targets #1554.
Every change here came out of reviewing the five PRs beneath it. Grouped by what found it:
#1550 review. The query-helper migration was applied to about half the eligible sites, leaving both idioms live inside the same function bodies;
user_profile.get_heartbeat_logshad a hand-rolled count matchingcount_rows' own docstring example two lines above afetch_all. Converted the remaining 13.AGENTS.mdstill told contributors to hand-roll those shapes, which is how the half-migration would have become permanent. Also dropped a byte-identical copy ofiso_or_none, 14 redundant paren wrappers, alist()around an already-list, and the syncget_or_404, which had no callers.#1551 review.
AGENTS.mdnamed four files the module split deleted. Every agent session reads that file first.heartbeat_frequency.pycarried dead copies of two constants, one of whose comments says both sides import it so the strings cannot drift. Three delete-message schemas sat inschemas/heartbeat.pywith nothing to do with heartbeats. Dropped a routerlessAPIRouter, a syncresolve_heartbeat_routewith no callers, and twoget_settings_storepatches whose comment described an FK failure that does not happen: removing both leaves all 86 tests in that file green, before the split too.#1552 review. Routing webchat's upload check through
check_media_sizechanged the 422 detail from "File too large" to "Media file too large". The pytest assertion lowercases before comparing so it stayed green;e2e/oss/file-upload.spec.tsis case-sensitive and would have turnede2e-playwrightred on merge. Keeping the unified wording and updating the assertion.assemble_turn_toolsnow primes the tool registry itself:sampling.pydocuments what happens when a caller forgets, which is that both models are offered no tools, agree perfectly, and the report reads as a clean pass.#1553 review. The
admin-api.tsheader comment promised spec parity over 59 hand-written types, two of which had drifted:CompactUserContextResultwas missingprevious_event_idandEvalModelTotalswas missingpricing_unknown_reason. Both are aliases now, and aliasing the second immediately failed the build because the eval fixtures were missing that field too.config.tsx's dropdown options are typed against the spec, so removing a value backend-side fails the build instead of offering an option every PUT would reject.endpoint_itemno longer reports a mode column verbatim: those columns are plainString(16), so a hand-written UPDATE could 500 the whole endpoint list over one bad row, and it now falls back toautowith a warning the way the agent path already does.Type
Checklist
uv run pytest -v): 4268 passed, 6 skipped; frontend 425 passed, tsc and knip cleanruff check backend/ && ruff format --check backend/)endpoint_itemfallback and the drift guard were each verified by mutationAI Usage
🤖 Generated with Claude Code