Skip to content

fix(code-reviews): show model, session, and live events while a review is running - #5342

Merged
eshurakov merged 2 commits into
mainfrom
session/agent_0147d4b7-5e8e-443e-8cd0-d4443fab0da3
Aug 18, 2026
Merged

fix(code-reviews): show model, session, and live events while a review is running#5342
eshurakov merged 2 commits into
mainfrom
session/agent_0147d4b7-5e8e-443e-8cd0-d4443fab0da3

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Persist the selected model at dispatch and resolve it on codeReviews.get so the review detail page can show it while a run is still in flight.
  • Show the cloud-agent session ID on the review details card and in the stream header even before history loads.
  • Fix live stream event conversion so tool/text/status events render while a review is running. The old converter expected part.state as a string and part.name; the live payload uses { status } and part.tool, so events only appeared after completion from the historical snapshot.

Test plan

  • Open /code-reviews/<id>?attemptId=<running-attempt> while a review is running and confirm the selected model and session ID are visible.
  • Confirm live tool/text/status events appear in the stream while the review is still running, not only after it completes.
  • Confirm a completed review still shows model, session ID, and the historical session log.
  • apps/web tests: code-review-stream-events, model-selection, dispatch-pending-reviews, code-reviews-router (not run here — Postgres was unavailable).

@eshurakov eshurakov self-assigned this Aug 18, 2026
Comment thread apps/web/src/components/code-reviews/code-review-stream-events.ts
Comment thread apps/web/src/components/code-reviews/code-review-stream-events.ts Outdated
Comment thread apps/web/src/routers/code-reviews/code-reviews-router.ts
@kilo-code-bot

kilo-code-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/components/code-reviews/code-review-stream-events.ts 63 Live tool updates append duplicate identical log lines
apps/web/src/components/code-reviews/code-review-stream-events.ts 80 Streaming text parts with no status become a new log line on every update
apps/web/src/routers/code-reviews/code-reviews-router.ts 404 Config fallback overwrites the model on historical reviews that never persisted one
Files Reviewed (10 files)
  • apps/web/src/app/(app)/code-reviews/[reviewId]/CodeReviewDetailClient.tsx - 0 issues
  • apps/web/src/components/code-reviews/CodeReviewStreamView.tsx - 0 issues
  • apps/web/src/components/code-reviews/code-review-stream-events.test.ts - 0 issues
  • apps/web/src/components/code-reviews/code-review-stream-events.ts - 2 issues
  • apps/web/src/lib/code-reviews/core/model-selection.test.ts - 0 issues
  • apps/web/src/lib/code-reviews/core/model-selection.ts - 0 issues
  • apps/web/src/lib/code-reviews/dispatch/dispatch-pending-reviews.test.ts - 0 issues
  • apps/web/src/lib/code-reviews/dispatch/dispatch-pending-reviews.ts - 0 issues
  • apps/web/src/routers/code-reviews-router.test.ts - 0 issues
  • apps/web/src/routers/code-reviews/code-reviews-router.ts - 1 issue

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 265K · Output: 28.2K · Cached: 780.7K

Review guidance: REVIEW.md from base branch main

This change ensures that the model selected for a code review is
persisted during dispatch and correctly resolved/displayed in the UI,
even if it hasn't been written to the review record yet.

- Persist the selected model in the database when a review is dispatched.
- Implement `selectedModelFromReviewSources` to resolve the effective
  model from persisted data, repository overrides, or default configs.
- Update the code review router to return the resolved model in the
  API response.
- Display the session ID and model in the `CodeReviewDetailClient` UI.
- Refactor code review stream event handling into a dedicated utility
  module.
- Add comprehensive tests for model selection logic, dispatch
  persistence, and router responses.
Keyed tool parts now replace the existing log line instead of appending
every status tick, and text parts wait until they complete. GET uses
billing usage for terminal reviews and only falls back to the current
config while a review is still in flight.
@kilo-code-bot
kilo-code-bot Bot force-pushed the session/agent_0147d4b7-5e8e-443e-8cd0-d4443fab0da3 branch from 9639c7b to 40d4c88 Compare August 18, 2026 19:55
@eshurakov
eshurakov merged commit 0f41843 into main Aug 18, 2026
17 checks passed
@eshurakov
eshurakov deleted the session/agent_0147d4b7-5e8e-443e-8cd0-d4443fab0da3 branch August 18, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants