Skip to content

[codex] Address context window review feedback#3574

Merged
Hmbown merged 1 commit into
Hmbown:mainfrom
nightt5879:nightt5879/followup-3573-context-window-review
Jun 25, 2026
Merged

[codex] Address context window review feedback#3574
Hmbown merged 1 commit into
Hmbown:mainfrom
nightt5879:nightt5879/followup-3573-context-window-review

Conversation

@nightt5879

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #3573 after Codex cloud review found two edge cases:

  • keep route-derived max_tokens positive when a configured context window is tiny enough for ContextBudget to clamp output to zero
  • restore active_context_window_override when provider-switch auth rollback restores the previous provider and route limits

The original provider context_window feature for #3545 was already merged in #3573; this PR carries only the cloud-review fixes that landed locally after that PR was merged.

Validation

  • cargo fmt --all -- --check
  • cargo test -p codewhale-tui --bin codewhale-tui --locked effective_max_output_tokens_for_route
  • cargo test -p codewhale-tui --bin codewhale-tui --locked provider_switch_auth_error_restores_previous_provider_and_model
  • cargo test --workspace --locked
  • git diff --check

Review feedback addressed

Keep route-derived max_tokens positive for tiny configured context windows, and restore the previous provider context-window override when an auth failure rolls back a provider switch.

Addresses Codex review threads on crates/tui/src/core/engine/context.rs and crates/tui/src/tui/ui.rs.

Validated with: cargo fmt; cargo fmt --all -- --check; cargo test -p codewhale-tui --bin codewhale-tui --locked effective_max_output_tokens_for_route; cargo test -p codewhale-tui --bin codewhale-tui --locked provider_switch_auth_error_restores_previous_provider_and_model; cargo test -p codewhale-tui --bin codewhale-tui --locked; cargo test --workspace --locked; git diff --check.
@nightt5879 nightt5879 requested a review from Hmbown as a code owner June 25, 2026 04:44
@nightt5879

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: eb0c3b8dcb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Hmbown Hmbown merged commit f3cdc70 into Hmbown:main Jun 25, 2026
12 checks passed
@Hmbown

Hmbown commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Thank you!!

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