Skip to content

fix(subagents): recognize Responses Lite plaintext V2 catalogs - #5492

Closed
luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:fix/v2-additional-tools-plaintext
Closed

luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:fix/v2-additional-tools-plaintext

Conversation

@luvs01

@luvs01 luvs01 commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Codex 0.155.0-alpha.9.2 sends native ChatGPT parent requests with no top-level tools; its default collaboration catalog is the first developer additional_tools input item. With V2 and plaintextV2AgentMessages: true, these parents skipped plaintext preparation, so an external-model worker failed with unreadable_encrypted_agent_task.
  • Recognize that precise Responses Lite catalog form when top-level tools is absent. Explicit top-level catalogs retain precedence; user-role or later historical catalogs do not activate rewriting. Existing opt-in, canonical destination, collision detection, ciphertext and response-restoration boundaries remain unchanged.
  • Add route-policy and real server-boundary regressions, and synchronize the contract plus English/Chinese configuration documentation. The running installed package is unchanged.

Verification

  • New regression failed before the source fix, then the complete plaintext V2 unit/adapter file passed: 43 tests, 184 assertions. The new Responses Lite server-boundary case passed: 1 test, 7 assertions.
  • bun run typecheck, bun run structure:check, bun run privacy:scan, and git diff --check passed.
  • An ephemeral real Codex CLI through a loopback diagnostic forwarder reproduced the missing top-level catalog and worker refusal. Normalizing only that catalog representation produced successful OpenAI → Gemini delegation, follow-up marker retention, and Gemini → OpenAI delegation (CROSS-81, 42, REVERSE-44). This tests the transport diagnosis; it is not a claim that the installed proxy contains this patch.
  • Documentation CI installed the docs dependencies and built the site successfully at exact head 2095ba1c0689d359c969b1eb6696e77a6301b25e. The redundant local dependency install was stopped and its partial staging was removed.
  • All four Linux test shards in the same exact-head CI run passed. Other platform jobs remain pending.
  • Import-connected Windows bun run test:changed reached its 900-second limit (exit 124), with fixture cleanup EBUSY and timeout failures, including the unchanged WS plaintext-restoration overflow case at its five-second deadline. The new catalog-policy regression passed within that run. The suite and its four owned workers were confirmed exited. This draft does not claim a complete Windows or cross-platform suite pass.

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. Maintainer review of the plaintext opt-in boundary is requested before integration.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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 bug Something isn't working label Sep 22, 2026
@luvs01
luvs01 requested a review from Ingwannu September 22, 2026 06:10
@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 57 / 80

이 PR은 Codex가 보내는 새 형태의 요청을 opencodex가 알아보게 고칩니다. 요즘 Codex(0.155.0-alpha.9.2)는 부모 요청에 맨 위 tools를 안 넣고, 대신 맨 앞 developer additional_tools 안에 collaboration 목록을 둡니다. plaintextV2AgentMessages가 켜져 있어도 예전 코드는 맨 위 tools만 보고 “목록 없음”으로 넘겨, 암호화 메시지를 그대로 외부 모델 워커에 보냈고 unreadable_encrypted_agent_task로 실패했습니다. 이번 변경은 맨 위 tools가 아예 없을 때만, 첫 입력 항목이 developer additional_tools이고 그 안에 v2 collaboration이 있으면 평문 준비 대상으로 인정합니다. 맨 위 tools가 있으면 예전처럼 그것만 보고, user 역할이나 뒤에 나오는 목록은 켜지 않습니다. 영문·중문 설정 문서와 structure/subagents.md도 같은 말로 맞춰 두었고, 단위·서버 경계 회귀 테스트가 들어갔습니다. 베이스는 dev입니다. 범위는 작고, 설치 패키지 동작 선언은 건드리지 않았습니다.

hasPlaintextV2CollaborationCatalog - tools가 null이거나 빈 배열이면 Lite 경로로 넘어가지 않습니다. 테스트도 그렇게 막았습니다. 실제 Codex는 필드를 빼는 쪽이라 맞지만, 클라이언트가 tools: null을 보내면 여전히 평문 준비가 안 됩니다.
docs-site/.../zh-cn/.../agents.md - “只识别顶层”이라는 옛 표현이 남아 있고, 바로 아래에서 additional_tools도 된다고 이어집니다. 뜻은 伝わ지만 앞뒤가 살짝 어긋납니다.
PR 본문 - draft이고 전체 CI·test:changed가 아직 끝난 상태로 적혀 있지 않습니다. 문서 CI만 head에서 통과한 상태입니다.

