Skip to content

feat: allow a dedicated model for auto-review classifier requests - #72

Merged
raine merged 2 commits into
raine:mainfrom
mulfyx:feat/configurable-auto-review-model
Jul 28, 2026
Merged

feat: allow a dedicated model for auto-review classifier requests#72
raine merged 2 commits into
raine:mainfrom
mulfyx:feat/configurable-auto-review-model

Conversation

@mulfyx

@mulfyx mulfyx commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • detect Claude Code's non-streaming, tool-free autonomous Bash security-review classifier requests
  • route only those requests through CCP_AUTO_REVIEW_MODEL or the top-level autoReviewModel config key
  • resolve a direct override model through the normal provider registry while bypassing session affinity for the one-off request
  • preserve the session's existing provider affinity after the classifier finishes
  • document the setting and cover config precedence, request detection, provider selection, affinity preservation, and end-to-end HTTP routing

Motivation

Claude Code sends autonomous Bash permission reviews as separate model requests. When the active session uses a large model or high reasoning effort, those small classifier calls use the same expensive route even though a smaller model is sufficient.

This complements the compact-effort specialization added in #67, but applies to a different request class: the Bash auto-review classifier rather than conversation compaction.

Configuration

Environment:

CCP_AUTO_REVIEW_MODEL=gpt-5.6-luna

config.json:

{
  "autoReviewModel": "gpt-5.6-luna"
}

Use a direct model ID for deterministic provider selection. When the option is unset, request routing is unchanged.

The override is deliberately narrow: it does not apply to normal messages, streaming requests, tool-using requests, or /v1/messages/count_tokens.

Verification

  • cargo fmt --all -- --check
  • cargo test --locked — 623 tests passed
  • end-to-end HTTP smoke: a classifier request for gpt-5.6-sol reached the mock Codex upstream as gpt-5.6-terra, while the following normal request still reached it as gpt-5.6-sol
  • provider-routing coverage for Codex, Grok, Kimi, and Cursor model IDs
  • session-affinity regression coverage

Resolve the conflicts caused by the documentation site, native Responses API,
and server compaction changes on main while retaining dedicated routing for
Claude Code's Bash security-review classifier.

Use gpt-5.6-luna automatically when the classifier's original provider is
Codex. Preserve the requested model for other providers, and let an explicit
autoReviewModel select any registered provider without changing session
affinity. Bypass the global Codex model override for these one-off requests so
the selected classifier model reaches the upstream.

Document the provider-aware default and cover default routing, explicit
overrides, request exclusions, configuration precedence, and affinity
preservation.
@raine
raine merged commit d5a38f0 into raine:main Jul 28, 2026
1 check passed
@raine

raine commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants