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 was referenced Oct 10, 2026
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.
Simplification lane G1: the Claude, Codex and Copilot providers. The goal is to preserve behavior: no persisted format, serde name, CLI output, bridge DTO, user-facing string or error text changes.
Stacked on #795 (
simplify/provider-registry, head 733d69a). Land this after #795. The diff below is against that branch.scripts/local-check.ps1was not run. The workstation's no-permanent-delete hook blocks it, so I ran its Rust steps one at a time instead (see Commands).pnpm testwas skipped because the worktree has nonode_modules, and I did not install it.Summary
claude/web_api.rsis the one exception, at 853 lines. Two other files are still over 800,claude/oauth/mod.rs(845) andclaude/accounts.rs(817); they were not split because Use a standalone saved Claude account for usage when Claude Code credentials are off #788 has them open.Levers
build_resultpath incodex/api.rs(-226). Upstream items it implemented: v0.70.0 CHANGELOG lines 1178 (spend-controls endpoint, steipete#2900), 1261 (spend_control.individual_limit, steipete#2737), 1834 (enterprise monthly credit limits). The path had no callers, so behavior is unchanged; see follow-up 1.reset_observations: dropped the deaddefault_store_path; one sharedread_store(blank_is_empty)reader.authed_get, a cache-tail helper, subscription wrappers inlined, arms merged.read_state_file, one admission check (same check order), a diagnostics macro table.test_support.send_json),snapshots()iterator, one slot match.find_near_label,label_sectionandpercent_matchesreplace three hand-rolled section scans.strip_ansiis now test-only, in cli_screen tests).ranked_totals, cli_reset month table,limit_window.ensure_success,getandget_json.parse_envelope; a non-WindowsInfallibleguard gives termination one call shape; re-exports trimmed to externally used items.God-file splits (moves only)
claude_swap/parser.rs822parser.rs406 +parser_tests.rs416claude/web_api.rs1277web_api.rs853 +web_api_tests.rs424copilot/api.rs1274api.rs780 +api_tests.rs494codex/api.rs2307api.rs408 +api/credentials.rs287 +api/parse.rs463 +api/reset_credits.rs249 +api/tests.rs940claude/mod.rs2594mod.rs636 +cli_probe.rs568 +cli_binary.rs116 +cli_text.rs135 +tests.rs1164How the moves were made:
providers::claude::tests::…,providers::codex::api::tests::…and so on), so test names in the inventory are stable.pub(super)orpub(in crate::providers::codex)added to moved items that the parent or the siblingtests.rsuses;uselines, andmodlines;super::xpaths that becamesuper::super::x(authenticated_http_error,extract_semver);pub use cli_binary::locate_claude_binary;, which keeps the public path used bycli/tty_runner.rsand the desktopauto_resume.rs;codex/api.rs("Data structures", "Helper functions").codex/api/tests.rs(940 lines) andclaude/tests.rs(1164 lines) are kept as single files, so related tests stay together. Splitting them further is optional follow-up work.claude/web_api.rsis 853 lines. The rest is cohesive request code, and I left it as is.To review the splits:
LOC
Measured with
loc.py:simplify/provider-registry, whole reporust/src/providersonlyorigin/main(local ref), including #795use,modand visibility glue.Test inventory
The before and after inventories are in
W:\pstack-logs\Win-CodexBar\simplify\(inv-G1-before.txt,inv-G1-after.txt). The after file gives a reason for every removed or renamed test.providers::claudeproviders::codexproviders::copilotbuild_result; see follow-up 1.web_extras_keep_routines_in_raw_snapshot. Its input was identical toweb_extras_order_oauth_scoped_then_routines, whose full id-list assertion covers it.oauth_extras_keep_routines_in_raw_snapshotbecame a row ofoauth_extras_put_scoped_weekly_before_routines.Commands
All commands ran from the worktree on Windows (toolchain 1.98.0, x86_64-pc-windows-msvc):
cargo +1.98.0 fmt --all --checkcargo +1.98.0 clippy --workspace --all-targets -- -D warningscargo +1.98.0 test -p codexbarcargo +1.98.0 test -p codexbar-desktop-tauriThe
codexbartotal is 3754, down from 3763 at the base. All 9 fewer tests are table merges or dead-path tests in this lane; each one is listed with its reason ininv-G1-after.txt. For every split I also ranclippy -p codexbar --all-targets -D warningsand the affected provider tests.rust/srcinapps/desktop-tauri/src. The only source file a frontend test reads isrust/src/core/provider/spec.rs, which this PR does not touch.claude_swaprunner path is not compiled locally because there is no Linux target here. Hosted CI is Windows-only, so nothing compiles that path today, including the PBG-31Infallibleguard. A reviewer should run a Linuxcargo checkon it.Skipped
dead_codeallow): checked locally; 50 warnings remain, so it is not committed.rust/src/managed_process.rs, which is another lane's file.start_flowand PBG-39: these are in shellcommands/system.rs, which is another lane's file.apply_reset_credits_window;base_query: rustfmt made it 9 lines longer;from_raw/as_labeltable: it would lose match exhaustiveness;take_pipe: no gain after the cfg unification;Cross-lane requests
managed_process.rs: exposecreate_managed_job,encode_wide_nuland aProcessJobterminate, kill-on-close and handle API. Both the claude-swap runner andclaude/accounts/login/windows_child.rscould then drop their copies (PBG-30).commands/system.rs: inline the one-caller Copilotstart_flow(PBG-38, shell side).Follow-ups (bugs found, not fixed here)
build_result_from_json) never mapsindividual_limitto a cost snapshot. Only the deleted dead path did (reference implementation in c2adfce's parent; upstream Decode Codex monthly credit limit from spend_control.individual_limit steipete/CodexBar#2737, Codex EDU monthly usage limit is only returned by the separate spend-controls endpoint steipete/CodexBar#2900).reset_observations: a blank store file failsloadbut merges as empty. This PR pins that behavior as is (blank_store_fails_load_but_merges_as_empty).HashMaporder.Validation fix round
parse_account_list(doc only).TrayPanel.test.tsxresize test;apps/is byte-identical to base 733d69a, which passed. The new push triggers a fresh run.