Repository navigation
fix(kiro): keep Advisor requests cloneable for the retry snapshot - #7981
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Filter callbacks and verify retry behavior src/adapters/kiro/adapter.ts, tests/providers/kiro/kiro-single-final.test.ts, structure/providers/kiro.md |
At adapter.ts:300–303, buildRequest filters function-valued fields before cloning the snapshot. The test at kiro-single-final.test.ts:41–82 checks that the guard stays on the input, two requests occur, the retry body includes the prompt and model, and the final event marks the turn done. The provider documentation at kiro.md:162 describes the filtered snapshot. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested labels: bug
Suggested reviewers: ingwannu
Merge Risk: 
Minimal · up to ad838
-
The reported Advisor retry failure is addressed, with no concrete unresolved merge-blocking defect identified.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Linked Issues check
-
Explanation
Issue
#7974requires Kiro requests to work with Advisor-like function metadata and regression coverage. Insrc/adapters/kiro/adapter.ts,buildRequestcreatesrequestSnapshotfromObject.entries(parsed)after filtering top-level function values. The originalparsedobject remains unchanged, so_advisorGuardremains available for streaming. The completion retry clones the sanitized snapshot infallbackFactoryand rebuilds the request.tests/providers/kiro/kiro-single-final.test.tsaddsadvisor guard survives request building and completion retry. The test supplies an async-generator_advisorGuard, completes request building, verifies the same guard remains on the input, verifies two physical requests, checks retry body content, and verifies a completed final event.structure/providers/kiro.mddocuments the snapshot contract.
Full details: Out of Scope Changes check
-
Explanation
The reviewed changes are limited to the Kiro snapshot implementation in
src/adapters/kiro/adapter.ts, focused regression coverage intests/providers/kiro/kiro-single-final.test.ts, and the related contract note instructure/providers/kiro.md. Each change supports issue#7974. No unrelated behavior or cleanup is demonstrated by the supplied evidence.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Comment @coderabbitai help to get the list of available commands.
|
✅ Deterministic PR hygiene checks passed. |
|
Maintainer integration into
|
Summary
With Advisor enabled, every Kiro request failed with
invalid_request_error: The object can not be cloned.(#7974). Advisor attaches a function-valued guard to the parsed request (parsed._advisorGuard), and the Kiro adapter took its completion-retry snapshot withstructuredClone(parsed), which throwsDataCloneErroron functions.The snapshot now copies the request without top-level function values, while the original request keeps its guard so streaming delivery still applies it. The completion retry rebuilds from the snapshot as before. No other adapter clones the parsed request this way.
structure/providers/kiro.mdrecords the snapshot contract.Closes #7974
Verification
Bun 1.4.4; focused because the shared host is under load (AGENTS.md resource exception; breadth left to PR CI).
bun test tests/providers/kiro/kiro-single-final.test.ts -t 'advisor guard survives request building and completion retry'→ 0 pass / 1 fail,DataCloneError: The object can not be cloned.frombuildRequest'sstructuredClone.bun test tests/providers/kiro/kiro-single-final.test.ts tests/providers/kiro/kiro-adapter.test.ts tests/providers/kiro/kiro-completion-with-real-tools.test.ts tests/providers/kiro/kiro-fallback-error-body.test.ts→ 141 pass / 0 fail.bun run typecheck(2,243 files, 0 errors) andbun run structure:checkpass.bun run test:changedand the full suite (host at critical load); PR CItest changedcovers them.Checklist
Summary by CodeRabbit