Skip to content

fix(kiro): accept Codex parallel tool permission - #2309

Merged
lidge-jun merged 3 commits into
devfrom
ingw/fix-kiro-parallel-hint-2308
Aug 22, 2026
Merged

fix(kiro): accept Codex parallel tool permission#2309
lidge-jun merged 3 commits into
devfrom
ingw/fix-kiro-parallel-hint-2308

Conversation

@Ingwannu

@Ingwannu Ingwannu commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • accept Codex parallel_tool_calls: true as a permissive client hint instead of rejecting the Kiro request
  • keep Kiro serialized: do not advertise parallel-tool capability and do not emit a parallel-control field on the CodeWhisperer wire
  • add a real parsed Codex request regression and document the adapter boundary

Fixes #2308

Validation

  • bun test tests/kiro-adapter.test.ts: 55 passed, 0 failed
  • affected Kiro/GUI/provider/pacing rerun: 127 passed, 0 failed
  • typecheck: passed
  • privacy scan: passed
  • docs-site build: 393 pages built

The repository-wide monolithic run also exercised the patch broadly, but produced unrelated environment/flaky failures (missing isolated GUI dependencies before they were linked and one request-pacing timing miss). Those exact files passed on the clean rerun above.

Exact-head CI is green. The PR is ready for independent maintainer review and remains unmerged until that approval.

Review readiness checklist

  • All CI tests are green on my local testing.
  • I pushed my PR to the latest dev commit.
  • I resolved all correct Codex and CodeRabbit findings.
  • My PR is ready for review.

Summary by CodeRabbit

  • Bug Fixes

    • Kiro requests with parallel tool calls enabled are now accepted instead of being rejected.
    • Tool execution remains serialized, preserving existing Kiro behavior.
  • Documentation

    • Clarified how Kiro handles parallel tool-call settings and its unsupported parallel execution capability.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0945d137-1852-49d6-b367-48a819b7e897

📥 Commits

Reviewing files that changed from the base of the PR and between db040e7 and 1d5d935.

📒 Files selected for processing (1)
  • structure/04_transports-and-sidecars.md

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

Kiro now accepts parallel_tool_calls: true as a client permission hint. It continues to advertise unsupported parallel tools, serialize tool execution, omit parallel-control fields upstream, and preserve translated tools.

Changes

Kiro parallel-tool hint handling

Layer / File(s) Summary
Accept and validate the parallel-tool hint
src/adapters/kiro.ts, tests/kiro-adapter.test.ts, docs-site/src/content/docs/reference/adapters.md, structure/04-transports-and-sidecars.md
Kiro no longer rejects parallelToolCalls: true. Regression coverage confirms that the translated tool remains in the Kiro context while parallel-tool fields are absent from the serialized payload and nested conversation state. Documentation records the serialized execution behavior and unsupported capability reporting.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 1d5d9

The change is localized to accepting a client hint while preserving serialized behavior, and the reported tests and checks pass; no actionable merge-blocking risk remains beyond normal review.

Suggested reviewers: lidge-jun

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the Kiro change: accepting Codex parallel-tool permission.
Linked Issues check ✅ Passed The changes satisfy issue #2308 by accepting parallelToolCalls, preserving tools and serialized execution, omitting parallel fields, and retaining other validations.
Out of Scope Changes check ✅ Passed The adapter, tests, and documentation changes directly support issue #2308 and do not introduce unrelated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ingw/fix-kiro-parallel-hint-2308

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 Aug 21, 2026
@Ingwannu
Ingwannu requested a review from lidge-jun August 21, 2026 18:09
@Ingwannu

Copy link
Copy Markdown
Owner Author

Exact-head CI is fully green on db040e70fe52a223c8d6e63bbc87a508f2ee7ae0: Cross-platform CI, macOS, all Linux shards, React Doctor, hygiene, and enforce-target completed successfully. The PR remains Draft pending independent maintainer approval. @lidge-jun, please review the Kiro capability-boundary change before merge.

@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 70 / 80

