mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
5a67d898a5
# Summary Codex required every ChatGPT account to have an email address. A service-account personal access token can return valid account metadata without one, so PAT login failed while decoding the metadata response. This change makes email optional in the account metadata type that owns it and preserves that absence through authentication, provider account state, the app-server API, generated clients, and TUI bootstrap. Existing accounts with email addresses keep the same behavior. ## Behavior-changing call sites | Call site | Behavior after this change | | --- | --- | | `login/src/auth/personal_access_token.rs` | PAT metadata accepts a missing or null email and retains `None`. | | `agent-identity/src/lib.rs` | Agent Identity JWT claims accept an omitted email. | | `login/src/auth/storage.rs` and `login/src/auth/agent_identity.rs` | Stored and managed Agent Identity records carry `Option<String>`. Deserialization maps the legacy empty-string sentinel to `None`. | | `login/src/auth/manager.rs` | `get_account_email` returns the stored option, and managed identity bootstrap no longer converts `None` to an empty string. | | `model-provider/src/provider.rs` and `protocol/src/account.rs` | A ChatGPT provider account requires a plan type but may carry no email. | | `app-server-protocol/src/protocol/v2/account.rs` | `account/read` keeps the `email` field on the wire and returns `null` when the account has no email. Generated TypeScript and JSON schemas describe a required, nullable field. | | `sdk/python/src/openai_codex/generated/v2_all.py` | The generated Python `ChatgptAccount` model accepts `None` for email. | | `tui/src/app_server_session.rs` | Email-less ChatGPT accounts bootstrap normally, keep external feedback routing, omit account-email telemetry, and display the plan in account status. | ## Design decisions - Missing email remains `None` at every layer. The code never uses an empty string as a substitute. - The app-server response includes `"email": null` instead of omitting the field. Clients retain a stable response shape. - Plan type remains required for provider account state. This change relaxes only the email assumption. ## Testing Tests: affected test targets compile, scoped Clippy and formatting pass, a focused TUI snapshot covers plan-only account status, real before/after PAT login smoke covers metadata without email, app-server smoke covers `account/read` with `email: null`, and a regression smoke covers an existing email-bearing PAT. Unit tests run in CI. ## Evidence Visual smoke evidence will be attached here.
165 lines
5.3 KiB
TOML
165 lines
5.3 KiB
TOML
[package]
|
|
name = "codex-tui"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
autobins = false
|
|
|
|
[[bin]]
|
|
name = "codex-tui"
|
|
path = "src/main.rs"
|
|
|
|
[[bin]]
|
|
name = "md-events"
|
|
path = "src/bin/md-events.rs"
|
|
|
|
[lib]
|
|
name = "codex_tui"
|
|
path = "src/lib.rs"
|
|
doctest = false
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
anyhow = { workspace = true }
|
|
base64 = { workspace = true }
|
|
chrono = { workspace = true, features = ["serde"] }
|
|
clap = { workspace = true, features = ["derive"] }
|
|
codex-ansi-escape = { workspace = true }
|
|
codex-app-server-client = { workspace = true }
|
|
codex-app-server-protocol = { workspace = true }
|
|
codex-arg0 = { workspace = true }
|
|
codex-install-context = { workspace = true }
|
|
codex-cloud-config = { workspace = true }
|
|
codex-config = { workspace = true }
|
|
codex-connectors = { workspace = true }
|
|
codex-core-plugins = { workspace = true }
|
|
codex-core-skills = { workspace = true }
|
|
codex-exec-server = { workspace = true }
|
|
codex-features = { workspace = true }
|
|
codex-feedback = { workspace = true }
|
|
codex-file-search = { workspace = true }
|
|
codex-git-utils = { workspace = true }
|
|
codex-login = { workspace = true }
|
|
codex-message-history = { workspace = true }
|
|
codex-model-provider = { workspace = true }
|
|
codex-model-provider-info = { workspace = true }
|
|
codex-models-manager = { workspace = true }
|
|
codex-otel = { workspace = true }
|
|
codex-plugin = { workspace = true }
|
|
codex-protocol = { workspace = true }
|
|
codex-rollout = { workspace = true }
|
|
codex-sandboxing = { workspace = true }
|
|
codex-shell-command = { workspace = true }
|
|
codex-state = { workspace = true }
|
|
codex-terminal-detection = { workspace = true }
|
|
codex-utils-approval-presets = { workspace = true }
|
|
codex-utils-absolute-path = { workspace = true }
|
|
codex-utils-cli = { workspace = true }
|
|
codex-utils-elapsed = { workspace = true }
|
|
codex-utils-fuzzy-match = { workspace = true }
|
|
codex-utils-home-dir = { workspace = true }
|
|
codex-utils-oss = { workspace = true }
|
|
codex-utils-path = { workspace = true }
|
|
codex-utils-path-uri = { workspace = true }
|
|
codex-utils-plugins = { workspace = true }
|
|
codex-utils-sandbox-summary = { workspace = true }
|
|
codex-utils-sleep-inhibitor = { workspace = true }
|
|
codex-utils-string = { workspace = true }
|
|
color-eyre = { workspace = true }
|
|
crossterm = { workspace = true, features = ["bracketed-paste", "event-stream"] }
|
|
derive_more = { workspace = true, features = ["is_variant"] }
|
|
diffy = { workspace = true }
|
|
dirs = { workspace = true }
|
|
dunce = { workspace = true }
|
|
image = { workspace = true, features = ["jpeg", "png", "gif", "webp"] }
|
|
itertools = { workspace = true }
|
|
lazy_static = { workspace = true }
|
|
pathdiff = { workspace = true }
|
|
pulldown-cmark = { workspace = true }
|
|
rand = { workspace = true }
|
|
ratatui = { workspace = true, features = [
|
|
"scrolling-regions",
|
|
"unstable-backend-writer",
|
|
"unstable-rendered-line-info",
|
|
"unstable-widget-ref",
|
|
] }
|
|
ratatui-macros = { workspace = true }
|
|
regex-lite = { workspace = true }
|
|
reqwest = { workspace = true, features = ["blocking", "json"] }
|
|
rmcp = { workspace = true }
|
|
serde = { workspace = true, features = ["derive"] }
|
|
serde_json = { workspace = true, features = ["preserve_order"] }
|
|
sha2 = { workspace = true }
|
|
shlex = { workspace = true }
|
|
strum = { workspace = true }
|
|
strum_macros = { workspace = true }
|
|
supports-color = { workspace = true }
|
|
tempfile = { workspace = true }
|
|
textwrap = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
tokio = { workspace = true, features = [
|
|
"io-std",
|
|
"macros",
|
|
"process",
|
|
"rt-multi-thread",
|
|
"signal",
|
|
"test-util",
|
|
"time",
|
|
] }
|
|
tokio-stream = { workspace = true, features = ["sync"] }
|
|
toml = { workspace = true }
|
|
tracing = { workspace = true, features = ["log"] }
|
|
tracing-appender = { workspace = true }
|
|
tracing-subscriber = { workspace = true, features = ["env-filter"] }
|
|
syntect = "5"
|
|
two-face = { version = "0.5", default-features = false, features = ["syntect-default-onig"] }
|
|
unicode-segmentation = { workspace = true }
|
|
unicode-width = { workspace = true }
|
|
url = { workspace = true }
|
|
urlencoding = { workspace = true }
|
|
webbrowser = { workspace = true }
|
|
uuid = { workspace = true }
|
|
|
|
codex-windows-sandbox = { workspace = true }
|
|
tokio-util = { workspace = true, features = ["time"] }
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
libc = { workspace = true }
|
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
which = { workspace = true }
|
|
windows-sys = { version = "0.52", features = [
|
|
"Win32_Foundation",
|
|
"Win32_Security",
|
|
"Win32_Storage_FileSystem",
|
|
"Win32_System_Console",
|
|
"Win32_System_IO",
|
|
"Win32_System_Pipes",
|
|
"Win32_System_Threading",
|
|
] }
|
|
winsplit = "0.1"
|
|
|
|
# Clipboard support via `arboard` is not available on Android/Termux.
|
|
# Only include it for non-Android targets so the crate builds on Android.
|
|
[target.'cfg(not(target_os = "android"))'.dependencies]
|
|
arboard = { workspace = true }
|
|
|
|
|
|
[dev-dependencies]
|
|
app_test_support = { workspace = true }
|
|
codex-cli = { workspace = true }
|
|
codex-mcp = { workspace = true }
|
|
core_test_support = { workspace = true }
|
|
codex-utils-cargo-bin = { workspace = true }
|
|
assert_matches = { workspace = true }
|
|
chrono = { workspace = true, features = ["serde"] }
|
|
insta = { workspace = true }
|
|
pretty_assertions = { workspace = true }
|
|
rand = { workspace = true }
|
|
serial_test = { workspace = true }
|
|
vt100 = { workspace = true }
|
|
uuid = { workspace = true }
|
|
wiremock = { workspace = true }
|