mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Route cyber Trusted Access links by plan type (#40504)
## What changed - Send `Free`, `Go`, `Plus`, `Pro`, and `ProLite` ChatGPT users to the individual Trusted Access page when a cybersecurity policy error ends a turn. - Keep the enterprise Trusted Access application for other plans and sessions without a ChatGPT account or known plan. ## Testing - Cover individual and enterprise link selection in chat widget tests and history-cell snapshots. GitOrigin-RevId: a563560d15c401b47f1865a6f58ea4692d31d457
This commit is contained in:
1 parent
ebe18fc982
commit
80e871309a
5 files changed
+53
-5
No files matched your search
@@ -104,9 +104,27 @@ async fn app_server_cyber_policy_error_renders_dedicated_notice() {
|
||||
let rendered = lines_to_single_string(&cells[0]);
|
||||
assert!(rendered.contains("This content can't be shown"));
|
||||
assert!(rendered.contains("extra caution with cybersecurity requests"));
|
||||
assert!(rendered.contains("openai.com/form/enterprise-trusted-access-for-cyber"));
|
||||
assert!(!rendered.contains("server fallback message"));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn app_server_cyber_policy_error_uses_individual_link_for_personal_plan() {
|
||||
let (mut chat, mut rx, _ops) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.plan_type = Some(PlanType::Free);
|
||||
chat.has_chatgpt_account = true;
|
||||
|
||||
handle_error(
|
||||
&mut chat,
|
||||
"server fallback message",
|
||||
Some(CodexErrorInfo::CyberPolicy),
|
||||
);
|
||||
|
||||
let cells = drain_insert_history(&mut rx);
|
||||
assert_eq!(cells.len(), 1);
|
||||
assert!(lines_to_single_string(&cells[0]).contains("https://chatgpt.com/cyber/"));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn app_server_model_verification_renders_warning() {
|
||||
let (mut chat, mut rx, _ops) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
|
||||
Reference in new issue
Block a user