Files
kilocode/.changeset/session-pr-link.md
T
Igor Šćekić 90a93a7aa2 feat(opencode): link sessions to their pull request (#13137)
* feat(opencode): add PR link detect and parse helpers

detectPrLink runs gh pr view, parsePrUrl accepts GitHub and GitLab PR
URLs, and a Storage helper holds the manual override.

* feat(opencode): add kilo pr link, unlink, and status commands

kilo pr becomes a parent command with checkout preserved. link and
unlink write the Storage override; the next heartbeat persists it.

* feat(opencode): advertise prLink on the heartbeat and ingest it

getSessions resolves the Storage override, cleared, or detected link,
puts prLink on the heartbeat, and syncs the session_pr_link item.

* fix(opencode): encode worktree in pr link override storage key

The manual override key used the raw absolute worktree path. Storage
builds the file with path.join, so a Windows drive colon made an invalid
filename and kilo pr link failed. Encode the worktree so the key is one
valid path segment on both platforms.

* test(opencode): cover kilo pr status outputs

Extract the status handler body so it is testable, then assert the four
outputs: stored link, cleared, detected, and no link. Split captured
output on os.EOL so the test passes on Windows.

* refactor(opencode): remove dead pr-link code found in simplify pass

detectPrLink now reuses parsePrUrl instead of hand-parsing the URL and
number, drop the dead github.com special case, and inline the
prLinkTripleKey helper.

* fix(opencode): clear pr-link dedupe map on session delete

* docs(kilo-docs): regenerate CLI reference for kilo pr subcommands

* chore: add session-pr-link changeset and bump facade allowlist
2026-08-16 09:33:14 +01:00

250 B

@kilocode/cli
@kilocode/cli
minor

Add kilo pr link <url>, kilo pr unlink, and kilo pr status to link the current worktree to a pull request. The checkout command moves to kilo pr checkout <number>; kilo pr <number> no longer checks out a PR.