Skip to content

Add config-gated Pro Plan routing profile#3193

Open
dumbjack wants to merge 9 commits into
Hmbown:mainfrom
dumbjack:codex/pro-plan-profile-gated
Open

Add config-gated Pro Plan routing profile#3193
dumbjack wants to merge 9 commits into
Hmbown:mainfrom
dumbjack:codex/pro-plan-profile-gated

Conversation

@dumbjack

Copy link
Copy Markdown

Summary

Fresh follow-up to the closed Pro Plan exploration in #1865. This reworks the feature as an explicit, config-gated routing profile with no default mode/menu change.

  • adds pro_plan_profile = false as the default settings gate
  • rejects /mode pro-plan until the profile is enabled with /config pro_plan_profile true --save
  • keeps the default Tab cycle and /mode picker limited to Agent / Plan / YOLO
  • routes Pro Plan phases as Plan -> Execute -> Review -> Done using explicit <pro_plan ...> markers
  • keeps Plan/Review on the resolved Pro route and read-only policy; Execute uses Flash only when the active provider advertises it, otherwise falls back to Pro
  • preserves fail-closed raw AppMode::ProPlan behavior in engine registry, sandbox, runtime prompt, and approval policy
  • keeps PlanPrompt on current main's scroll/confirmation UI while routing user-facing strings through localization

Validation

  • cargo fmt --all -- --check
  • cargo check -p codewhale-tui
  • cargo test -p codewhale-tui pro_plan --quiet
  • cargo test -p codewhale-tui plan_prompt --quiet
  • cargo test -p codewhale-tui localization --quiet
  • cargo test -p codewhale-tui config_view_exposes_all_available_saved_settings --quiet
  • cargo test -p codewhale-tui --quiet

Full codewhale-tui pass: 4502 passed, 0 failed, 4 ignored for the main bin target, plus integration/feature targets passed.

Notes

This intentionally does not add Pro Plan to default_mode, the mode picker, or the visible cycle. The profile remains available only after an explicit saved setting so the main model/menu surface stays neutral.

@dumbjack dumbjack requested a review from Hmbown as a code owner June 13, 2026 05:30

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@github-actions

Copy link
Copy Markdown

Thanks @dumbjack for taking the time to contribute.

This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered.

Please read CONTRIBUTING.md for the expected contribution shape. A maintainer can grant recurring PR access by commenting /lgtm on a pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the "Pro Plan" profile (AppMode::ProPlan), a config-gated routing profile that allows users to plan with a Pro model, execute with a Flash model, and review with a Pro model. It includes state flow transitions (ProPlanRouter), localization updates, UI integrations, and fail-closed safety rules. The review feedback highlights a case-sensitivity issue when matching English terms mixed into Chinese phrases and suggests removing a redundant .into_iter() call on an iterator.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread crates/tui/src/tui/ui.rs
"开 pr",
]
.iter()
.any(|needle| trimmed.contains(needle));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using trimmed.contains(needle) here makes the check case-sensitive for English terms mixed into Chinese phrases (such as "PR" vs "pr"). Since lower is already computed, using lower.contains(needle) instead will ensure case-insensitive matching for terms like "提PR".

Suggested change
.any(|needle| trimmed.contains(needle));
.any(|needle| lower.contains(needle));

Comment thread crates/tui/src/tui/ui.rs
let words = lower
.split(|ch: char| !ch.is_ascii_alphanumeric())
.filter(|word| !word.is_empty());
let asks_for_action_word = words.into_iter().any(|word| {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Calling .into_iter() on an iterator is redundant. You can call .any() directly on words.

Suggested change
let asks_for_action_word = words.into_iter().any(|word| {
let asks_for_action_word = words.any(|word| {

@Hmbown

Hmbown commented Jun 15, 2026

Copy link
Copy Markdown
Owner

oh interesting are you thinking of this kind of like the claude code ultraplan? i'm hoping to harden / strenghten planning overall so this is helpful for me to get an implementation.

if you're able to clarify your intent with this a bit more it would help me out a ton!

@Hmbown

Hmbown commented Jun 15, 2026

Copy link
Copy Markdown
Owner

ah I see now - so planning with stronger model and implementing with weaker. i've seen the reverse as well especially in codex. I think separating the planning model and the executing model is probably the happy medium and figuring out how to configure that. i'll work on getting this in! thank you so much for this greaet idea

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