chore: merge agent crate into config#2554
Conversation
Moves ModelInfo, ModelRegistry, and ModelResolution from crates/agent into codewhale_config as a model_registry module. All three consumers (core, cli, app-server) already depended on codewhale-config, so no new dependency edges are introduced. - Move agent/src/lib.rs into config/src/model_registry.rs - Re-export types from config/lib.rs - Update use statements in core, cli, app-server - Remove codewhale-agent dependency from consumer Cargo.toml files - Remove crates/agent/ directory and workspace member entry Closes Hmbown#2251
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
| pub mod model_registry; | ||
| pub use model_registry::{ModelInfo, ModelRegistry, ModelResolution}; |
There was a problem hiding this comment.
Module declaration at end of file —
pub mod model_registry and its pub use re-exports are placed at line 2260, after all impl blocks and just before the #[cfg(test)] section. In idiomatic Rust, mod declarations conventionally live near the top of the crate root (after attributes and top-level use imports), so future readers scanning the file can immediately see what modules the crate provides. Consider moving these two lines to the top of lib.rs.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Thanks @RefuseOdd. I reviewed this while triaging #2504 for v0.8.50, and the consolidation direction looks reasonable. I’m leaving it out of the v0.8.50 harvest branch for now only because deleting/moving a published workspace crate needs the release surfaces to move with it. The follow-up checklist I’d want before this lands:
Keeping it out of #2504 avoids mixing a crate-publishing boundary change into this release branch before those docs/scripts are aligned, but this is useful cleanup work and worth continuing. |
Updated description of the config crate to include model/provider registry.
Removed duplicate entry for 'crates/config' in architecture documentation.
Thanks, that makes sense. I pushed
|
Summary
Merges
crates/agent(539 lines) intocrates/configas a newmodel_registrymodule. The agent crate only providesModelRegistry,ModelInfo, andModelResolution— all conceptually configuration concerns. All three consumers (core, cli, app-server) already depend on config.Changes
ModelRegistry,ModelInfo,ModelResolutionintocrates/config/src/model_registry.rscodewhale_configcore,cli,app-serverto import fromcodewhale_configinstead ofcodewhale_agentcrates/agent/directory and drop from[workspace.members]Verification
cargo check --workspacepasses.Closes #2251
Greptile Summary
This PR merges
crates/agentintocrates/configby movingModelRegistry,ModelInfo, andModelResolutioninto a newcrates/config/src/model_registry.rsmodule and re-exporting the public types fromcodewhale_config. All three consumer crates (core,cli,app-server) are updated to import fromcodewhale_configinstead ofcodewhale_agent, and the agent crate is removed from the workspace.codewhale_config::ProviderKindimport becomescrate::ProviderKind; all logic, tests, and doc comments are preserved.scripts/release/crates.sh), the provider-drift checker (scripts/check-provider-registry.py), release runbook, and architecture docs are all consistently updated to reflect the new module location.Confidence Score: 5/5
Safe to merge — this is a pure mechanical relocation with no behavioral changes.
The move is a near-verbatim file rename: the only code change is one import path. All consumer call sites are updated consistently, the serde dependency already exists in crates/config, all tests travel with the module unchanged, and every piece of supporting tooling is updated to point at the new path.
No files require special attention.
Important Files Changed
crate::. All logic, tests, and doc comments are intact.pub mod model_registrydeclaration and re-exports of the three public types at the end of the file (before the test section).agent_rs/AGENT_RStomodel_registry_rs/MODEL_REGISTRY_RSand path updated to the new location; logic is unchanged and still correct.codewhale-agentfrom the publish list; remaining crates and their order are unchanged.crates/agentfrom[workspace.members]; workspace metadata is otherwise unchanged.codewhale_agenttocodewhale_config; no other changes.codewhale_agenttocodewhale_config; no other changes.codewhale_agenttocodewhale_config; no other changes.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[crates/agent/src/lib.rs\nModelRegistry, ModelInfo, ModelResolution] -->|moved to| B[crates/config/src/model_registry.rs] B -->|pub mod + pub use re-export| C[codewhale_config crate public API] C --> D[crates/core] C --> E[crates/cli] C --> F[crates/app-server] G[crates/agent removed from workspace] -.->|was dependency of| D G -.->|was dependency of| E G -.->|was dependency of| FReviews (3): Last reviewed commit: "Fix duplicate entry in ARCHITECTURE.md" | Re-trigger Greptile