Skip to content

refactor(codex): remove ticket and route-qualification harvesting - #229

Merged
HTExplicit merged 2 commits into
mainfrom
chore/remove-codex-tickets
Oct 2, 2026
Merged

HTExplicit merged 2 commits into
mainfrom
chore/remove-codex-tickets

Conversation

@HTExplicit

Copy link
Copy Markdown
Owner

Problem

The fork carried its own Codex "ticket" subsystem: a background module that sent probe requests through a separate harvest proxy to obtain short-lived (120 s) per-account, per-model route qualifications. It also ran a fail-closed scheduler gate and a per-request gate that blocked OAuth accounts without a live qualification for gpt-6-astra / gpt-6-sol / gpt-6-luna / gpt-5.6-sol. Our own quality data shows answer quality follows the account, not how the request is routed. The owner decided to remove the subsystem completely. Upstream has no equivalent.

Change

Removed:

  • the ticket module (codexruntime/tickets) and its routing host: probes, cookie handling, connection leases, proxy trust, demand tracking and the renew loop;
  • the scheduler and request gates, the qualified transport, and the forced HTTP bridge for gated models on WS. WS ingress uses the upstream v0.2.11 condition again;
  • admin endpoints for manual and batch harvest/stop, harvest-proxy parse/test, route validation and the legacy ticket settings;
  • the job executors for codex_ticket_harvest, codex_ticket_stop and extension_operation;
  • codex_turn_tickets on account DTOs, the ticket status events in account tests, and the fix(tickets): preserve account state during inactive credential refresh #190 credential context. Token refresh is upstream behaviour again;
  • every related UI element: the row-menu items, bulk-bar buttons, modal, 用量 lines, edit-dialog section, and the routing parts of the settings page and fingerprint panel.

Kept, moved into neutral files with unchanged behaviour:

  • Native Codex runtime host. It moves to codexruntime/core, its config is now {request_zstd}, and the /settings/codex-runtime endpoint and receipts are unchanged. Retired keys in the stored config or in a PUT are dropped instead of rejected, so the server still boots.
  • Recovery and client identity/profile dispatch.
  • Credential-owner identity hash. Only the name changes; a test pins the formula.
  • Logical-turn staging and turn-state semantics.
  • Response model-declaration guard. It now also covers the account test's ordinary path.
  • Outbound wire observation.

Codex quality runs no longer need a route. Create binds model and reasoning_effort, validated against the account mapping and the group's effort policy, and sends go over the account's ordinary forwarding path. renew-route is gone, and runs recorded before the rebuild stay readable but read-only.

UI as approved in the local preview: the page is renamed 「Codex 运行设置」 and keeps only the compression toggle; the fingerprint panel keeps identity, UA, profile, observed request and reference. Old job rows of the retired kinds still list with their names and say they cannot be retried.

Code only: no migration. The dormant rows, settings, extra keys and the 244/245 triggers are purged in a follow-up release. On first boot the native runtime records a new normalized config hash, which bumps runtime_generation once. The encrypted config source is not rewritten.

Verification

Not run: race suites locally (no cgo), real model calls.

🤖 Generated with Claude Code

Codex and others added 2 commits October 3, 2026 00:59
Removes the in-process Codex ticket module and everything that existed only
for it: harvest-proxy route acquisition/verification, routing cookies and
connection leases, the fail-closed scheduler and request gates, the manual
and batch harvest/stop actions, the harvest proxy settings and their UI.

Kept and moved to neutral files with identical behaviour: the native Codex
runtime host (now configured by request_zstd only; retired keys in the
stored config are dropped on load), client identity/profile and recovery
dispatch, the credential-owner identity hash, logical-turn staging, the
response model-declaration guard and the outbound wire observation.

Codex quality runs no longer need a route: create binds a model and
reasoning effort, sends use the account's ordinary forwarding path, and
renew-route is gone. Pre-rebuild ledgers stay readable.

Code only: no migration; dormant ticket data is purged in a follow-up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e retried

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HTExplicit
HTExplicit merged commit f326e20 into main Oct 2, 2026
18 checks passed
@HTExplicit
HTExplicit deleted the chore/remove-codex-tickets branch October 2, 2026 19:58
HTExplicit added a commit that referenced this pull request Oct 3, 2026
Removes the pieces the Codex ticket removal (#229-#231) left behind and restores the upstream or pre-ticket form in each place.

Deleted: the response model-declaration guard (upstream behaviour: reply delivered, usage log records upstream_model_mismatch); the codex-quality-runs diagnostics; the Codex outbound fingerprint panel with its per-request wire observation and profile selection; plugin-owner job metadata decoding; the retired-key, retired-extra and retired-job tolerance.

Replaced: the native Codex runtime host by one plain settings row {request_zstd} and direct calls into codexruntime/profile and codexruntime/recovery.

Restored: x-codex-turn-state handling to the fork's contract from before the routing commits; Responses-Lite default instructions to upstream.

Migration 264 carries the compression value over from the recorded config hash, drops sub2api_plugin_state and sub2api_plugin_leases, removes the retired codex-runtime installation's stored configuration and package, and writes the fingerprint mode explicitly for OAuth accounts that had none.

A differing upstream model is now shown in the single account test and makes the quality verdict suspect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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