Skip to content

feat: restore opt-in plaintext V2 agent messages - #4351

Merged
lidge-jun merged 41 commits into
devfrom
codex/260912-60plus-v2
Sep 13, 2026
Merged

feat: restore opt-in plaintext V2 agent messages#4351
lidge-jun merged 41 commits into
devfrom
codex/260912-60plus-v2

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

Restore the configuration-only plaintextV2AgentMessages option from #2496 on current dev. Explicit opt-in rewrites eligible canonical ChatGPT V2 namespace and message-tool identities and restores them before client delivery and continuation storage. JSON, SSE and WebSocket restoration reject malformed, conflicting and over-limit payloads without retrying the model.

Relates to #2495. This is a maintainer-owned adaptation of #2496 at 1a4cb4aab14200ec2efa71aea00d2a55fc90aca7. #4242/#4243 were reviewed as alternatives; their different flag, mirror behavior and management surface are not carried. Encrypted multipart recovery in #3661 is separate.

Verification

  • Local product tests, builds, typecheck and install: NOT RUN, explicitly prohibited by the maintainer for this lane.
  • git diff --check: passed. Static import-path inspection found no missing imports in the two new test files; this is not runtime verification.
  • Regression tests authored for eligibility, collision, JSON/SSE/WS restoration, refusal/cache isolation and option changes.
  • Independent agent static correctness/security review: PASS, including exact namespace/name compatibility with the inspected native Codex consumer. This is not maintainer approval or a live backend canary.
  • Final candidate 4db9d98f084a93297fe26e85002e15ecb2dbdaaf: Cross-platform CI, full lane=all, failure (Windows Devin/pnpm/client-connect fixtures; all other jobs succeeded). Earlier heads are not verification evidence.
  • No live backend canary or installed-service changes were performed. Upstream reserved-name behavior remains undocumented; startup and documentation disclose plaintext retention.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Co-authored-by: Sigurd gliao2@ur.rochester.edu

Resume evidence: nullable namespace correction bda46fe8f0 received independent static security PASS. The previous full CI at 4319c1eae0 failed Windows Devin/pnpm/autostart fixtures; it is not a green baseline. Other lanes retain their source fixes. Current full CI has failed; no merge or completed acceptance is claimed.

Final full-run disposition: Windows 3 failed the models-owned Devin discovery fixture; Windows 4 failed two Combo-owned pnpm fixtures; Windows 5 failed a client-connect probe timeout. Other-lane files remain untouched; no flake or green-baseline claim. Parent integration must resolve the recorded test-layout JSON conflicts and coordinate remaining repairs.

Stacked-lane GUI change and screenshot

This branch is the tip of the responses/core stack, so its diff against dev also carries the
Logs recovery-label change from #4354 (gui/src/pages/Logs.tsx plus nine gui/src/i18n/*
entries). The visible effect is one new attempt-recovery reason, "Console upload retry", in the
Logs request-detail panel. Screenshot of that label, reused from #4354:

Console upload retry label

Stack refresh: origin/dev (afe987cff) and the five lower lane branches are merged into this
tip; bun run typecheck, bun run structure:check and bun run privacy:scan pass locally.

Summary by CodeRabbit

  • New Features

    • Added optional visibility for provider-authored thinking summaries on supported Google models.
    • Added experimental plaintext v2 collaboration messages for eligible native Responses requests.
    • Added configurable filtering of Codex safety-buffering hints.
    • Added one automatic retry for eligible Console upload failures.
    • Added adaptive reasoning-effort normalization for combo targets.
    • Updated Spark transport handling based on serialized tools and model details.
  • Documentation

    • Updated configuration, provider, routing, transport, and localization documentation for these behaviors.
  • Bug Fixes

    • Preserved raw reasoning in the native content channel without relabeling it as a summary.

lidge-jun and others added 3 commits September 12, 2026 13:38
Adapt #2496 at 1a4cb4a to current Responses routing, with conservative collision and response refusal handling. Local product tests NOT RUN by maintainer instruction; hosted validation follows.

Co-authored-by: Sigurd <gliao2@ur.rochester.edu>
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 1e4d9220-3fd1-4af1-a733-27d1d749542b

📥 Commits

Reviewing files that changed from the base of the PR and between afe987c and 1a76f75.

⛔ Files ignored due to path filters (1)
  • devlog/_plan/260912_stream_recovery/093_console_recovery.png is excluded by !**/*.png
📒 Files selected for processing (130)
  • devlog/_plan/260912_stream_recovery/092_resume.md
  • devlog/_plan/260912_stream_recovery/094_console_fixture.md
  • devlog/_plan/260912_thinking_contract/000_plan.md
  • devlog/_plan/260912_thinking_contract/001_sources.md
  • devlog/_plan/260912_thinking_contract/010_presentation.md
  • devlog/_plan/260912_thinking_contract/020_transport_hint.md
  • devlog/_plan/260912_thinking_contract/030_spark.md
  • devlog/_plan/260912_thinking_contract/040_delivery.md
  • devlog/_plan/260912_thinking_contract/050_refresh.md
  • devlog/_plan/260912_v2_contracts/000_plan.md
  • devlog/_plan/260912_v2_contracts/010_plaintext.md
  • devlog/_plan/260912_v2_contracts/020_recovery.md
  • devlog/_plan/260912_v2_contracts/030_native_identity.md
  • devlog/_plan/260912_v2_contracts/040_verification.md
  • devlog/_plan/260912_v2_contracts/050_resume_evidence.md
  • docs-site/src/content/docs/fr/guides/combos.md
  • docs-site/src/content/docs/fr/reference/architecture.md
  • docs-site/src/content/docs/fr/reference/configuration/routing.md
  • docs-site/src/content/docs/guides/combos.md
  • docs-site/src/content/docs/guides/sub-agent-surface.md
  • docs-site/src/content/docs/ja/guides/combos.md
  • docs-site/src/content/docs/ja/reference/architecture.md
  • docs-site/src/content/docs/ja/reference/configuration/routing.md
  • docs-site/src/content/docs/ja/reference/configuration/server.md
  • docs-site/src/content/docs/ko/guides/combos.md
  • docs-site/src/content/docs/ko/reference/architecture.md
  • docs-site/src/content/docs/ko/reference/configuration/routing.md
  • docs-site/src/content/docs/ko/reference/configuration/server.md
  • docs-site/src/content/docs/reference/architecture.md
  • docs-site/src/content/docs/reference/configuration/agents.md
  • docs-site/src/content/docs/reference/configuration/providers.md
  • docs-site/src/content/docs/reference/configuration/routing.md
  • docs-site/src/content/docs/reference/configuration/server.md
  • docs-site/src/content/docs/reference/proxy-formats.md
  • docs-site/src/content/docs/ru/guides/combos.md
  • docs-site/src/content/docs/ru/reference/architecture.md
  • docs-site/src/content/docs/ru/reference/configuration/routing.md
  • docs-site/src/content/docs/ru/reference/configuration/server.md
  • docs-site/src/content/docs/tr/guides/combos.md
  • docs-site/src/content/docs/tr/reference/architecture.md
  • docs-site/src/content/docs/tr/reference/configuration/routing.md
  • docs-site/src/content/docs/zh-cn/guides/combos.md
  • docs-site/src/content/docs/zh-cn/guides/sub-agent-surface.md
  • docs-site/src/content/docs/zh-cn/reference/architecture.md
  • docs-site/src/content/docs/zh-cn/reference/configuration/agents.md
  • docs-site/src/content/docs/zh-cn/reference/configuration/routing.md
  • docs-site/src/content/docs/zh-cn/reference/configuration/server.md
  • docs-site/src/content/docs/zh-tw/guides/combos.md
  • docs-site/src/content/docs/zh-tw/reference/architecture.md
  • docs-site/src/content/docs/zh-tw/reference/configuration/routing.md
  • gui/src/i18n/de.ts
  • gui/src/i18n/en.ts
  • gui/src/i18n/fr.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
  • scripts/test-layout/layout.json
  • src/adapters/base.ts
  • src/adapters/google-wire-compiler.ts
  • src/adapters/google.ts
  • src/adapters/openai-chat.ts
  • src/adapters/openai-responses.ts
  • src/bridge.ts
  • src/combos/request.ts
  • src/config.ts
  • src/providers/derive.ts
  • src/providers/opencode-zen-rate-limit.ts
  • src/providers/registry.ts
  • src/responses/plaintext-v2-agent-messages.ts
  • src/router.ts
  • src/server/auth-cors.ts
  • src/server/index.ts
  • src/server/relay-eager.ts
  • src/server/relay.ts
  • src/server/responses-reasoning-summary-rewrite.ts
  • src/server/responses/core.ts
  • src/types/config.ts
  • src/types/provider.ts
  • src/types/request.ts
  • src/usage/log.ts
  • structure/adapters/registry.md
  • structure/catalog.md
  • structure/clients/claude-desktop.md
  • structure/config.md
  • structure/data-planes/images.md
  • structure/data-planes/inbound-compat.md
  • structure/gui-and-management-api.md
  • structure/ops/docs-and-release.md
  • structure/ops/service-and-sidecars.md
  • structure/overview.md
  • structure/providers/chat-compat.md
  • structure/providers/cursor.md
  • structure/providers/google.md
  • structure/providers/kiro.md
  • structure/providers/openai-tiers.md
  • structure/providers/xai-grok.md
  • structure/runtime.md
  • structure/subagents.md
  • structure/transports/inventory.md
  • structure/transports/responses.md
  • structure/transports/streaming-health.md
  • tests/adapters/bridge-raw-reasoning-hidden.test.ts
  • tests/adapters/bridge.test.ts
  • tests/adapters/google/google-adapter.test.ts
  • tests/adapters/google/google-wire-compiler.test.ts
  • tests/adapters/openai/openai-chat-hardening.test.ts
  • tests/codex-integration/codex-metadata-integrity.test.ts
  • tests/codex-integration/combos.test.ts
  • tests/fixtures/test-layout-expected.json
  • tests/providers/opencode-go-luna-wire.test.ts
  • tests/providers/opencode-zen-rate-limit.test.ts
  • tests/responses/openai-responses-passthrough.test.ts
  • tests/responses/passthrough-abort.test.ts
  • tests/responses/passthrough-headers.test.ts
  • tests/responses/plaintext-v2-agent-messages.test.ts
  • tests/responses/responses-console-go-upload-retry.test.ts
  • tests/responses/responses-reasoning-summary-passthrough.test.ts
  • tests/responses/responses-reasoning-summary-rewrite.test.ts
  • tests/responses/responses-show-thinking-summary.test.ts
  • tests/responses/sse-failed-tail.test.ts
  • tests/responses/ws-upstream-reuse.test.ts
  • tests/responses/ws-upstream.test.ts
  • tests/server/config.test.ts
  • tests/server/plaintext-v2-agent-messages-server.test.ts
  • tests/server/server-combo-failover-e2e.test.ts
  • tests/server/server-xai-chat-reasoning-streaming.test.ts

📝 Walkthrough

Walkthrough

This change set updates Responses reasoning presentation, canonical transport policies, Spark Lite signaling, combo normalization, plaintext v2 agent messages, Console upload recovery, configuration validation, tests, and documentation. It also records related planning and verification status.

Changes

Responses contracts and transport behavior

Layer / File(s) Summary
Planning and contract records
devlog/_plan/...
Planning notes define the reasoning, transport, Spark, delivery, recovery, and verification contracts.
Reasoning presentation and provider defaults
src/bridge.ts, src/adapters/google.ts, src/adapters/google-wire-compiler.ts, src/providers/*, src/router.ts, src/types/provider.ts, src/server/responses/core.ts
Raw reasoning now uses the Responses content channel. showThinkingSummary is propagated through provider configuration and seeded for google-antigravity. CCA Gemini thought summaries require eligible Gemini provenance and includeThoughts: true.
Transport policy and combo normalization
src/config.ts, src/server/relay.ts, src/server/relay-eager.ts, src/adapters/openai-responses.ts, src/combos/request.ts, src/types/config.ts
Canonical Responses can filter Codex safety-buffering hints when enabled. Spark Lite signaling follows the final serialized body. Combo requests remove unsupported effort and thinking controls according to target capabilities and reasoningEffortMode.
Plaintext v2 agent messages
src/responses/plaintext-v2-agent-messages.ts, src/server/responses/core.ts, src/adapters/base.ts, src/adapters/openai-responses.ts, src/types/request.ts
Eligible canonical Responses requests alias collaboration tools and remove the encryption marker. Responses restore identities across streamed, buffered, WebSocket, snapshot, and continuation paths. Conflicts, malformed identities, unsupported content types, and over-limit responses fail closed.
Console upload recovery
src/providers/opencode-zen-rate-limit.ts, src/server/responses/core.ts, src/usage/log.ts, gui/src/pages/Logs.tsx, gui/src/i18n/*
Exact canonical Console or Console Go upload refusals receive one delayed, byte-identical retry. The retry is abort-aware, destination-gated, and recorded with localized log labels.
Validation and integration coverage
tests/**, scripts/test-layout/layout.json, tests/fixtures/test-layout-expected.json
Tests cover configuration handling, reasoning channels, CCA summaries, Spark HTTP and WebSocket metadata, relay filtering, combo dispatch, plaintext restoration, Console recovery, socket reuse, and fallback behavior.
Documentation and source-of-truth updates
docs-site/src/content/docs/**, structure/**
Documentation describes the new configuration fields, transport boundaries, reasoning semantics, Spark behavior, plaintext v2 behavior, combo normalization, and Console recovery.

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

✨ 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 codex/260912-60plus-v2

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.

@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 Sep 12, 2026
@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 46 / 80

이 PR은 설정 전용 plaintextV2AgentMessages(기본 off)로 ChatGPT V2 collaboration 네임스페이스·메시지 툴 식별자를 다시 쓰고, 클라이언트 전달·continuation 저장 전에 복원한다. 새 모듈 src/responses/plaintext-v2-agent-messages.ts(~898줄)가 중심이고, src/adapters/openai-responses.ts, src/server/responses/core.ts, src/config.ts, src/types/config.ts가 연결된다. #2496 적응이며 #4242/#4243 대안 플래그는 안 가져온다. HEAD에는 해당 파일이 없다. mergeable draft지만 +3190으로 면적이 크고, BLOCKED다.

opt-in·canonical ChatGPT·responses wire·catalog에 spawn_agent가 있을 때만 준비하는 가드가 있다. JSON/SSE/WS 복원은 malformed·충돌·over-limit을 재시도 없이 거절한다. 문서에 plaintext 보존을 드러낸다고 한다. 정적 보안 PASS 언급은 있으나 라이브 백엔드 canary는 없다. types/config를 만지므로 split 캠페인과 파일 충돌 위험이 있고, 실험적 프로토콜 변환이라 실수 시 툴 라우팅이 깨진다.

경로/심볼 - PLAINTEXT_V2_COLLABORATION_NAMESPACE = collaboration-optimize - 업스트림 예약 이름 가정이 문서화되지 않았다고 본문이 인정한다. 네이티브가 바꾸면 조용히 깨진다.
경로/심볼 - preparePlaintextV2AgentMessages - 요청/응답 양방향 rename. continuation 저장 경로에서 원본 복원이 빠지면 다음 턴이 오염된다.
경로/심볼 - src/types/config.ts / src/config.ts - 플래그 추가. split 기차가 있으면 그 뒤에 맞추고, split에 무효화되면 close-don't-rebase.
경로/심볼 - 테스트 무게 - unit/server/ws 회귀는 있으나 hosted lane=all 최종 head만 증거가 된다고 본문이 스스로 제한한다.

메인테이너의 판단이 필요한 지점

너의 추천
mergeable이어도 우선순위는 낮다. 보안·계약 리뷰와 hosted CI 최종 head 전에는 ready로 올리지 말고, types/config split과 겹치면 리베이스 비용이 크면 닫고 플래그만 다시 내는 쪽을 추천한다. 기본값은 반드시 false 유지.

이 댓글은 grok-bot이 작성했습니다

lidge-jun and others added 10 commits September 12, 2026 22:18
Document reasoningEffortMode in all seven translated guides. Keep the original Chat-wire regression; Responses summary is not a Chat request field.
Resolve structure/ doc conflicts by keeping both the combos reasoning-preservation notes and the dev service_tier echo contract.
Keep both the Console upload-rejection exclusion note and the inherited responses-transport contract paragraphs.
Keep both the raw-reasoning presentation note and the combo effort-normalization note in the Cursor provider doc.
All conflicts were add/add doc paragraphs from the hint and thinking lanes at the same anchor; both notes are retained.
Add/add doc conflicts keep both the Spark Lite metadata note and the inherited transport-hint and summary contracts.
Brings origin/dev and the five lower lane branches (models-reasoning,
stream-console, thinking, thinking-hints, thinking-spark) onto the stack tip.

Conflict resolutions in src/server/responses/core.ts:
- imports and adapter-request state keep both the plaintext-V2 alias tracking
  and dev's Meta Muse tool-name aliases; they are independent features.
- the alias refresher keeps this branch's renamed refreshRequestToolAliases
  (every call site outside the conflict already uses it) and also refreshes
  routedMuseToolNameAliases.
- the recovery rebuild keeps stream-console's console-go-upload-retry guard so
  that retry does not rebuild the request, with the renamed refresher call.
- route normalization keeps both the plaintext-V2 preparation and the provider
  summary recompute.

Doc and layout conflicts were add/add paragraphs or map entries from the
separate lanes; both sides are retained and the layout maps stay sorted.
@github-actions

github-actions Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed.

Hygiene

Deterministic PR hygiene checks passed.

Keeps both the plaintext-V2 scoping note and the new standalone audio transcription section in structure/data-planes/inbound-compat.md.
@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer integration record — responses lane tip, merged by @lidge-jun.

This is the tip of the cumulative responses stack, so merging it with a merge commit lands the whole lane and lets GitHub close each link with the correct MERGED status: #4346 (combos reasoning normalization), #4354 (Console upload retry), #4345 (raw content and provider summary provenance), #4355 (client transport hint suppression), #4359 (Spark Lite metadata alignment), and #4351 (opt-in plaintext V2 agent messages).

  • Exact head at integration: 1a76f7521.
  • CI evidence: Cross-platform CI run https://github.com/lidge-jun/opencodex/actions/runs/34731833926ci aggregate, gates, Linux shards 1-4 and both macOS shards all pass on this head.
  • Ancestry verified: every link's current remote head is an ancestor of this tip, checked with git merge-base --is-ancestor, which is what lets the five links close as merged rather than being closed by hand.
  • Non-tip links carried [skip ci] by design. Tip-only CI for this batch is an explicit repository-owner decision; MAINTAINERS.md otherwise requires a per-PR check, so this is a recorded deviation rather than something the maintainer-integration clause grants. The stack being cumulative is what makes this run cover the links beneath it.
  • enforce-target reports missing UI screenshot because the cumulative tip carries a GUI change (gui/src/pages/Logs.tsx). By owner decision the screenshots for this batch are collected into a single follow-up pull request alongside the regression audit, so this gate is not a merge blocker here.
  • Review state: no outstanding maintainer change requests.
  • Security review: not applicable — no authentication, credential, OAuth, workflow, release-automation, or dependency-installation surface.
  • Local verification on the lane: typecheck, structure:check, privacy:scan passed; focused tests passed per link. No local full-suite run was used as evidence.

@lidge-jun
lidge-jun marked this pull request as ready for review September 13, 2026 02:19
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 13, 2026 02:19
@lidge-jun
lidge-jun merged commit 17da84f into dev Sep 13, 2026
31 of 33 checks passed
@lidge-jun
lidge-jun deleted the codex/260912-60plus-v2 branch September 13, 2026 02:19
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-13T02:21:01.428206Z 1a76f75 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

lidge-jun added a commit that referenced this pull request Sep 13, 2026
Keep current origin/dev subagent/V2 contracts and retain the quota-history publication identity pointer.
lidge-jun added a commit that referenced this pull request Sep 13, 2026
Keep current origin/dev V2/thinking contracts and retain bounded quota-observation pointers.
lidge-jun added a commit that referenced this pull request Sep 13, 2026
lidge-jun added a commit that referenced this pull request Sep 13, 2026
Keep current origin/dev V2/thinking contracts and retain plan-exclusion coverage.
lidge-jun added a commit that referenced this pull request Sep 13, 2026
Keep current origin/dev V2/thinking contracts and retain reset-first ordering.
lidge-jun added a commit that referenced this pull request Sep 13, 2026
lidge-jun added a commit that referenced this pull request Sep 13, 2026
Keep current origin/dev V2/thinking/stream contracts, retain usage incomplete-history disclosure, and keep the GUI screenshots already attached for #4357.
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.

2 participants