Skip to content

feat: land four rebuilt heavy drafts (service tiers, request pacing, native chat, empty-completion guard) - #1752

Merged
lidge-jun merged 32 commits into
devfrom
int/260815-heavy-final
Aug 15, 2026
Merged

feat: land four rebuilt heavy drafts (service tiers, request pacing, native chat, empty-completion guard)#1752
lidge-jun merged 32 commits into
devfrom
int/260815-heavy-final

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary\n\nLands four heavy cherry-pick-and-rebuilds from old draft PRs (triage: devlog/_plan/260815_old_draft_triage/), each rebuilt against current dev by worker agents, adversarially reviewed through three repair rounds, and composed with explicit cross-feature requirements:\n\n- #1521 per-model verified routed service tiers (#1436) — exact-model resolver on current wire-specific architecture (Responses capability never authorizes Chat; exact-model Chat capability added)\n- #1584 provider request pacing — bounded scheduler (256/60s caps), providerFetch runtime compat preserved, pacing state registered with generation reconciliation\n- #1569 native chat->chat for eligible openai-chat providers (#1467) — true raw-Chat fidelity (sentinel-probed: service_tier/seed/logprobs/metadata/message names survive), bounded SSE, redacted structured errors\n- #1655 opt-in empty-completion guard — default-OFF explicit opt-in, 1024-event/1MiB retention caps, stall-safe heartbeats, usage-attributed retry\n\nComposition (reviewer-verified): pacing keys on final resolved route; native path consumes pacing before its header timeout; identical retries consume a pacing slot and replay tier-gated bytes; native path explicitly excluded from the empty-completion guard. One suite-caught flight-authority defect in the 1521 resolver was root-caused and fixed (a65bfc0).\n\n## Verification\n\n- Remote full gates on ssh lidge @ a65bfc0 (this tip): 12336 pass / 11 skip / 0 fail (12347 tests, 785 files); typecheck, privacy:scan, lint:gui green.\n- Independent repair reviewer: PASS after three blocker rounds (native fidelity probe, pacing runtime compat + reconciliation, exact-model Chat authorization, runTurn pacing-rejection containment, flight authority).\n\n## Checklist\n\n- [x] Targets dev\n- [x] No token/secret logging added (structured provider errors redacted)\n- [x] Regression tests included for every behavior change and every composition requirement

Summary by CodeRabbit

  • New Features

    • Added native Chat Completions handling with streaming, usage reporting, error handling, and fallback support.
    • Added provider request pacing with global and per-model limits, queue monitoring, and overload responses.
    • Added optional retry for empty Responses completions.
    • Added model-specific service-tier controls with safer capability detection and catalog display.
  • Documentation

    • Updated configuration guidance and localized documentation for pacing, retries, Chat Completions, and service tiers.

Yuxin-Qiao and others added 30 commits August 15, 2026 15:41
Port codex-router PR #145: a 200 that completes with no output text and no
tool call is a failure the client cannot see (it silently records the turn
as done). Hold pre-content adapter events, suppress the terminal of an empty
turn, retry the IDENTICAL request once, and surface empty_completion_retry_failed
when the retry is also empty or fails upstream. Usage is merged across both
attempts so the request log meters the whole turn.

Kill switch: OCX_EMPTY_COMPLETION_RETRY=0 restores the previous behavior.
Compaction turns and combo attempts are excluded.
Add provider-wide and exact-model request-start pacing with dashboard controls, live queue status, management validation, transport coverage, tests, and localized documentation.
The non-streaming chat-native path now charges upstream bytes
incrementally and cancels the locked reader on budget overflow.
Cover overflow returning 413 and that the server remains responsive
for the next turn, and document the invalid-JSON passthrough
contract. No further product-code blocker per Ingwannu review.

Refs #1467
# Conflicts:
#	src/server/responses/core.ts
# Conflicts:
#	src/server/responses/core.ts
@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 15, 2026
@lidge-jun
lidge-jun merged commit 9ed2e84 into dev Aug 15, 2026
7 of 9 checks passed
@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • PR description needs work (escaped_newlines). UI screenshot required.

What to do

  • Add a real Summary and Test plan to the PR description.
  • Add a screenshot of the UI change to the PR description.

Automatic draft conversion failed (token cannot change draft status). Please convert this pull request to a draft manually. The required enforce-target check will keep failing until every issue above is resolved.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 319bc7bb-478a-4a03-b683-b9d3fd8f7f9a

📥 Commits

Reviewing files that changed from the base of the PR and between cc8e5a3 and a65bfc0.

⛔ Files ignored due to path filters (1)
  • assets/request-pacing-dashboard.jpg is excluded by !**/*.jpg
📒 Files selected for processing (80)
  • docs-site/src/content/docs/guides/codex-app-models.md
  • docs-site/src/content/docs/ja/reference/configuration/providers.md
  • docs-site/src/content/docs/ja/reference/configuration/server.md
  • docs-site/src/content/docs/ko/reference/configuration/providers.md
  • docs-site/src/content/docs/ko/reference/configuration/server.md
  • docs-site/src/content/docs/reference/configuration/providers.md
  • docs-site/src/content/docs/reference/configuration/server.md
  • docs-site/src/content/docs/ru/reference/configuration/providers.md
  • docs-site/src/content/docs/ru/reference/configuration/server.md
  • docs-site/src/content/docs/tr/reference/configuration/server.md
  • docs-site/src/content/docs/zh-cn/reference/configuration/providers.md
  • docs-site/src/content/docs/zh-cn/reference/configuration/server.md
  • docs-site/src/content/docs/zh-tw/reference/configuration/providers.md
  • docs-site/src/content/docs/zh-tw/reference/configuration/server.md
  • gui/src/components/provider-workspace/ProviderSettings.tsx
  • gui/src/components/provider-workspace/types.ts
  • gui/src/i18n/de.ts
  • gui/src/i18n/en.ts
  • gui/src/i18n/ja.ts
  • gui/src/i18n/ko.ts
  • gui/src/i18n/ru.ts
  • gui/src/i18n/tr.ts
  • gui/src/i18n/zh-TW.ts
  • gui/src/i18n/zh.ts
  • gui/src/pages/Logs.tsx
  • gui/src/provider-workspace/catalog.ts
  • gui/src/styles/provider-workspace-settings.css
  • gui/tests/provider-settings-live-models-provenance.test.tsx
  • gui/tests/provider-settings-request-pacing.test.tsx
  • src/adapters/openai-chat.ts
  • src/chat/inbound.ts
  • src/codex/catalog/aggregation.ts
  • src/codex/catalog/effort.ts
  • src/codex/catalog/parsing.ts
  • src/codex/catalog/provider-fetch.ts
  • src/config.ts
  • src/images/loop.ts
  • src/lib/state-store-registrations.ts
  • src/lib/upstream-reachability.ts
  • src/providers/derive.ts
  • src/providers/registry.ts
  • src/providers/request-pacing.ts
  • src/providers/service-tier.ts
  • src/router.ts
  • src/routing/capability.ts
  • src/routing/compatibility/behavior.ts
  • src/server/auth-cors.ts
  • src/server/chat-completions.ts
  • src/server/chat-native-sse.ts
  • src/server/chat-native.ts
  • src/server/management/config-routes.ts
  • src/server/management/provider-capability-config.ts
  • src/server/management/provider-routes.ts
  • src/server/responses.ts
  • src/server/responses/compact.ts
  • src/server/responses/core.ts
  • src/server/responses/empty-completion-guard.ts
  • src/server/responses/fetch-helpers.ts
  • src/server/responses/pacing-overload.ts
  • src/server/responses/policy-fallback.ts
  • src/server/responses/upstream-error.ts
  • src/types.ts
  • src/usage/log.ts
  • structure/02_config-and-codex-home.md
  • structure/03_catalog-and-subagents.md
  • structure/04_transports-and-sidecars.md
  • tests/chat-completions-endpoint.test.ts
  • tests/codex-catalog.test.ts
  • tests/config.test.ts
  • tests/empty-completion-core.test.ts
  • tests/empty-completion-guard.test.ts
  • tests/empty-completion-hardening.test.ts
  • tests/images/loop.test.ts
  • tests/management-provider-validation.test.ts
  • tests/openai-chat-hardening.test.ts
  • tests/request-pacing.test.ts
  • tests/routing-policy-fallback.test.ts
  • tests/service-tier-capability.test.ts
  • tests/state-store-sweeper.test.ts
  • tests/usage-log.test.ts

📝 Walkthrough

Walkthrough

Changes

Provider runtime capabilities

Layer / File(s) Summary
Service-tier capability resolution
src/providers/*, src/codex/catalog/*, src/router.ts, src/routing/*, src/server/responses/core.ts
Service-tier support now resolves by provider, exact model, inbound wire, and final adapter.
Request pacing
src/providers/request-pacing.ts, src/server/responses/fetch-helpers.ts, src/images/loop.ts
Provider and model request-start limits use bounded queues, cancellation, status reporting, reconciliation, timeout-aware waits, and overload responses.
Empty-completion retry
src/server/responses/empty-completion-guard.ts, src/server/responses/core.ts, src/config.ts
Responses completions without text or tool calls can retry once when enabled.
Native Chat routing
src/server/chat-completions.ts, src/server/chat-native.ts, src/server/chat-native-sse.ts, src/adapters/openai-chat.ts
Eligible Chat requests now use native adapter routing with bounded SSE and JSON handling.
Management and documentation
src/server/management/*, gui/src/components/provider-workspace/*, docs-site/src/content/docs/*, structure/*
Management APIs, workspace controls, localized strings, and documentation expose the new settings.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested reviewers: ingwannu, wibias, chrisae9

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch int/260815-heavy-final

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants