Skip to content

revert(subagents): drop the synthesized native chain for encrypted spawns (#3239, #3240) - #3242

Merged
lidge-jun merged 2 commits into
devfrom
codex/260902-revert-3239
Sep 2, 2026
Merged

revert(subagents): drop the synthesized native chain for encrypted spawns (#3239, #3240)#3242
lidge-jun merged 2 commits into
devfrom
codex/260902-revert-3239

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

Reverts #3239 (744d12d02) and its follow-up #3240 (7f00d0eee).

#3239 synthesized a DEFAULT_SUBAGENT_MODELS chain for an unreadable encrypted spawn when no chain is configured. That silently reroutes a routed sub-agent to the native ChatGPT backend — spending a stored ChatGPT credential the operator never opted into for that model. tests/agent-task-recovery.test.ts pins the opposite contract: with recovery absent or disabled, an encrypted spawn on a routed model fails fast with a byte-identical 400 unreadable_encrypted_agent_task and zero upstream fetches. On the exact dev tip (b54508c8c, dispatch run 33581824312) that case fails 400→502, and the file was 19/19 at 1c8278b4d, 7/19 at 744d12d02, 18/19 after #3240.

#3240 restored the recovery-enabled path but could not restore the recovery-off contract without removing the feature, so both go. The reporter's case (#3228) needs an opt-in — either a configured subagentModelFallback chain, or agentTaskRecovery.enabled — and that is the documented behaviour, not a bug. Recorded in the devlog for #3228's author.

Verification

Checklist

  • Targets dev
  • Pure revert, no other changes
  • No GUI / docs-site change

jun added 2 commits September 2, 2026 11:07
…odex without a configured chain (#3239)"

This reverts commit 744d12d.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 2, 2026 02:08
@lidge-jun lidge-jun added the bug Something isn't working label Sep 2, 2026
@lidge-jun
lidge-jun merged commit 2cb5921 into dev Sep 2, 2026
6 of 7 checks passed
@lidge-jun
lidge-jun deleted the codex/260902-revert-3239 branch September 2, 2026 02:08
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

lidge-jun added a commit that referenced this pull request Sep 2, 2026
)

The three Cursor identity PRs are on dev. Records each merged head and squash
commit with the ancestry proof, and notes that --admin cleared only the review
requirement - every merged head had zero failing checks.

Also closes R5: the agent-task-recovery red was dev's own, and dev's #3242
(revert of #3239/#3240) fixed it. That file is 19/19 on the landed dev, so the
follow-up fix PR this unit was going to open is unnecessary.

Co-authored-by: jun <jun@lidge.dev>
@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 78 / 80

설명

이 PR은 메인테이너가 직접 올린 순수 revert다. 대상은 #3239 (744d12d02, encrypted V2 스폰에 체인 없을 때 DEFAULT_SUBAGENT_MODELS 자동 합성)과 그 후속 #3240 (7f00d0eee, recovery가 합성 체인보다 먼저 돌게 하려는 가드)다. 디프는 딱 두 파일이다. src/codex/subagent-model-fallback.ts 에서 DEFAULT_SUBAGENT_MODELS import와 configuredFallbackChain === null && nativeFallbackOnly 일 때 네이티브 체인을 만들어 넣던 블록을 지우고, tests/subagent-model-fallback.test.ts 에서 그 합성을 고정하던 테스트 두 건을 함께 지운다. 다른 기능 추가는 없다.

초등학생에게 설명하듯 말하면 이렇다. 어떤 서브에이전트(자식 작업) 페이로드는 암호문(encrypted V2)으로만 온다. 그 암호문은 원래 네이티브 ChatGPT Codex 백엔드가 읽을 수 있게 만들어진 것이다. OpenCodex는 평소에 그 암호문을 직접 풀지 않고, 운영자가 agentTaskRecovery.enabled 를 켠 경우에만 recoverEncryptedAgentTask 로 chatgpt.com 에 되돌려 평문을 받는다. 복구가 꺼져 있거나 없으면, 라우팅된 모델(예: xAI Grok)로 암호문을 보내면 안 되고 즉시 400 unreadable_encrypted_agent_task 로 끝내야 한다. 이 계약은 tests/agent-task-recovery.test.ts 가 'upstream fetch 0회'까지 포함해 고정한다. 실패 응답 본체는 src/server/responses/core.tsunreadableEncryptedAgentTaskResponse (대략 1724–1734행, code unreadable_encrypted_agent_task, status 400)다.

#3239가 한 일은 체인이 비어 있고 nativeFallbackOnly 가 켜진 encrypted 스폰에서 DEFAULT_SUBAGENT_MODELS (gpt-5.5, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.4-mini) 를 몰래 합성해 gpt-5.5 쪽으로 바꾸는 것이었다. 증상(#3228 계열: encrypted 스폰이 400으로 죽는 것)은 진짜였지만, 해결이 '운영자가 그 모델에 ChatGPT 자격증명을 쓰겠다고 명시한 것'이 아니라 '자격증명을 조용히 끌어쓰는 숨은 라우팅'이 되어 버렸다. 호출 순서를 보면 core.ts 는 먼저 applySubagentModelFallback(..., unreadableEncryptedAgentTask, ...) 를 돌리고(대략 2967행 근처), 그 다음에야 recoverEncryptedAgentTask 블록(대략 3013행 근처, !isCanonicalOpenAiForwardProvider(route.provider) 가드)에 들어간다. 합성이 첫 패스에서 이미 네이티브로 바꾸면 recovery의 호출자 인증·proxy-secret·토큰 유효성 게이트가 통째로 스킵된다. #3240은 recovery-on 가드(agentTaskRecovery?.enabled !== true 일 때만 합성)를 넣었지만, recovery-off 계약(즉시 400 + upstream 0)은 합성을 빼지 않고는 복구가 안 됐다. 그래서 둘 다 되돌리는 이 PR이 맞다.

현재 dev HEAD는 7d25f9966 (#3249 Cursor 대시보드 docs)다. 이 revert는 이미 2cb592174 로 tip에 들어가 있다. 지금 checkout의 applySubagentModelFallback (대략 611–615행)은 resolveSubagentFallbackChain 결과가 없으면 바로 null을 돌려보내고, resolveSubagentFallbackChain (대략 638–652행)도 global/configured/TOML 체인이 전부 비면 null이다. 즉 tip 불변식은 다시 '명시된 subagentModelFallback(또는 TOML model_fallback) 혹은 agentTaskRecovery.enabled 옵트인만 encrypted V2를 살린다'로 돌아왔다. PR 본문 검증대로 revert 후 agent-task-recovery / agent-task-recovery-security / subagent-model-fallback 합쳐 92 pass / 0 fail, typecheck·privacy:scan 통과. 원증상 #3228은 closed leftover이며, 올바른 안내도 같은 옵트인 두 갈래다. types.ts/config.ts 스플릿과는 무관하고, 중복 리베이스 대상도 아니다.

라인 src/codex/subagent-model-fallback.ts 611-615 - revert 후 fallbackChain이 없으면 즉시 null. 합성 블록과 DEFAULT_SUBAGENT_MODELS import가 사라져 recovery-off 계약과 다시 맞는다. tip에 이미 반영됨.
라인 src/codex/subagent-model-fallback.ts 638-652 (resolveSubagentFallbackChain) - global subagentModelFallback / per-model configured / TOML model_fallback 중 하나라도 있어야 체인이 생긴다. 빈 설치에서 encrypted 스폰을 살려 주는 비밀 통로가 없다.
라인 src/server/responses/core.ts ~2967 (applySubagentModelFallback 호출) / ~3013 (recoverEncryptedAgentTask) - 순서는 그대로다. 합성이 없어졌으니 첫 폴백 패스가 라우팅 모델을 네이티브로 바꾸지 않고, recovery 옵트인이 켜진 설치만 아래 복호화·보안 게이트로 들어간다.
라인 src/server/responses/core.ts 1724-1734 (unreadableEncryptedAgentTaskResponse) - recovery-off·체인-없음 경로의 공식 실패 응답(400 + unreadable_encrypted_agent_task). #3239 계열이 이 경로를 502/네이티브 소모로 흐리게 만들었던 것을 이 revert가 되돌린다.
경로/심볼 제거된 테스트 두 건 (subagent-model-fallback.test.ts) - encrypted routed spawn gets an automatic native fallback...the synthesized native chain yields to enabled encrypted-task recovery 는 잘못된 합성을 고정하던 케이스라 함께 지운 것이 맞다. 계약 고정은 tests/agent-task-recovery*.test.ts 쪽이 담당한다.

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

너의 추천
이미 올바른 상태다. tip(7d25f9966)에 revert가 반영되어 있으니 추가 머지·리베이스 불필요. 같은 자동 네이티브 합성을 다시 올리지 말 것. 원증상은 문서/이슈에 옵트인 두 갈래로만 안내하고, Codexless admission 구멍은 이미 #3241이 막았다. types/config 스플릿 무관, close-don't-rebase 대상 아님. leftover #3228은 이미 closed로 두면 된다.

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

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.

1 participant