Repository navigation
feat(native): send a pull request's review threads to its session - #936
Merged
Merged
Conversation
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.
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
prompts.reviewThread, all 7 prompt languages).project.AwaitThreadFixreads the PR's head, replies "Fixing this. It'll be in the next commit." and stores the thread (thread_fixes, schema version 12).RunThreadFixWatchreads 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.project.ThreadFixesat boot and thethread-fixesevent; 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 tripgo test ./api -update: contract golden records the two methods and the eventnative:go test ./i18n/ ./cmd/lich-native/(prompt text, which threads can go, which PRs allow it, locale parity)go vet ./...,go test ./...on the backend and onnative/