Skip to content

feat(native): send a pull request's review threads to its session - #936

Merged
omartelo merged 1 commit into
mainfrom
feat/pulls-thread-to-session
Oct 24, 2026
Merged

omartelo merged 1 commit into
mainfrom
feat/pulls-thread-to-session

Conversation

@omartelo

Copy link
Copy Markdown
Collaborator

Summary

  • Send to session on every open review thread of the Pulls screen, beside Reply and Resolve, in the Conversation tab and in the diff (the same card). It reads Open in Session while the branch's checkout has no session, and lich opens one, as the PR handoffs do. The tooltip names the session.
  • Send N open threads to session at the top of the Conversation tab: every open thread not yet waiting, in one prompt.
  • The prompt names each thread's file, lines, link and every comment, then asks the agent to commit the fix and leave the thread alone on GitHub (prompts.reviewThread, all 7 prompt languages).
  • Reply now, resolve on the next push. Once the session took the prompt, project.AwaitThreadFix reads the PR's head, replies "Fixing this. It'll be in the next commit." and stores the thread (thread_fixes, schema version 12). RunThreadFixWatch reads each waiting PR's head once a minute; when it moved, it resolves the thread and replies "Fixed in ". Resolve goes first, so a failed reply is retried without posting twice. A closed PR or a missing checkout drops its threads.
  • The window keeps the waiting set in one store fed by project.ThreadFixes at boot and the thread-fixes event; the thread header reads "Sent · waiting for a push" and the button hides.
  • docs/ceilings.md: any push resolves a sent thread, even one that did not fix it, and the resolve lands up to a minute after the push.

Orca's take on this resolves the thread the moment the prompt is delivered, before any code changed (their issue #22339); waiting for the push is the deliberate difference.

Test plan

  • go test ./internal/project/ ./internal/store/: await, settle on a new head, keep waiting on the same head or a failed read or resolve, drop on a merged PR or a gone checkout, store round trip
  • go test ./api -update: contract golden records the two methods and the event
  • native: go test ./i18n/ ./cmd/lich-native/ (prompt text, which threads can go, which PRs allow it, locale parity)
  • Local gate: gofmt, go vet ./..., go test ./... on the backend and on native/

An open review thread on the Pulls screen gets Send to session beside Reply
and Resolve, in the Conversation tab and in the diff, and the Conversation
tab can send every open thread at once. The threads go as one prompt to the
session in the branch's checkout, opened when there is none.

Once the session took the prompt, lich answers each thread on GitHub and
keeps it waiting (thread_fixes, schema version 12) for the pull request's
next push. A watcher reads each waiting pull request's head once a minute
and, when it moved, resolves the thread and replies with the new head's
short sha. A pull request that closed, or a checkout that is gone, drops
its threads.

TestOpenDropsTheTerminalThemeSetting drops the new table with the other
post-version-0 additions: the contract changed (a new migration), the
assertion did not.
@omartelo
omartelo merged commit d020df2 into main Oct 24, 2026
7 checks passed
@omartelo
omartelo deleted the feat/pulls-thread-to-session branch October 24, 2026 10:46
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