지금 dev HEAD 401c24f74. #2306 vision routed sidecar 들어옴. 이 PR은 그 위. base dev. HEAD db040e70f. 드래프트. 커밋 1. 파일 4. gh api pulls/2309/files: src/adapters/kiro.ts +0/-3, tests/kiro-adapter.test.ts +43/-1, docs-site/src/content/docs/reference/adapters.md +4, structure/04_transports-and-sidecars.md +16. types.ts/config.ts 안 만짐. #2306이 src/types/config.ts OcxVisionSidecarConfig.backend"routed" 넣은 거랑 레인 다름. 스플릿 안 씹힘. Fixes #2308. 핫패스임.

핵심. 현재 dev src/adapters/kiro.ts:321-323 if (parsed.options.parallelToolCalls === true) throw new Error("Kiro does not support parallel tool calls"). :428-439 buildKiroPayload가 그걸 먼저 탐. :1866 buildRequest. 업스트림 없음. 로컬 400. 패치가 그 세 줄만 지움. tool_choice auto/none, serviceTier 금지, structured output 금지는 남음. 맞음. 카탈로그는 그대로 false. src/codex/catalog/parsing.ts:545 supports_parallel_tool_calls = isCursorEntry || parallelToolCalls === true. src/providers/registry.ts:1199-1215 kiro 엔트리에 parallelToolCalls 없음. Codex가 힌트를 보내도 와이어에 병렬 필드가 원래 없음. kiro.ts에서 parallel은 그 throw뿐. 지워도 CodeWhisperer 페이로드는 안 변함.

테스트. 기존 루프에서 parallelToolCalls: true 케이스를 뺌. 새 케이스 accepts Codex's permissive parallel-tool hint while keeping the Kiro wire serialized. src/responses/parser.ts parseRequest로 리포터 바디를 넣음. model: kiro/claude-haiku-4.5, parallel_tool_calls: true, function bash. parsed.options.parallelToolCalls === true를 유지. 번역된 userInputMessageContext.tools에 bash가 남음. 페이로드/conversationState/context에 parallel_tool_calls/parallelToolCalls 없음. 공유 파서를 쓰는 게 맞음. 핸드메이드 options만 넣으면 파서 회귀를 못 잠금. 55 focused kiro + 127 인접 + typecheck + privacy:scan. 구조 문서 Decision Log가 reject/rewrite/accept 중 accept를 고름. rewrite는 호출자 의도를 숨김. reject는 지금 400. 그 판단 맞음.

구멍. (1) 카탈로그를 true로 올리지 말 것. 올리면 Codex가 진짜 병렬 배치를 기대함. Kiro는 직렬. (2) tool_choice: required는 계속 throw. Codex가 그걸 같이 보내면 다른 400. 이 이슈 범위 아님. (3) 기존 테스트가 options: { parallelToolCalls: true }로 buildRequest를 때리던 길을 없앰. 새 케이스가 parseRequest 경로만 잠금. 핸드 옵션 경로도 동일 함수라 충분함. (4) src 1파일 3줄 삭제. 좋음.

types.ts/config.ts 안 만짐. 스플릿 안 씹힘. 리베이스하지 말고 닫으라는 케이스 아님. 닫을 중복 아님. #2308의 픽스 PR임. #2308은 이 PR 머지 전에 닫지 말 것. #1650이랑 합치지 말 것. #2188 L1–L9 사이드카 + routed vision(#2306) 이미 dev. x_search 넣지 말 것. Grok OAuth Chat 기본(#2255)/GUI 옵트인 Responses(#2266)/#2283이랑 다른 레인임. 프리뷰 배포 아님. #2292/#2293 윈도우 피커랑 안 겹침. 카탈로그는 Ox Alpha x-preview-f-free + deepseek-v4-flash-vision-exp. v2.29.0 태그됨. v2.30.0-preview.20260821 있음. 비전공자 유지. Codex 0.149 Kiro 툴 턴 400 픽스라 70. 드래프트. 체크리스트 채우고 언드래프트.

해결방안: 이 패치로 가라. throw 삭제만. 카탈로그 비트와 Kiro 와이어는 손대지 말 것. tool_choice/serviceTier/text 가드 유지. 헤드 401c24f74에 리베이스. 체크리스트 채우고 draft 해제. #2308은 머지 후 close. 라벨 건드리지 말 것. 스플릿이 kiro.ts를 옮기면 리베이스하지 말고 닫고 다시 짜라. 지금은 그 정도 아님.

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

@Ingwannu
Ingwannu marked this pull request as ready for review August 21, 2026 18:57
@yrlan-montagnier

Copy link
Copy Markdown

Thanks for the fast turnaround on this.

The adapter change and the removed validation-loop entry match what I had locally. The regression test here is stronger: explicitly asserting the absence of any parallel_tool_calls / parallelToolCalls field at every payload level (six toBeUndefined()) is a tighter wire contract than just checking the request succeeds and tools are translated.

For reference, the fix I was running locally before this PR was narrower:

 function validateKiroCapabilities(parsed: OcxParsedRequest): void {
   const choice = parsed.options.toolChoice;
   if (choice !== undefined && choice !== "auto" && choice !== "none") {
     throw new Error("Kiro supports only automatic tool choice or tool_choice:none");
   }
-  if (parsed.options.parallelToolCalls === true) {
-    throw new Error("Kiro does not support parallel tool calls");
-  }
+  // Responses defines parallel_tool_calls as permission, not a requirement. Kiro's wire has no
+  // corresponding request field and remains serialized, so clients may safely send `true` here.
   if (parsed.options.serviceTier !== undefined) {

Same deletion, inline comment instead of the architecture-doc section + decision log. Your version is cleaner — the adapter stays comment-free and the reasoning lives where maintainers actually look for contract decisions.

One additional data point from our investigation: upstream Codex commit openai/codex@86b1123 went further by removing supports_parallel_tool_calls from ModelInfo entirely and hardcoding parallel_tool_calls: true for all non-Responses-Lite prompts — so even catalog rows that advertise false will always carry the permissive hint from any Codex build at or after that commit.

Applied this PR's exact changes locally (all four files), focused tests pass (55/0, 263 expects), and confirmed the fix works end-to-end with Codex CLI 0.149.0 against a live Kiro endpoint — tool turns stream normally with no regression.

@Ingwannu

Copy link
Copy Markdown
Owner Author

Exact-head CI remains fully green on db040e70fe52a223c8d6e63bbc87a508f2ee7ae0, the reporter has confirmed that the adapter change matches the observed Kiro behavior, and there are no unresolved review threads. I have formally requested an independent review from @lidge-jun; as the author, I will not self-approve or self-merge.

@Ingwannu

Ingwannu commented Aug 21, 2026

Copy link
Copy Markdown
Owner Author

Updated onto the current dev tip 69907dd (including #2312) at exact head 1d5d935. The merge was conflict-free. The Grok-reviewed scope is unchanged: remove only the local rejection of the permissive parallel_tool_calls hint; do not advertise parallel capability and do not add a Kiro wire field. Exact-head verification passed 55/55 Kiro tests, typecheck, privacy scan, diff check, and the 393-page docs build. Fresh CI is running. This remains pending independent maintainer approval; I will not self-approve or self-merge.

@Ingwannu

Copy link
Copy Markdown
Owner Author

Exact-head CI is fully green on 1d5d935 after the current-dev update, including Cross-platform CI, macOS, all Linux shards, npm-global smokes, React Doctor, hygiene, privacy/type gates, and target enforcement. There are no unresolved review threads. @lidge-jun @Wibias, this remains ready for independent review; I will not self-approve or self-merge.

@lidge-jun
lidge-jun merged commit b96af22 into dev Aug 22, 2026
27 checks passed
@lidge-jun
lidge-jun deleted the ingw/fix-kiro-parallel-hint-2308 branch August 22, 2026 09:30
luvs01 pushed a commit to luvs01/opencodex that referenced this pull request Aug 22, 2026
011 records work-phase 1: four green PRs merged (lidge-jun#2309, lidge-jun#2339, lidge-jun#2335, lidge-jun#2313),
lidge-jun#2359 held on a reproduced test failure, a correction to 001 (dev IS protected,
by rulesets rather than classic branch protection), and an honest incident
record of a hard reset that dropped an unpushed commit and how it was recovered.

090 records work-phase 9, the four PRs that arrived mid-loop. lidge-jun#2361 merged;
lidge-jun#2362, lidge-jun#2363 and lidge-jun#2364 left open with their blockers restated. Two of those
verdicts rest on falsification rather than diff reading: lidge-jun#2363's tests still
pass with its real call site deleted, and lidge-jun#2364's second commit deleted the
management validation its first commit added. It also records a CodeRabbit
finding that was dismissed as wrong on the evidence.
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.

3 participants