feat: Suggest code review after implementation#6404
Conversation
…g/kilocode into feat/suggest-code-review # Conflicts: # packages/kilo-vscode/src/services/cli-backend/types.ts # packages/kilo-vscode/webview-ui/src/components/chat/ChatView.tsx
…ng context - Make review prompt blocking in CLI (Flag.KILO_CLIENT !== 'vscode'), non-blocking in VS Code - Add 'Continue without review' skip option to dismiss the review suggestion - Add hasPlanningContext() gate: only prompt after plan_exit or cross-session handover - Extract PLAN_PREFIX constant in plan-followup.ts for reuse in detection - Forward blocking field in VS Code SSE→webview mapper (kilo-provider-utils.ts) - Add tests for plan context detection (same-session and cross-session) - Remove stale duplicate kilocode_change end marker in prompt.ts
| const sessionPermissions = () => session.permissions().filter((p) => p.sessionID === id()) | ||
|
|
||
| const questionRequest = () => sessionQuestions().find((q) => !q.tool) | ||
| const questionRequest = () => blockingQuestions()[0] ?? nonBlockingQuestions()[0] |
There was a problem hiding this comment.
WARNING: Tool-attached questions will now render twice
AssistantMessage already renders questions with a tool context inline next to the originating tool call. Because this selector no longer keeps the !q.tool guard, those same questions can also appear in the bottom dock, which duplicates the UI and can surface the wrong prompt when both tool and session questions are pending.
| const answer = answers?.[0]?.[0]?.trim() | ||
| if (answer !== ANSWER_START) return "break" | ||
|
|
||
| const text = await Review.buildReviewPromptUncommitted() |
There was a problem hiding this comment.
WARNING: New-file-only changes are missed by the auto-review
Review.buildReviewPromptUncommitted() is backed by git diff HEAD, which ignores untracked files. If the implementation creates a brand-new file and nothing else, accepting this follow-up produces a "No changes detected" review even though the worktree still has uncommitted changes.
|
|
||
| const list = await Question.list() | ||
| expect(list).toHaveLength(1) | ||
| expect(list[0]?.blocking).toBe(false) |
There was a problem hiding this comment.
WARNING: This test depends on an env var it never sets
ReviewFollowup.ask() only sets blocking: false when Flag.KILO_CLIENT === "vscode", but Flag.KILO_CLIENT defaults to "cli" and this package's test script does not override it. In a normal bun test run this assertion fails unless another test has already mutated process.env.KILO_CLIENT.
Code Review SummaryStatus: 3 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Other Observations (not in diff)No additional issues found outside the diff. Files Reviewed (14 files)
|
Context
Port old VS Code feature #6007 to new CLI & VS Code
Add a backend review follow-up after completed implementation turns, preserving the legacy “review next” intent in the rebuilt question-driven architecture.
Implementation
ReviewFollowupinpackages/opencode/src/kilocode/review-followup.tsto ask a single action (Start code review) viaQuestion.ask.SessionPrompt.loopinpackages/opencode/src/session/prompt.tswithshouldAskReviewFollowup(...), scoped to completedcode/orchestratorturns.plan_exitfollow-up logic.Review.buildReviewPromptUncommitted()and continues the same session loop immediately.packages/opencode/test/kilocode/review-followup*.test.ts.Screenshots
How to Test
bun test test/kilocode/review-followup*.test.ts(frompackages/opencode/)bun test test/kilocode/plan-exit-detection.test.ts(frompackages/opencode/)Get in Touch
We'd love to have a way to chat with you about your changes if necessary. If you're in the Kilo Code Discord, please share your handle here.