mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
chore: warn when Code Mode lacks model metadata (#29490)
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
---
|
||||
source: tui/src/chatwidget/tests/status_and_layout.rs
|
||||
expression: "lines_to_single_string(&cells[0])"
|
||||
---
|
||||
⚠ Code Mode is enabled in configuration, but model `gpt-5.4` does not advertise
|
||||
Code Mode support. This may degrade model performance. Disable
|
||||
`features.code_mode` and `features.code_mode_only`, or select a model whose
|
||||
metadata enables Code Mode.
|
||||
@@ -2079,6 +2079,22 @@ async fn warning_event_adds_warning_history_cell() {
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn unsupported_code_mode_warning_renders_as_warning_history_cell() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
handle_warning(
|
||||
&mut chat,
|
||||
"Code Mode is enabled in configuration, but model `gpt-5.4` does not advertise Code Mode support. This may degrade model performance. Disable `features.code_mode` and `features.code_mode_only`, or select a model whose metadata enables Code Mode.",
|
||||
);
|
||||
|
||||
let cells = drain_insert_history(&mut rx);
|
||||
assert_eq!(cells.len(), 1, "expected one warning history cell");
|
||||
insta::assert_snapshot!(
|
||||
"unsupported_code_mode_warning",
|
||||
lines_to_single_string(&cells[0])
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn repeated_model_metadata_warning_is_hidden_for_same_slug() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
|
||||
Reference in New Issue
Block a user