Move downstream socket ownership into a bounded pump, preserve official Codex control-frame behavior, and bound downstream writes.
Enforce the official connection lifetime after active terminal delivery, add structured transport diagnostics, and mirror connection/protocol coverage under the test tree without adding stream_id.
Co-authored-by: Codex <noreply@openai.com>
Reuse the direct runtime-settings read for the single-row control-plane path, collapse repeated provider snapshot lookups in request lifecycle writes, and remove the unused credential revision vector surface.
No schema migration is added because no candidate crossed the EXPLAIN and write-amplification gate.
Co-authored-by: Codex <noreply@openai.com>
Separate Usage list and detail reads, use keyset paging with first-page totals, push Ops predicates into source branches, and merge repeated account and diagnostics aggregates. Apply the shared per-query PostgreSQL budget, coalesce identical Dashboard windows, and preserve the existing IP, User-Agent, and latency detail surface.
Co-authored-by: Codex <noreply@openai.com>
Move account, account-group, and client-key filtering, stable ordering, counts, and current-page membership reads into PostgreSQL. Keep Redis cooldown and lease enrichment in the Admin application boundary, share stable page state in the UI, and supervise client-key last-used flushing through the host worker lifecycle.
Co-authored-by: Codex <noreply@openai.com>
Move refresh candidate filtering, ordering, exclusions, and limits into one PostgreSQL query for OpenAI and xAI. Keep refresh policy in each provider and preserve the final credential revision fence without adding a scheduling cache or catalog table.
Co-authored-by: Codex <noreply@openai.com>
Materialize only the narrow request facts shared by the request and ops aggregates, then compute each aggregate once. This removes repeated scans of the wide model_requests CTE while preserving usage-fact cost coverage.
Co-authored-by: Codex <noreply@openai.com>
Count provider request, attempt, and failure facts across the full execution audit while restricting token totals to completed usage facts. Add a PostgreSQL regression assertion for the mixed success/failure boundary.
Co-authored-by: Codex <noreply@openai.com>
Remove orphaned fixtures, unused capability and resource branches, and stale credential APIs.
Retire legacy Usage metadata fallbacks and record the completed cleanup.
Co-authored-by: Codex <noreply@openai.com>
Remove the workspace token-breakdown probe and its dedicated statistics mode so usage aggregation always uses the personal model-credit and token-total reports.
Drop the invariant mode field from provider projections, the admin response, and the account usage UI.
Co-authored-by: Codex <noreply@openai.com>
Fetch Codex cycle usage in the provider, calculate model and daily Token costs with the shared OpenAI pricing rules, and expose the result through the admin API.
Add the account usage statistics modal, structured loading state, and feature-scoped quota components.
Co-authored-by: Codex <noreply@openai.com>
Fold the nullable requested-model change into the initial migration and keep the frozen manifest and project guidance aligned.
Remove the staged Pen design source.
Co-authored-by: Codex <noreply@openai.com>
Move the thread-spawn transport identity regression behind the public initialized-provider boundary so production source files remain free of embedded test modules.
Co-authored-by: Codex <noreply@openai.com>
Share the preferred account across derived child executions while keeping their continuation and WebSocket transport identities isolated.
Claim and migrate affinity atomically, clear account-bound state on fallback, reject cross-account previous-response continuations, and preserve complete replay transcripts.
Co-authored-by: Codex <noreply@openai.com>