Point usage and credit links to ChatGPT settings (#49874)

## What changed

Replace `https://chatgpt.com/codex/settings/usage` with
`https://chatgpt.com/settings/usage` in usage-limit errors, the `/status`
card, and backend banner actions. Credit purchase actions retain
`?credits_modal=true`.

## Testing

Update error-message assertions, banner action tests, status hyperlink
assertions, and TUI snapshots to expect the new URL.

GitOrigin-RevId: 1e1db971284a25a781120da30a6dea5ff9c3d957
This commit is contained in:
Eric Traut
2026-10-01 05:16:40 +00:00
committed by copyberry
parent 90d7f2715a
commit bdfbab9f4f
33 changed files with 40 additions and 46 deletions
+2 -2
View File
@@ -752,7 +752,7 @@ impl std::fmt::Display for UsageLimitReachedError {
let message = match self.plan_type.as_ref() {
Some(PlanType::Known(KnownPlan::Plus)) => format!(
"You’ve hit your usage limit. Upgrade to Pro (https://chatgpt.com/explore/pro), visit https://chatgpt.com/codex/settings/usage to purchase more credits{}",
"You’ve hit your usage limit. Upgrade to Pro (https://chatgpt.com/explore/pro), visit https://chatgpt.com/settings/usage to purchase more credits{}",
retry_suffix_after_or(self.resets_at.as_ref())
),
Some(PlanType::Known(
@@ -777,7 +777,7 @@ impl std::fmt::Display for UsageLimitReachedError {
}
Some(PlanType::Known(KnownPlan::Pro | KnownPlan::ProLite | KnownPlan::ProMax)) => {
format!(
"You’ve hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits{}",
"You’ve hit your usage limit. Visit https://chatgpt.com/settings/usage to purchase more credits{}",
retry_suffix_after_or(self.resets_at.as_ref())
)
}
+5 -6
View File
@@ -166,7 +166,7 @@ fn usage_limit_reached_error_formats_plus_plan() {
};
assert_eq!(
err.to_string(),
"You’ve hit your usage limit. Upgrade to Pro (https://chatgpt.com/explore/pro), visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again later."
"You’ve hit your usage limit. Upgrade to Pro (https://chatgpt.com/explore/pro), visit https://chatgpt.com/settings/usage to purchase more credits or try again later."
);
}
@@ -175,7 +175,7 @@ fn usage_limit_reached_error_formats_rate_limit_reached_types() {
let cases = [
(
RateLimitReachedType::RateLimitReached,
"You’ve hit your usage limit. Upgrade to Pro (https://chatgpt.com/explore/pro), visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again later.",
"You’ve hit your usage limit. Upgrade to Pro (https://chatgpt.com/explore/pro), visit https://chatgpt.com/settings/usage to purchase more credits or try again later.",
),
(
RateLimitReachedType::WorkspaceOwnerCreditsDepleted,
@@ -495,7 +495,7 @@ fn usage_limit_reached_error_formats_pro_plan_with_reset() {
rate_limit_reached_type: None,
};
let expected = format!(
"You’ve hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at {expected_time}."
"You’ve hit your usage limit. Visit https://chatgpt.com/settings/usage to purchase more credits or try again at {expected_time}."
);
assert_eq!(err.to_string(), expected);
});
@@ -517,8 +517,7 @@ fn usage_limit_reached_error_hides_upsell_for_non_codex_limit_name() {
..rate_limit_snapshot()
})),
promo_message: Some(
"Visit https://chatgpt.com/codex/settings/usage to purchase more credits"
.to_string(),
"Visit https://chatgpt.com/settings/usage to purchase more credits".to_string(),
),
rate_limit_reached_type: None,
};
@@ -689,7 +688,7 @@ fn usage_limit_reached_includes_hours_and_minutes() {
rate_limit_reached_type: None,
};
let expected = format!(
"You’ve hit your usage limit. Upgrade to Pro (https://chatgpt.com/explore/pro), visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at {expected_time}."
"You’ve hit your usage limit. Upgrade to Pro (https://chatgpt.com/explore/pro), visit https://chatgpt.com/settings/usage to purchase more credits or try again at {expected_time}."
);
assert_eq!(err.to_string(), expected);
});
@@ -118,7 +118,7 @@ async fn backend_banner_fallback_updates_task_settings_and_keeps_notice() -> Res
app.chat_widget
.handle_key_event(KeyEvent::new(KeyCode::Char('1'), KeyModifiers::NONE));
let queued = std::iter::from_fn(|| events.try_recv().ok()).collect::<Vec<_>>();
assert!(queued.iter().any(|event| matches!(event, AppEvent::OpenUrlInBrowser { url } if url == "https://chatgpt.com/codex/settings/usage")));
assert!(queued.iter().any(|event| matches!(event, AppEvent::OpenUrlInBrowser { url } if url == "https://chatgpt.com/settings/usage")));
let notices = queued
.iter()
.filter_map(|event| match event {
+1 -1
View File
@@ -4,7 +4,7 @@ use super::BackendBanner;
use codex_app_server_protocol::AddCreditsNudgeCreditType;
use codex_protocol::account::PlanType;
const USAGE_URL: &str = "https://chatgpt.com/codex/settings/usage";
const USAGE_URL: &str = "https://chatgpt.com/settings/usage";
const WORKSPACE_USAGE_URL: &str = "https://chatgpt.com/admin/usage-limits/workspace";
pub(super) enum BannerAction {
+1 -1
View File
@@ -2656,7 +2656,7 @@ mod tests {
assert_eq!(
selected,
if action == "view_usage" {
"https://chatgpt.com/codex/settings/usage"
"https://chatgpt.com/settings/usage"
} else {
"Credits"
}
@@ -4,7 +4,7 @@ expression: "whole_status.replace(&directory,\n\"[[workspace]]\").replace(crate:
---
>_ OpenAI Codex (vVERSION)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: GPT-5.5 (reasoning medium, summaries auto)
@@ -35,11 +35,11 @@ async fn luna_reserve_selector_supports_arrows_enter_shortcuts_and_escape_withou
),
(
vec![KeyCode::Down, KeyCode::Up, KeyCode::Enter],
Some("https://chatgpt.com/codex/settings/usage?credits_modal=true"),
Some("https://chatgpt.com/settings/usage?credits_modal=true"),
),
(
vec![KeyCode::Char('1')],
Some("https://chatgpt.com/codex/settings/usage?credits_modal=true"),
Some("https://chatgpt.com/settings/usage?credits_modal=true"),
),
(
vec![KeyCode::Char('2')],
+1 -1
View File
@@ -405,7 +405,7 @@ fn proposed_plan_cell_preserves_wrapped_table_web_links() {
#[test]
fn composite_cell_preserves_child_web_links() {
let destination = "https://chatgpt.com/codex/settings/usage";
let destination = "https://chatgpt.com/settings/usage";
let cell = CompositeHistoryCell::new(vec![
Box::new(PlainHistoryCell::new(vec![Line::from("/status")])),
Box::new(WebHyperlinkHistoryCell::new(vec![Line::from(destination)])),
+1 -1
View File
@@ -51,7 +51,7 @@ use crate::wrapping::word_wrap_lines;
use std::sync::Arc;
use std::sync::RwLock;
const CHATGPT_USAGE_URL: &str = "https://chatgpt.com/codex/settings/usage";
const CHATGPT_USAGE_URL: &str = "https://chatgpt.com/settings/usage";
#[derive(Debug, Clone)]
struct StatusContextWindowData {
@@ -6,7 +6,7 @@ expression: rendered
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.6-sol (reasoning none, summaries auto)
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex (reasoning none, summaries auto)
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex (reasoning none, summaries auto)
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning high, summaries detailed)
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Server: Local background server
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Server: unix:///tmp/codex-home/app-server-control/app-server-
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
@@ -6,8 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit
https://chatgpt.com/codex/settings/usage
Visit https://chatgpt.com/settings/usage
for up-to-date
information on rate limits and credits
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning high, summaries
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning medium, summaries auto)
@@ -6,7 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
@@ -6,8 +6,7 @@ expression: sanitized
>_ OpenAI Codex (v0.0.0)
Visit
https://chatgpt.com/codex/settings/usage for
Visit https://chatgpt.com/settings/usage for
up-to-date
information on rate limits and credits
@@ -8,7 +8,7 @@ before:
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
@@ -40,7 +40,7 @@ after:
>_ OpenAI Codex (v0.0.0)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
Visit https://chatgpt.com/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
+1 -4
View File
@@ -835,10 +835,7 @@ async fn status_uses_server_provider_id_and_auth_requirement() {
.flat_map(|line| line.hyperlinks.into_iter())
.map(|link| link.destination)
.collect();
assert_eq!(
destinations,
vec!["https://chatgpt.com/codex/settings/usage"]
);
assert_eq!(destinations, vec!["https://chatgpt.com/settings/usage"]);
}
let narrow_destinations: Vec<String> = composite