Skip to content

fix(kiro): coalesce adjacent outputs without losing tool identity - #3750

Merged
lidge-jun merged 5 commits into
devfrom
codex/release-244-kiro-results-07c0
Sep 6, 2026
Merged

fix(kiro): coalesce adjacent outputs without losing tool identity#3750
lidge-jun merged 5 commits into
devfrom
codex/release-244-kiro-results-07c0

Conversation

@lidge-jun

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

Copy link
Copy Markdown
Owner

Summary

Co-authored-by: Yrlan 71253160+yrlan-montagnier@users.noreply.github.com

Verification

  • Independent xai/grok-4.6 plan, adapter-source, regression and fresh final reviews passed. Exact-head hosted CI: https://github.com/lidge-jun/opencodex/actions/runs/34017511752 at 36d1e55; Linux four shards, macOS two shards and gates verified before integration.
  • Regression matrix covers original code-mode outputs, raw-ID collisions, message barriers, images, errors, empty/failed wrappers and unchanged original messages; existing orphan/encrypted/catalog tests remain.
  • No local tests, typecheck or build were run. Saved local Kiro/OCX metadata did not contain a current multi-output trace; synthetic hosted fixtures provide regression evidence, and no live Kiro request is made because quota is unavailable.

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 integration: repository owner authorized admin integration without a second approval. Original ID equality, encrypted-content rejection and wire-only output were independently reviewed.

t and others added 4 commits September 6, 2026 14:21
@coderabbitai

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

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Sep 6, 2026
Base automatically changed from codex/release-244-task-input-07c0 to dev September 6, 2026 06:25
@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 76 / 80

이 PR은 Codex code-mode execnotify() 여러 번 + 최종 text()를 낼 때 생기는 같은 call_id의 인접 custom_tool_call_output 여러 개를, Kiro 어댑터가 결과마다 하나씩 보내다 두 번째부터 Kiro tool result has no matching tool use로 죽던 문제(#3734)를 고칩니다. 베이스는 dev, HEAD와 같은 00d0cc140(패키지 2.44.0)이고, 부모 #3743 task-input은 이미 머지되어 있습니다. 브랜치 codex/release-244-kiro-results-07c0는 release-244의 **다음 칸 030_kiro_results**와 이름이 같고, 본문도 #3743 위에 얹고 #3734를 닫는다고 적습니다. draft이며 mergeable_state는 blocked(대개 draft 게이트)입니다.

지금 HEAD src/adapters/kiro.tsbuildKiroPayloadpriorCalls에 wireName만 넣고, 각 toolResult마다 pushUser로 별도 Kiro toolResult를 붙입니다. normalizeToolId로만 매칭하고 raw id는 보관하지 않습니다. wire 검증은 tool use당 결과 하나라서, 인접 다중 출력이 그대로 실패합니다. 이 PR은 (1) priorCallsrawId를 같이 두고 결과의 tr.toolCallId정확히 같을 때만 인정하고, (2) 원본 메시지 루프에서 인접 같은 raw id만 한 wire result로 합치며, (3) user/developer/assistant(reasoning-only 포함)나 다른 id가 나오면 그룹을 끝냅니다. 다중 그룹은 의미 있는 raw 텍스트·공백·failed-exec 래퍼를 순서대로 남기고, empty-success 래퍼 보일러는 빼며, 이미지·sticky error를 유지합니다. 단건은 기존 normalizeEmptyExecToolResultText 결과를 그대로 둡니다. bookkeeping 필드는 wire 객체에 안 올라갑니다.

테스트 tests/providers/kiro/kiro-adapter.test.ts에 부모 task-input + notify/notify/final, 직접 Ocx 3결과, 이미지/에러, empty→text, 공백 보존, empty/failed wrapper, A/B/A, barrier, encrypted 선거부, raw 충돌(pipe/공백/truncation/case)이 들어 있습니다. 문서 docs-site/.../reference/adapters.mdstructure/04_transports-and-sidecars.md, plan 030/031도 계약을 맞춥니다. Yrlan Co-authored-by가 있습니다. 본문은 로컬 테스트/타입체크/빌드 미실행·라이브 Kiro 없음을 명시했고, 이는 트레인 non-goal(라이브 Kiro 금지)과 맞습니다. types/config 대분할과 무관합니다.

우선순위 76인 이유다. #3743 다음 필수 칸이고 #3734를 닫으며, 범위가 kiro.ts+기존 테스트 파일+문서에 묶여 있습니다. raw identity·adjacency·단건 정규화 유지는 plan의 C4 요구와 잘 맞습니다. 남은 리스크는 draft·호스트 CI 미확인(본문: exact-head CI pending)·라이브 미검증뿐이고, 합성 픽스처 밀도는 충분해 보입니다. #3734 이슈 리뷰에서 요청한 “focused PR + 원본 시퀀스 adjacency + 문서 노트”를 이 PR이 충족합니다.

경로/심볼 - src/adapters/kiro.ts priorCalls - { wireName, rawId }로 확장. wire 정규화 충돌 시 orphan
경로/심볼 - adjacentResult / finishAdjacentResult - 인접 같은 raw id만 coalesce. non-toolResult에서 리셋
경로/심볼 - call.rawId !== tr.toolCallId - 교체/절단/대소문자 위장 병합 거부
경로 - tests/providers/kiro/kiro-adapter.test.ts adjacent Kiro result coalescing (#3734) - 회귀 매트릭스
경로 - docs-site/.../adapters.md / structure/04_transports-and-sidecars.md - 계약 문서화
경로/심볼 - 이슈 #3734 / 부모 #3743(머지됨) / plan 030_kiro_results.md
경로/심볼 - 라이브 Kiro - 의도적 미실행(non-goal). 증거는 합성 CI+리뷰

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

  • draft를 Ready로 올리고 exact-head CI만 보면 머지할지(권장), 아니면 추가 워커 리뷰를 기다릴지
  • 라이브 Kiro 스모크를 이 레이어에서 절대 하지 않을지(트레인 non-goal과 일치 — 하지 말 것)
  • 머지 후 #3734 close와 다음 opaque-recovery(040) 스택 타이밍
  • PR 3751(문서 포맷)을 이 PR 위 레이어로 같이 둘지, kiro-results만 먼저 머지할지

너의 추천
Ready 전환 후 exact-head CI 초록이면 dev에 머지하세요. release-244 다음 칸이고 #3734를 닫습니다. 라이브 Kiro는 돌리지 마세요. types/config close-don't-rebase 아님. 머지 후 원본 #3734는 landed 처리. 문서 포맷만인 #3751은 런타임을 막지 않으니 이 PR보다 우선하지 마세요.

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

@lidge-jun
lidge-jun changed the base branch from dev to codex/release-244-deadline-fixture-07c0 September 6, 2026 06:49
Base automatically changed from codex/release-244-deadline-fixture-07c0 to dev September 6, 2026 06:55
@lidge-jun
lidge-jun marked this pull request as ready for review September 6, 2026 07:00
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 6, 2026 07:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

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-06T07:02:05.823060Z 36d1e55 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
lidge-jun merged commit c5ccd5d into dev Sep 6, 2026
37 of 55 checks passed
@lidge-jun
lidge-jun deleted the codex/release-244-kiro-results-07c0 branch September 6, 2026 07:00
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