Skip to content

fix(cli): ingest PR links without remote control - #15350

Merged
eshurakov merged 3 commits into
mainfrom
eshurakov/twilight-ivy
Oct 22, 2026
Merged

eshurakov merged 3 commits into
mainfrom
eshurakov/twilight-ivy

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Cloud Agent runs with remote control disabled. Since v7.8.2, PR links were stored locally but only ingested by the remote heartbeat, leaving new sessions without PR badges.

Restore ingest after PR creation, pushes, and explicit link_pr completion, and during full sync. Keep the hard-evidence checks, per-session ownership, and existing deduplication. An absent local record does not clear a valid backend link.

@github-actions github-actions Bot added the area:cli CLI, TUI and core engine label Oct 21, 2026
Comment thread packages/opencode/src/kilo-sessions/kilo-sessions.ts Outdated
Comment thread packages/opencode/src/kilo-sessions/kilo-sessions.ts
@kilo-code-bot

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

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The startup poll now syncs tracked sessions' stored evidence before refreshPrLink(), so a link written by a previous process is ingested and then withdrawn when the host reports the PR closed, instead of having its local record removed with no backend clear. Verified against syncPrLinkForSession / syncSessionPrLink and the updated regression test.

Files Reviewed (2 files)
  • packages/opencode/src/kilo-sessions/kilo-sessions.ts
  • packages/opencode/test/kilocode/kilo-sessions.test.ts
Previous Review Summaries (2 snapshots, latest commit eeabd0c)

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

Previous review (commit eeabd0c)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/opencode/src/kilo-sessions/kilo-sessions.ts 910 The immediate poll tick refreshes (and clears) before it syncs, so a link stored by an earlier process is removed locally and never withdrawn on the backend.
Files Reviewed (3 files)
  • packages/opencode/src/kilo-sessions/kilo-sessions.ts - 1 issue
  • packages/opencode/test/kilocode/kilo-sessions.test.ts - no issues
  • .changeset/restore-session-pr-ingest.md - no issues

Fix these issues in Kilo Cloud

Previous review (commit 5f9b7ca)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/opencode/src/kilo-sessions/kilo-sessions.ts 507 syncPrLinkForSession only ingests a link when a record exists, so a locally cleared link (PR closed, detected by the 5-minute refreshPrLink sweep → clearSessionLink) is never withdrawn while remote control is off. The badge now appears without remote control but stays forever after the PR is merged/closed. syncSessionPrLink(sessionId, record, new Set()) already implements the desired semantics via lastPrLinkTriple and preserves the "absent record must not withdraw a backend link" rule.

SUGGESTION

File Line Issue
packages/opencode/src/kilo-sessions/kilo-sessions.ts 811 syncPrLinkTriple records a triple as accepted when ingest.sync returns true, but that only means "client exists"; a session without a share record has its item silently dropped in IngestQueue.run (if (!share) return). With the new non-remote call sites, a session created while logged out that later creates/pushes a PR records the triple and never re-sends it.
Files Reviewed (3 files)
  • packages/opencode/src/kilo-sessions/kilo-sessions.ts - 2 issues
  • packages/opencode/test/kilocode/kilo-sessions.test.ts - no issues (new tests cover create/push/link_pr/fullSync without RemoteWS.connect, plus dedupe on the later heartbeat)
  • .changeset/restore-session-pr-ingest.md - no issues

Fix these issues in Kilo Cloud


Reviewed by deepseek-flash-latest · Input: 140.3K · Output: 17.5K · Cached: 1.1M

Review guidance: REVIEW.md from base branch main

Comment thread packages/opencode/src/kilo-sessions/kilo-sessions.ts
@eshurakov
eshurakov merged commit 4481e06 into main Oct 22, 2026
33 checks passed
@eshurakov
eshurakov deleted the eshurakov/twilight-ivy branch October 22, 2026 08:23
@github-actions

Copy link
Copy Markdown
Contributor

Tracked for the opencode v2 rewrite in #15371 (core-v1-changes-port).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:cli CLI, TUI and core engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants