Skip to content

fix(code-review): normalize unavailable-model cancellations#3634

Open
eshurakov wants to merge 1 commit into
mainfrom
scandalous-option
Open

fix(code-review): normalize unavailable-model cancellations#3634
eshurakov wants to merge 1 commit into
mainfrom
scandalous-option

Conversation

@eshurakov
Copy link
Copy Markdown
Contributor

Summary

  • Normalize Cloud Agent Next preflight unavailable-model failures into the existing Code Review cancelled / model_not_found path instead of disabling Code Reviewer.
  • Preserve team-policy model restrictions as failed / selected_model_unavailable action-required failures with the existing disable flow.
  • Add a shared web-layer unavailable-model classifier used by callback normalization, ambiguous-dispatch recovery, admin telemetry, and alerting compatibility; keep the worker-side equivalent narrow and local across the service boundary.
  • Reclassify historical preflight rows in reporting and operational alerting without a database migration or producer-message change.

Verification

  • Manual verification was not performed because this is a backend-only state-classification change with no interactive UI path.
  • Add any additional manual verification details.

Visual Changes

N/A

Reviewer Notes

  • Rolling-deploy compatibility is intentional: older workers may still report failed / selected_model_unavailable with the exact preflight message, and the web layer normalizes those payloads.
  • Existing Code Reviewer configurations disabled by the previous behavior are not automatically re-enabled; any repair should be handled separately.
  • Ambiguous-dispatch recovery intentionally normalizes persistence only. Provider-summary publication remains callback-route-owned and can be hardened in a separate follow-up.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Jun 1, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The PR correctly reclassifies preflight unavailable-model failures as cancelled/model_not_found across all three enforcement layers (worker, callback route, ambiguous-dispatch recovery), with SQL retroactive reclassification consistently applied and comprehensive test coverage for both the new path and the preserved team-policy selected_model_unavailable path.

Files Reviewed (9 files)
  • apps/web/src/lib/code-reviews/model-unavailable.ts — new shared classifier
  • apps/web/src/lib/code-reviews/model-unavailable.test.ts — unit tests
  • apps/web/src/lib/code-reviews/action-required.ts — preflight message removed from classifier
  • apps/web/src/lib/code-reviews/action-required.test.ts — updated tests
  • apps/web/src/app/api/internal/code-review-status/[reviewId]/route.ts — callback normalization
  • apps/web/src/app/api/internal/code-review-status/[reviewId]/route.test.ts — callback tests
  • apps/web/src/lib/code-reviews/alerting/detectors.ts — alerting SQL filter
  • apps/web/src/lib/code-reviews/alerting/detectors.test.ts — alerting tests
  • apps/web/src/lib/code-reviews/dispatch/dispatch-pending-reviews.ts — ambiguous-dispatch recovery
  • apps/web/src/lib/code-reviews/dispatch/dispatch-pending-reviews.test.ts — dispatch tests
  • apps/web/src/routers/admin-code-reviews-router.ts — admin reporting SQL
  • apps/web/src/routers/admin-code-reviews-router.test.ts — admin reporting tests
  • services/code-review-infra/src/code-review-orchestrator.ts — worker-side classification
  • services/code-review-infra/test/integration/code-review-orchestrator.test.ts — integration tests

Fix these issues in Kilo Cloud


Reviewed by claude-sonnet-4.6 · 983,426 tokens

Review guidance: REVIEW.md from base branch main

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.

1 participant