Skip to content

feat(codex): per-account Codex TUI identity, device-default fingerprint, hyphen session headers - #179

Merged
HTExplicit merged 3 commits into
mainfrom
feat/codex-account-identity
Sep 17, 2026
Merged

HTExplicit merged 3 commits into
mainfrom
feat/codex-account-identity

Conversation

@HTExplicit

Copy link
Copy Markdown
Owner

Summary

Second PR of the Codex identity series (after #178 removed the quota overdraft).

  • Every OpenAI OAuth / setup-token account gets a fixed, realistic Codex TUI identity (OS, version, arch, terminal, sandbox) derived deterministically from its system fingerprint seed and persisted in accounts.extra.codex_client_identity. All outbound requests of that account (HTTP, passthrough, WS handshake, probes, models, token refresh) present the same codex-tui/<ver> (<os> <ver>; <arch>) <terminal> (codex-tui; <ver>) User-Agent with matching originator and version. A startup backfill persists identities for existing accounts.
  • codex_fingerprint_mode now defaults to device for OpenAI OAuth-like accounts; an explicit off is still honored. Migration 243 writes device for accounts that never chose a mode and ensures every such account has a seed. The admin UI always writes the literal mode, including off.
  • Header shape: forward the hyphenated session-id / thread-id / x-client-request-id; stop sending the legacy underscore session_id / conversation_id outside the compact path; never emit x-codex-installation-id as a header; scoping of client identifiers keeps UUIDv7 time bits and maps the same raw UUID identically across fields.
  • Turn-metadata sandbox follows the effective outbound User-Agent.
  • Token refresh for an existing account uses that account's identity; the first token exchange and PAT whoami keep the canonical identity.

Verification

  • go build ./..., go vet -tags=unit (service, repository, cmd/server) pass.
  • Unit tests: service package has only the pre-existing TestOllamaProbeCallback_StaleLongDoesNotOverrideNewShort failure (fails on main as well); repository, cmd/server and handler packages pass.
  • Frontend: vue-tsc --noEmit and the Makefile critical vitest list pass.

🤖 Generated with Claude Code

Codex added 3 commits September 18, 2026 03:39
… TUI identity

- derive a per-account Codex TUI identity (OS, version, arch, terminal, sandbox) from the
  system fingerprint seed, persist it in accounts.extra, and use it for every outbound
  request of that account (HTTP, passthrough, WS handshake, probes, token refresh)
- default codex_fingerprint_mode to device for OpenAI OAuth-like accounts; explicit off is
  still honored; migration 243 backfills stored accounts and seeds
- forward the hyphenated session-id / thread-id / x-client-request-id headers, stop sending
  the legacy underscore session_id/conversation_id outside compact, never emit
  x-codex-installation-id as a header, and keep UUIDv7 time bits when scoping identifiers
- turn-metadata sandbox follows the effective outbound User-Agent
…ng and native WS

- share the ForceCodexCLI override policy between inference and token refresh via a
  process snapshot; staging derives sandbox from the same effective User-Agent the final
  builder emits (shadow-account parent source, enforcement-off pairing)
- backfill persisted identities for OpenAI accounts of every status
- Anthropic-bridge, chat-completions and alpha-search fallback paths now emit the hyphen
  session headers for Codex accounts instead of underscore session_id/conversation_id
- WS handshake fallback uses the frame's final prompt_cache_key without a second scope
- native WebSocket ingress and passthrough frames stage and apply fingerprint convergence
…der-owned session headers

- account test probe, usage probe, models manifest and upstream model listing use the shared
  ForceCodexCLI-aware override policy instead of the raw custom User-Agent
- staging predicts the bridge contract: compat Messages bridge requests keep the builder's
  User-Agent, so sandbox follows that value
- Messages/Chat/alpha-search fallbacks only fill missing hyphen session headers and drop the
  underscore ones; an inbound session-id is never overwritten by the cache-key fallback
@HTExplicit
HTExplicit merged commit 5d90062 into main Sep 17, 2026
16 checks passed
@HTExplicit
HTExplicit deleted the feat/codex-account-identity branch September 17, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant