Skip to content

refactor(model): gate axum behind a feature - #10042

Closed
404Wolf wants to merge 1 commit into
mainfrom
wolf/reorg-model-axum-feature
Closed

404Wolf wants to merge 1 commit into
mainfrom
wolf/reorg-model-axum-feature

Conversation

@404Wolf

@404Wolf 404Wolf commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Why

Part of the repository reorganization (plan item N2). model is the shared
DTO crate that about 150 workspace crates reach, and it compiled axum for
two items: GenericResponse::send and the validate_api_version middleware.
Only four crates use them.

MACRO-4972

How it works

  • model gets an axum feature (off by default) that gates
    GenericResponse::send, validate_api_version and its private helpers.
  • document_storage_service, agent_harness_service, notification_service
    and macro_middleware, the only callers, enable model/axum.
  • models_pagination already gated axum behind a feature, so it is
    unchanged.

No crate's dependency closure loses axum yet: I counted with cargo tree
over the 147 crates that reach model, before and after. Two other paths
still pull axum in. workspace-hack adds it through axum-extra, and
model → agent → ai_toolset adds it directly. Once those edges are cut
(N1 chat_message, D7 workspace-hack trim), crates that need only
model's DTOs stop compiling axum. Until then this change only makes
model's own manifest honest.

model compiled axum for GenericResponse::send and the
validate_api_version middleware, so all ~150 crates that reach model
compiled axum through it. Only document_storage_service,
agent_harness_service, notification_service and macro_middleware use
those two items; they now enable the new axum feature.

MACRO-4972
@macro-application

Copy link
Copy Markdown

@404Wolf 404Wolf added the run-ci Run CI on the PR's head commit; removed when the run starts label Nov 6, 2026
@github-actions github-actions Bot added cloud-storage and removed run-ci Run CI on the PR's head commit; removed when the run starts labels Nov 6, 2026
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Some coding-guideline sources were skipped or only partly applied; the reason is listed next to each one. On a public repository, this repository's guideline files are counted without their names.

Skipped guideline sources

225 AGENTS.md files in this repository — not scanned for links to other guideline files; the limit of 50 AGENTS.md files per review was reached
167 guideline files in this repository — not read for this review; the limit of 100 guideline files per review was reached

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Chores
    • Updated framework support across the affected services and middleware. Components that use shared data types without framework integration can now avoid loading that support.
    • No user-facing behavior changes are noted.

The model crate now declares Axum as an optional dependency and gates its Axum-specific response and version code behind an opt-in feature. The macro_middleware, agent_harness_service, document_storage_service, and notification_service crates enable that feature for their model dependency.

Merge Risk: Minimal · up to 185c1

The feature gate is consistent with the inspected callers. Normal build and test checks remain appropriate.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title describes the change, uses conventional commit format, and is under 72 characters.
Description check Passed The description matches the feature gating and dependency changes.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8089be9 and 185c1a5.

Files selected for processing: 7

  • crates/macro_middleware/Cargo.toml
  • crates/model/Cargo.toml
  • crates/model/src/response.rs
  • crates/model/src/version.rs
  • services/agent_harness_service/Cargo.toml
  • services/document_storage_service/Cargo.toml
  • services/notification_service/Cargo.toml

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@404Wolf

404Wolf commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Folded into the single reorg PR #10111 (one PR for the whole reorganization). Its commits are there; closing this one.

@404Wolf 404Wolf closed this Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant