Skip to content

fix(command-code): preserve conversation affinity across recovery - #3692

Merged
lidge-jun merged 7 commits into
devfrom
codex/a-04-affinity
Sep 5, 2026
Merged

fix(command-code): preserve conversation affinity across recovery#3692
lidge-jun merged 7 commits into
devfrom
codex/a-04-affinity

Conversation

@lidge-jun

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

Copy link
Copy Markdown
Owner

Summary

Command Code requests now retain opaque conversation affinity: client thread, then replay identity, then a cache key only when explicitly classified as conversation-specific. Shared/unknown cohorts retain random fallback. The API-key commandcode transport separately enables its existing prompt-cache-key support.

Carries #3581 with original contributor commits and author metadata retained. Additional regressions cover the exact boundary cases described in the source change. Depends on #3708; review this layer's diff only. Foundation #3708 supplies separately reviewed replay-fixture and bounded Unix cleanup corrections.

Remaining stack (merge bottom-up): #3708#3692#3694. Earlier A layers #3683, #3686 and #3690 are on dev.

Verification

  • Independent implementation/security and final regression reviews passed.
  • Feature-focused remote checks passed before the final foundation refresh, including explicit negative controls. No local suite/typecheck/build executed.
  • Current head: d0029c50475c965467e63a76a08cf9b67a65a2e9. Full current-head CI: https://github.com/lidge-jun/opencodex/actions/runs/33986932003 . Fresh gates must pass before owner-authorized admin merge.
  • Integrated final-tree remote validation is running. Earlier failed controls remain diagnosis evidence, not green claims.

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: SB Yoon 44089734+yansigit@users.noreply.github.com

Final foundation refresh: current head bc1e7e113e8720511dc7c06768f78b6a30addec7, full current-head CI https://github.com/lidge-jun/opencodex/actions/runs/33988433813 . Includes the tested direct-management watchdog correction in #3708; feature production code is unchanged by this final refresh.

@coderabbitai

coderabbitai Bot commented Sep 5, 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

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 56 / 80

이 PR은 Command Code 요청이 매 턴 random session id를 받지 않고 conversation affinity를 유지하게 합니다. 원본 #3581(SB Yoon) carry입니다. 우선순위는 client thread identity → reasoning-replay identity → (integration이 conversation-specific으로 분류한) prompt-cache key이고, shared/unknown cohort는 random fallback입니다. API-key commandcode provider는 기존 Chat prompt-cache-key capability를 켭니다. base는 #3690(codex/a-03-recovery)이라 A 런타임 스택 4층입니다. 지금 dev HEAD(9115b179a)에는 이 층이 아직 없고, 단독 ff 머지도 안 됩니다.

공유 prompt-cache cohort를 session affinity에 쓰면 서로 다른 대화가 같은 upstream worker에 붙습니다. _promptCacheKeyIsSharedCohort === false일 때만 cache key를 쓰는 가드가 그 위험을 막습니다. recovery 필드 목록에 cohort 보존이 남는지도 회귀로 잠급니다. 부모 층의 final-answer termination binding은 유지한다고 합니다. 공개 adapter 문서는 두 transport 계약을 설명하되 cache 절약을 약속하지 않습니다. types/config 분할과 무관합니다.

Command Code는 대화 연속성이 제품 체감의 전부입니다. 매 턴 세션이 갈리면 도구·컨텍스트가 끊긴 것처럼 보입니다. A 스택에서 recovery(#3690) 다음에 affinity를 넣는 순서도 맞습니다. draft이고 아래층 CI·Windows verifier(#3696)가 남아 있습니다.

src/adapters/command-code.ts - shared cohort는 affinity에 쓰지 않는다는 주석과 promptCacheKeyIsSharedCohort === false 가드가 핵심입니다.

src/types/request.ts _promptCacheKeyIsSharedCohort - 요청에 cohort 분류를 실어 recovery reparse까지 전달합니다.

경로 src/providers/registry.ts commandcode promptCacheKey: true - API-key 경로 capability를 명시합니다.

경로 테스트 whitespace/blank replay/identity-kind - cache key trim·빈 키 fallback·true/false/undefined 분류를 잠급니다.

경로 원본 #3581 - 랜딩 후 rebase 말고 landed 닫기.

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

  • shared cohort 기본을 true/undefined 중 무엇으로 문서화할지
  • A 스택 5층 #3694와 함께 검증할지 이 층만 먼저 볼지
  • recovery helper에 cohort 필드를 필수 목록으로 고정할지

너의 추천
#3690 안착 후 이 층 CI·draft 해제·머지. #3581은 landed 닫기. 단독 dev 머지 금지.

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

@lidge-jun
lidge-jun changed the base branch from codex/a-03-recovery to dev September 5, 2026 18:31
@lidge-jun
lidge-jun changed the base branch from dev to codex/a-07-macos-verification September 5, 2026 19:22
lidge-jun added a commit that referenced this pull request Sep 5, 2026
Owner-authorized admin integration of the independently reviewed A stack through #3716.

Exact head: 5097e66. All 24 actual full cross-platform producers succeeded in https://github.com/lidge-jun/opencodex/actions/runs/33991642514. Any queued aggregation-only job is accepted only after directly checking its exact allowlist. No pending or failed functional producer of this integration candidate is waived.

Carries #3708 bounded Unix probe cleanup and deterministic verification, #3692 Command Code conversation affinity (source #3581), and #3694 effective provider capability evaluation (source #3671). Earlier failing foundation jobs remain recorded and are superseded by this fully tested descendant. All lower-layer and contributor commits remain ancestors; original author identities are preserved. After dev ancestry verification, originals and superseded review PRs are closed with the actual landing evidence. Related #3661 remains open.

Co-authored-by: SB Yoon <44089734+yansigit@users.noreply.github.com>
Co-authored-by: Hako <25837994+devswha@users.noreply.github.com>
Base automatically changed from codex/a-07-macos-verification to dev September 5, 2026 21:45
@lidge-jun
lidge-jun merged commit b59a34c into dev Sep 5, 2026
42 of 54 checks passed
@lidge-jun
lidge-jun deleted the codex/a-04-affinity branch September 5, 2026 21:45
@lidge-jun

Copy link
Copy Markdown
Owner Author

Integrated as part of the reviewed stack through #3716, dev merge a2f69c8aa60976345740ae6f3d2301f89297328e. This layer's exact head bc1e7e113e8720511dc7c06768f78b6a30addec7 is an ancestor of dev. The final descendant passed all 24 actual cross-platform CI producers: https://github.com/lidge-jun/opencodex/actions/runs/33991642514. Historical CI remains recorded; the actual integration candidate is #3716.

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