메인테이너의 판단이 필요한 지점
작성자가 적은 대로, 평문 옵트인 경계(plaintextV2AgentMessages + canonical ChatGPT만)를 이 Lite 목록까지 넓히는 게 의도한 보안·제품 범위인지 한 번만 확인이 필요합니다. 감지 조건을 더 넓히면(예: tools: null도 허용) 오탐 위험이 커지므로, 지금처럼 “필드 없음 + 첫 developer additional_tools만”을 유지할지 결정하면 됩니다.

너의 추천
방향은 맞고, base dev도 맞습니다. CI가 초록이 되면 draft를 풀고 합쳐도 됩니다. 중문 문서의 “只识别顶层”만 한 줄 다듬으면 좋겠습니다. types/config 쪼개기나 중복 닫을 PR은 이 변경과 겹치지 않습니다. preview 배포 이야기는 생략합니다.

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

@luvs01

luvs01 commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator Author

Consolidated into #5504 in native Stack #5505.

Source head: 2095ba1c0689d359c969b1eb6696e77a6301b25e. Replacement head: 271fde4a4bd59b9f11b3e781d639d62edef1707f. All 1 unique non-merge source commit(s) were matched to their cherry-picked replacement commits using stable Git patch IDs; attribution and provenance are preserved.

Closing this standalone PR as a duplicate review entry at the author's request. The change is not merged or released: the replacement remains draft, with remaining integration/CI/security-review work tracked there. Original branches are retained. The maintainer-cancelled CI is not treated as a pass.

@luvs01 luvs01 closed this Sep 22, 2026
@luvs01

luvs01 commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator Author

The earlier duplicate-PR closure was premature relative to the explicit coordination condition in #5508: original PR closure follows verified inclusion on dev.

The source head 2095ba1c0689d359c969b1eb6696e77a6301b25e is fully carried in draft #5504 (8ca80420b4da6cedac59738db850e85b48b10829) and draft #5508 (7f3f18aed8887f133b4ff3b1afe38d69795c12b5); the relevant production file is identical between those replacements. That verifies migration, but the change is not yet on current dev a5e8047b5e2b6248b1e85a08dfcc5b1c414c6236.

Reopening this original to honor the more specific dev-inclusion condition. The earlier inclusion evidence remains valid; the closure disposition is superseded. No branch or contribution is removed. Close again only after reading back the landed implementation on dev.

@luvs01 luvs01 reopened this Sep 22, 2026
lidge-jun added a commit that referenced this pull request Sep 22, 2026
…Lite catalogs (#5508)

* fix(responses): bound native steering routes and replay memory

Native steering and injection accepted requests on routes that were never
meant to carry them, and their replay buffers grew without an upper bound,
so a long-lived WebSocket exchange could retain an unbounded amount of
app-owned memory. Restrict steering to the routes that declare it, cap the
replay and body sizes, and release the stores when an exchange settles.
Preexisting negative route tests are retained, and the injection docs now
cross-link the steering contract.

Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(responses): enforce native injection tool authorization

Carry #5470 onto the bounded native-control path. Configure the resolved request-local catalog before attachment, reject undeclared added/done/terminal items before relay, and preserve structured rejection codes. Retain declared rich-result continuations and the existing size and rollback controls.

Local checks: NOT RUN by instruction. Hosted CI remains required.

Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>

* fix(subagents): recognize Responses Lite plaintext V2 catalogs

Carry #5492. Recognize the first developer additional_tools catalog only when top-level tools is absent. Preserve opt-in, canonical destination, explicit catalog precedence, conflict checks and response restoration. Include unit and server-boundary regressions and clarify the Chinese catalog wording.

Local checks: NOT RUN by instruction. Hosted CI remains required.

Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>

* fix(responses): reject oversized injection before enqueueing

Validate the serialized injection before reserving call identities or queue bytes. A result exceeding the configured body limit is refused synchronously even when another result awaits acknowledgement, leaving the retained socket usable for corrected input.

Add a two-call regression on subscription and public API routes covering the typed refusal, unchanged replay retention, first acknowledgement, corrected second result and final cleanup. Preserve immediate refusal and authorization coverage, and align the public and structure contracts.

Independent static review: PASS. Local checks: NOT RUN by instruction; revised-head hosted CI remains required before integration.

Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>

---------

Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@lidge-jun

Copy link
Copy Markdown
Owner

Thank you, @luvs01. This change landed on dev through the consolidation PR #5508 (squash commit 5365429), which carries your commits with a Co-authored-by trailer so the contribution stays attributed to you. Closing this PR as superseded by #5508. If anything from this branch did not make it into the landed version, please point it out and we will pick it up.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants