Skip to content

fix(github): use integration app type for check run updates#3087

Open
alex-alecu wants to merge 1 commit intomainfrom
fix/github-check-run-update-app-type
Open

fix(github): use integration app type for check run updates#3087
alex-alecu wants to merge 1 commit intomainfrom
fix/github-check-run-update-app-type

Conversation

@alex-alecu
Copy link
Copy Markdown
Contributor

@alex-alecu alex-alecu commented May 7, 2026

Summary

Before this PR:

  • A code review integration could be installed with a specific GitHub App type, e.g. standard or another stored app type.
  • Kilo would create/check/manage reviews using that integration.
  • But later, when updating or cancelling the GitHub check run, some code paths accidentally defaulted back to the standard GitHub App.
  • If the check run belonged to a different app type, GitHub would reject the update.
  • That could leave the PR check stuck as queued/running, cancelled incorrectly, or not cleaned up.

Kilo might finish or cancel a code review, but GitHub could still show the Kilo check as stuck because Kilo tried to update it with the wrong app credentials.

This PR fixes that by always passing the integration’s stored github_app_type into check-run updates and cleanup calls.

So the important outcome is:

  • GitHub PR checks update correctly.
  • Cancelled/retried reviews clean up their check runs correctly.
  • Stale or orphaned check runs are less likely to block merges.
  • Existing standard-app integrations still work as before.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 7, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (6 files)
  • apps/web/src/app/api/internal/code-review-status/[reviewId]/route.test.ts
  • apps/web/src/app/api/internal/code-review-status/[reviewId]/route.ts
  • apps/web/src/lib/integrations/platforms/github/webhook-handlers/pull-request-handler.test.ts
  • apps/web/src/lib/integrations/platforms/github/webhook-handlers/pull-request-handler.ts
  • apps/web/src/routers/code-reviews-router.test.ts
  • apps/web/src/routers/code-reviews/code-reviews-router.ts

Reviewed by gpt-5.5-20260423 · 374,547 tokens

@alex-alecu
Copy link
Copy Markdown
Contributor Author

Manual test passed.

Tested:

  • Retriggered an existing GitHub code review through the authenticated tRPC flow, creating a fresh Kilo Code Review check run with the stored standard GitHub app integration.
  • Sent internal status callbacks to move the check run to in_progress and then completed/cancelled.
  • Cancelled a pending GitHub review through codeReviews.cancel and verified check-run cleanup.
  • Verified an app-type mismatch uses the stored app type by confirming the gate update fails before terminal DB persistence, then succeeds after restoring the stored app type.

Verified:

  • GitHub check-run updates reached the expected queued, in-progress, and completed/cancelled states.
  • The cloud_agent_code_reviews row persisted the matching check-run ID, session IDs, terminal status, and terminal reason.
  • Invalid internal callback authentication returned 401 and did not change persisted state.

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