Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Lands after #795 (simplify/provider-registry). This PR is stacked on that branch; retarget to
mainonce #795 merges.Lane G2 of the behavior-preserving simplification program: antigravity, kimi, minimax, opencode, opencodego and openrouter providers. No persisted formats, serde names, CLI output, bridge DTOs, tab ids or user-facing strings change. No new dependencies.
Behavior summary
No intended behavior change. Each refactor commit was preceded by characterization pins where existing tests did not cover the code being merged. Bugs found along the way are listed under follow-ups and were not fixed here.
Dead code deleted
rust/src/providers/opencode/scraper.rs(PBG-01): no consumers. Its 6 tests go with it.minimax::result_from_billing_summary(in PBG-37): prod-unused function.openrouter::add_key_quota(in PBG-66): prod-unused helper.kimi::KimiDesktopAuthToken::load()(in PBG-36, 47115d7): apub fnthat returnedload_for_region(KimiRegion::China)and was documented as the "Production entry point". A basegit grep -F 'DesktopAuthToken::load()'finds no callers; production (kimi/web.rs) usesload_for_regionand the tests useload_from.The module file was moved to the Recycle Bin from the W: worktree with
~/.claude/bin/trash, thengit add -u.rust/src/providers/minimax/local_storage.rswas deleted in e974e9b (PBG-03) and restored in dce376a; see "Validation fix round".Levers
local/tests.rs(moves only; local.rs 1379 to 612)local/test_db.rs)minimax/tests.rs(moves only)minimax/billing.rs(moves pluspub(super); mod.rs 1266 to 729)Disclosure: pushed commits 101d979 and 47115d7 failed
clippy -D warningsuntil d7d72f2. The-9.223..e18literal becamei64::MIN as f64(same value).Skipped levers
jwt_expon the sharedjwt_payload: padding and URL_SAFE semantics differ.unit_secondsmerge: the float operation order would change.Budget::exhaust: no line savings.managed_step: cannot be pinned (it spawns agy), and the test-onlyresolve_managed_outcomeErr branch diverges from production.probe_api_portstays offlocal_post: it sets no per-request timeout and sends.body("{}").expect_summaryhelper keeps the named scenarios instead of one table.UserTier.idand quota_summary dead_code allows stay, because those fields really are unread.Test changes
offline_detail_forhelper checkssource_label == "offline"at every call site.CREATE TABLE message (...)three times and themessage+partpair twice (now inlocal/test_db.rs). Nothing reads thesqlcolumn: prod opencodego checks the schema only throughSELECT 1 FROM sqlite_master WHERE type='table' AND name=?1, and nothing hashes or compares DDL text.Validation fix round
From the #803 validation (findings F1, F2, F3, F5, F6; the F4 nits are left as is):
git revert e974e9bd7.minimax/local_storage.rsis landed port work: GAP-33 / 0.66.0 row 23 landed through Port upstream 0.66.0: MiniMax browser storage discovery (stacked on #646) #651 (7515992, f37043a), upstream v0.70.0 still shipsMiniMaxLocalStorageImporter, andbrowser/storage_discovery.rshad no consumer without it. The revert applied cleanly: the file is byte-identical to base 733d69a (same blob and mode), themod.rsre-export is back with itsreason = "imports needed for future MiniMax provider wiring"allow, and its 5 tests run again.minimax::http_tests::coding_plan_page_request_sends_html_accept_without_the_xhr_markercoversconsole_getwithxhr=false. It matches the HTML Accept literal andMatcher::Missingonx-requested-with, plus the shared cookie and browser headers. The HTML Accept string moved intoconst HTML_ACCEPTinminimax/mod.rs(same bytes). The pin coversconsole_get'sxhr=falsebranch, and the shared const covers the Accept valuefetch_coding_plan_with_cookiesends. That caller'sfalseflag is not wire-pinned, becauseregion.coding_plan_url()cannot be pointed at a mock server. Flipping the pin's own argument toxhr=truefails it.cookie_remains_request_parses_a_json_bodynow assertsErr(ProviderError::Other("no plan"));parse_remainsreturnsstatus_msgfor a non-authbase_resp. It used to check onlyis_err().KimiDesktopAuthToken::load()with the other removed items and describes the five whitespace-changed SQL literals.LOC (
loc.py, raw lines)origin/main (603681a) is 15 commits past the merge-base and is not an ancestor of this branch, so a delta against it would mix in main's own changes; the merge-base row is the comparable one.
loc.pycounts two test-only pieces as prod:opencodego/local/test_db.rs(83 lines) and the#[cfg(test)] pub(super) mod test_fixturesblock inantigravity/local_proto.rs(32 lines). With those counted as test, the change against #795 is about -980 prod and +1109 test. Test lines grow because of the characterization pins (MiniMaxhttp_tests.rs, coding_plan, coding_plan_html, Kimi web); the module moves are close to line-neutral.Test inventory
cargo test -p codexbar -- --list(lib plus bin) goes from 3763 to 3758 tests: 46 removed and 41 added. In the six lane directories it goes from 422 to 417. Outside them nothing changed. The module splits keep their test paths (providers::minimax::tests,providers::opencodego::local::tests).Removed (46), each with its reason:
opencode::scraper::tests::{test_looks_signed_out, test_normalize_workspace_id_direct, test_normalize_workspace_id_invalid, test_normalize_workspace_id_url, test_parse_subscription_json, test_parse_workspace_ids}(PBG-01). The 5minimax::local_storage::testsare back after dce376a.openrouter::tests::{server_remaining_replaces_lifetime_usage_for_meter, negative_server_remaining_reads_exhausted, above_limit_server_remaining_reads_zero, reset_window_usage_is_the_preferred_fallback, cumulative_usage_is_the_last_fallback, no_usable_quota_source_hides_the_meter}intokey_meter_prefers_server_remaining_then_reset_window_then_cumulative_usage(PBG-66).opencode::tests::{parses_weekly_only_json_without_rolling, parses_rolling_only_json_without_weekly, parses_nested_data_subscription_shape, parses_five_hour_and_week_aliases, sub_one_percent_computed_used_limit_is_not_rescaled_to_100, direct_fractional_usage_percent_still_scales}intoparse_usage_json_window_shapes(PBG-66).kimi::tests::oversized_integral_usage_amount_is_not_saturated_to_i64_maxinto the 2^63 row ofkimi::ratio_pool::tests::integer_counter_accepts_exact_integers_only(PBG-64).minimax::coding_plan::tests::{base_resp_1004_is_auth_required, base_resp_status_msg_login_is_auth_required, base_resp_other_status_is_other_error}intobase_resp_status_maps_to_errors(PBG-64).antigravity::tests::{parses_current_language_server_process, parses_language_server_without_extension_server_port, parses_language_server_without_any_port_arg, parses_equals_form_args, detects_agy_exe_cli_process_with_empty_csrf, detects_quoted_agy_exe_cli_process, detects_bare_agy_command, detects_antigravity_cli_command, ide_match_preferred_over_agy_cli_when_both_running, agy_cli_matches_when_only_cli_running, non_antigravity_process_without_csrf_is_not_matched}intoparse_process_info_matches_ide_servers_and_the_agy_cli(PBG-59).antigravity::tests::{is_agy_cli_command_matches_known_names, is_agy_cli_command_rejects_unrelated_names}intois_agy_cli_command_matches_only_cli_names(PBG-59).antigravity::tests::{test_parse_user_status_standard, antigravity_extra_windows_preserve_all_unselected_configs, test_parse_user_status_thinking_skipped, test_parse_user_status_fallback_first, test_noisy_models_do_not_drive_summary_windows, multiple_unselected_models_with_same_reading_remain_visible, models_in_distinct_quota_buckets_keep_separate_lanes}intoparse_user_status_selects_summary_windows_and_keeps_the_rest(PBG-59).antigravity::tests::{user_tier_resolves_google_ai_ultra_plan_name, user_status_falls_back_to_plan_status_when_user_tier_is_absent}intouser_tier_name_wins_over_the_plan_status_name, andantigravity::tests::{plan_name_fallback_skips_blank_user_tier_name, plan_name_fallback_skips_blank_display_name}intoplan_name_fallback_skips_blank_names(PBG-59).Added (41): the 9 merged tables above, plus 32 characterization pins (31 written before the refactors they cover, and
minimax::http_tests::coding_plan_page_request_sends_html_accept_without_the_xhr_markerfrom the fix round). These are in minimaxhttp_tests,coding_plan,coding_plan_html,remains_api,token_planandtests; kimiwebandtests; opencode and opencodegoconsoleandlocal::tests; openrouteractivityandtests; and antigravitylocal_sqlite,quota_summaryandtests.Files:
inv-G2-before.txtandinv-G2-after.txtin the simplification log directory.Commands run
All cargo commands ran one at a time from the worktree with toolchain 1.98.0 and a private target directory.
cargo fmt --all --check: passcargo clippy --workspace --all-targets -- -D warnings: passcargo test -p codexbar: 3756 passed, 1 ignored (lib); 1 passed (bin); 0 (integration) at b0fe165cargo test -p codexbar-desktop-tauri: 639 passed at b0fe165cargo clippy -p codexbar --all-targets -- -D warningsand the focusedcargo test -p codexbar --lib -- providers::<name>python loc.py <ref> --areas 60at HEAD, 733d69a and origin/mainscripts/local-check.ps1was not run: the local no-permanent-delete hook blocks it on this machine. I ran the Rust commands above instead; they match the fmt, workspace clippy and test steps of-Slice ci. Its pnpm steps (install, lint, anti-slop, frontend tests, build) were not run. No frontend files changed, andgrep rust/src apps/desktop-tauri/srcshows no frontend test reading a file this PR touches.Follow-ups (not fixed here)
format_count(-123)renders-,123.next_time_todayrolls to now + 24h.parse_resets_at_from_time_rangetreatshas an hour window.usage_countis used as the remaining count.minimax/coding_plan.rsis 1176 lines; several Antigravity files are over the size bar. Not split here (out of scope).resolve_managed_outcomeis test-only and diverges from production.