Skip to content

fix(cloud-agent): restore PR badges with automatic link verification - #7160

Merged
eshurakov merged 2 commits into
mainfrom
kilo/fading-maple-jwp
Oct 5, 2026
Merged

eshurakov merged 2 commits into
mainfrom
kilo/fading-maple-jwp

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix the verification deadlock introduced by fix(sessions): link a pull request only on the session's verified own evidence #6968: unverified stored PR links had no badge and therefore no reachable Refresh action.
  • Expose an opaque verification candidate key for valid session-owned GitHub links without displaying unverified links.
  • Automatically verify candidates from sidebar list/search results, serialize requests, bound retries, and refresh the sidebar after success.
  • Reattempt when stored link or head evidence changes while preserving the protection against unrelated PR badges.

Verification

  • Web typecheck passed.
  • Targeted lint, formatting, and git diff whitespace checks passed.
  • All 92 sidebar tests passed.
  • All 25 verification-candidate unit tests passed.
  • Pure unit tests ran with database setup hooks disabled. Database-backed integration tests could not run because PostgreSQL was unavailable.

Introduce a mechanism to automatically verify associated GitHub pull
requests for sessions in the sidebar. This uses an opaque verification
key derived from the PR URL, repository, and git head evidence (ref
and SHA) to detect when a link needs re-verification.

- Add `getPrLinkVerificationKey` to generate a SHA256 hash of session
  and PR metadata.
- Implement `useSidebarSessions` hook logic to trigger
  `refreshAssociatedPullRequest` mutations for unverified sessions.
- Add `nextPrLinkVerification` utility to manage the verification
  queue and prevent redundant attempts.
- Update `cli-sessions-v2-router` to include verification keys in
  session projections.
- Add comprehensive unit tests for verification key generation and
  sidebar hook logic.
Comment thread apps/web/src/components/cloud-agent-next/hooks/useSidebarSessions.ts Outdated
@kilo-code-bot

kilo-code-bot Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental changes in commit 48a41d7 replace the broad retry: 1 with a transient-only retry predicate and bound the attempt history at 1,000 entries; both prior findings are resolved and no new issues were found in the changed code.

Files Reviewed (4 files)
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarSessions.ts
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarSessions.test.ts
  • apps/web/src/routers/cli-sessions-v2-router.ts
  • apps/web/src/routers/cli-sessions-v2-router.test.ts
Previous Review Summary (commit 0a8daca)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 0a8daca)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 1

Fix these issues in Kilo Cloud

Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/components/cloud-agent-next/hooks/useSidebarSessions.ts 747 retry: 1 retries non-recoverable errors such as BAD_REQUEST (no GitHub integration) and TOO_MANY_REQUESTS (GitHub rate limit)

SUGGESTION

File Line Issue
apps/web/src/components/cloud-agent-next/hooks/useSidebarSessions.ts 744 attemptedPrLinks map is never pruned and grows without bound for the hook's lifetime
Files Reviewed (4 files)
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarSessions.ts - 2 issues
  • apps/web/src/components/cloud-agent-next/hooks/useSidebarSessions.test.ts - 0 issues
  • apps/web/src/routers/cli-sessions-v2-router.ts - 0 issues
  • apps/web/src/routers/cli-sessions-v2-router.test.ts - 0 issues

Reviewed by deepseek-v4.1-flash · Input: 46.9K · Output: 11.4K · Cached: 604K

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.

2 participants