Skip to content

refactor(codex): remove what the ticket-era work left behind - #233

Merged
HTExplicit merged 3 commits into
mainfrom
chore/remove-ticket-era-tails
Oct 3, 2026
Merged

HTExplicit merged 3 commits into
mainfrom
chore/remove-ticket-era-tails

Conversation

@HTExplicit

@HTExplicit HTExplicit commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Problem

#229-#231 removed the Codex ticket subsystem but left pieces that only existed for it. An audit of main found 78:

  • some survived under new names, such as the response model guard and the "logical turn" staging;
  • some were tolerance code for its stored data, such as retired-key dropping and retired-extra filters;
  • one was the old module's shell: the "native Codex runtime host", which takes a database lease on every OAuth request to serve one boolean.

The owner's instruction: retired features are deleted, and stored data is fixed at the root instead of being tolerated in code.

Change

Deleted

  • Response model-declaration guard, on every path including the account test. Behaviour is upstream's: the reply is delivered and the usage log records upstream_model_mismatch.
  • Codex quality diagnostics: the /codex-quality-runs routes, the grant/trial headers, every hook in forwarding, and the service and repository code.
  • 「Codex 出站指纹」: the panel, its two endpoints, profile selection and the per-request wire observation. The account test still prints its identity snapshot and the headers it sent; it now builds them itself.
  • Plugin-owner / account-view job metadata decoding (account_job_legacy.go).
  • Tolerance added by refactor(codex): remove ticket and route-qualification harvesting #229/chore(codex): purge dormant ticket data (migration 263) #230: retired config keys, retired account-extra keys, kind_unsupported and its text, placeholder parameters, and tests that only pinned tolerance.

Replaced

  • Runtime host. The lease, epoch, generation, receipt headers, encrypted config and module dispatch give way to one plain settings row, codex_runtime_config = {"request_zstd":bool}. It is decoded strictly, and a missing row means gateway.openai_codex_request_zstd. A package-level compression gate and direct typed calls into codexruntime/profile and codexruntime/recovery replace the dispatch. GET/PUT /api/v1/admin/settings/codex-runtime keep their path and body.

Restored

Where a differing upstream model is shown (replies that declare another model now reach the UI)

  • Single account test: prints the line the batch test already shows, 「↳ 上游响应: (模型不一致)」.
  • Quality check: such a run is judged 疑似降智 whatever its answer, with the reason next to the verdict (owner decision from the preview).

Migration 264

  • Compression value. Carried over by comparing the recorded normalized-config hash with the two possible bodies. An unknown hash raises instead of guessing.
  • Dropped. sub2api_plugin_state (it raises if another plugin has rows there) and sub2api_plugin_leases.
  • Retired installation. Removes the stored configuration and package of the retired codexrip.codex-runtime installation, and deletes the two legacy settings rows.
  • Fingerprint mode. Written explicitly for OAuth accounts that had none.

The migration is forward-only. A read-only production pre-check confirmed its three preconditions: the receipt lists the plugin, the hash is the known "on" value, and the state table holds only this plugin's 42 rows.

Not changed here, by agreement with the parallel reasoning-recovery rework: recovery semantics, and a few always-nil error returns in plugin_codex_recovery.go that the rework removes next.

Verification

  • go build ./...; go vet under no tag, unit and integration; golangci-lint v2.13 on the touched packages;
  • targeted tests for identity, compression, turn-state (the TurnStateCommits suite restored to its pre-Add GPT-6 Sol/Luna, verified Cookie routing and account-scoped prompt rules #192 form), the settings load and PUT, the account test output, and account jobs;
  • migration 264 on a throwaway PostgreSQL 18.1: a fresh database, seeded pre-migration rows of every kind plus rows that must survive, each raise case, and a second apply;
  • frontend vue-tsc --noEmit, check:i18n, eslint and the specs of touched components;
  • a six-lens review (hot path, turn-state, completeness against the audit, migration, frontend, kept features) with every finding verified: 25 confirmed, 22 fixed, 3 deferred to the parallel rework;
  • a local mock-data before/after preview of the changed screens.

Not run: race suites locally (no cgo), Redis-dependent integration tests, real model calls.

🤖 Generated with Claude Code

Codex and others added 3 commits October 3, 2026 22:40
The ticket removal (#229-#231) kept several pieces that only existed for
it, some under new names, plus tolerance code for its stored data. This
removes them and restores the upstream or pre-ticket form in each place.

Deleted: the response model-declaration guard on every path (upstream
behaviour: the reply is delivered and the 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 added by #229/#230.

Replaced: the native Codex runtime host (lease, epoch, generation,
receipts, encrypted config, module dispatch) by one plain settings row
{request_zstd} and direct calls into codexruntime/profile and
codexruntime/recovery. GET/PUT /admin/settings/codex-runtime keep their
path and body.

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 (it refuses an unknown hash instead of guessing), 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.

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

With the response model guard gone, an ordinary single test completed
without saying that another model had answered. It now prints the same
line the batch test shows. Also use typographic quotes in the restored
fingerprint-mode description.

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

The quality check now reaches replies that declare another model. Such a
run is judged suspected degradation whatever its answer, with the reason
shown next to the verdict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HTExplicit
HTExplicit merged commit 291d25e into main Oct 3, 2026
18 checks passed
@HTExplicit
HTExplicit deleted the chore/remove-ticket-era-tails branch October 3, 2026 16:11
HTExplicit pushed a commit that referenced this pull request Oct 3, 2026
One conflict, backend/internal/service/admin_account.go: upstream's TypeSafe
API-key-only check stays, and the maps.Clone(accountExtra) line that #233
removed stays removed. The risk manifest is regenerated against the new
downstream commit and the review document names it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HTExplicit added a commit that referenced this pull request Oct 4, 2026
…#237)

The Codex identity resolvers kept a context parameter and a ...Context twin from the dispatch layer removed in #233. Each pair is now one function: resolveCodexOutboundIdentityForAccount, enforceCodexIdentityHeadersForAccount and resolveCodexIdentitySnapshot. An identity whose version cannot form a valid User-Agent still fails the send on every send path; the two diagnostic readers keep ignoring that error explicitly. The five account-test messages that named a policy now read "Codex client identity is invalid: ...". No request changes what it sends or when it fails.

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