Skip to content

Feat: add model reroute notification#12001

Merged
shijie-oai merged 2 commits intomainfrom
shijie/model-reroute-notification
Feb 17, 2026
Merged

Feat: add model reroute notification#12001
shijie-oai merged 2 commits intomainfrom
shijie/model-reroute-notification

Conversation

@shijie-oai
Copy link
Collaborator

@shijie-oai shijie-oai commented Feb 17, 2026

Summary

Builiding off https://github.com/openai/codex/pull/11964/files/5c75aa7b89a70bc2cc410a6fd238749306ec4c5e#diff-058ae8f109a8b84b4b79bbfa45f522c2233b9d9e139696044ae374d50b6196e0, we have created a model/rerouted notification that captures the event so that consumers can render as expected. Keep the EventMsg::Warning path in core so that this does not affect TUI rendering.

model/rerouted is meant to be generic to account for future usage including capacity planning etc.

@shijie-oai shijie-oai force-pushed the shijie/model-reroute-notification branch from 2af5e8e to 1c2e829 Compare February 17, 2026 16:15
.send_server_notification(ServerNotification::ItemStarted(started))
.await;
let completed = ItemCompletedNotification {
EventMsg::Warning(_warning_event) => {}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let me know if I should keep this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I should.

@shijie-oai shijie-oai marked this pull request as ready for review February 17, 2026 16:20
@shijie-oai shijie-oai marked this pull request as draft February 17, 2026 16:20
Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c2e829b80

ℹ️ 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".

EventMsg::ModelReroute(ModelRerouteEvent {
from_model: requested_model.clone(),
to_model: server_model.clone(),
reason: ModelRerouteReason::HighRiskCyberActivity,
Copy link
Contributor

Choose a reason for hiding this comment

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

P1 Badge Derive reroute reason from server evidence

maybe_warn_on_server_model_mismatch emits ModelRerouteReason::HighRiskCyberActivity for any model mismatch. The only guard is server_model != requested_model, so benign reroutes (e.g., alias/canonicalization/provider fallback) will be reported as a high-risk safety flag. This new structured signal can mislead clients and trigger incorrect UX/policy handling.

Useful? React with 👍 / 👎.

Copy link
Collaborator

Choose a reason for hiding this comment

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

seems legit?

Comment on lines +3318 to +3324
pub struct ModelReroutedNotification {
pub thread_id: String,
pub turn_id: String,
pub from_model: String,
pub to_model: String,
pub reason: ModelRerouteReason,
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We will construct the message, tooltip etc on the app side. This also allows up to be more dynamic in the future.

@shijie-oai shijie-oai marked this pull request as ready for review February 17, 2026 17:47
@shijie-oai shijie-oai merged commit 48018e9 into main Feb 17, 2026
37 of 39 checks passed
@shijie-oai shijie-oai deleted the shijie/model-reroute-notification branch February 17, 2026 19:02
@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants