feat: open any pull request of the task's repository in a Pull request tab
Why
Dean asked why #3798 opened on GitHub while #3799 opened in Luke. Both should open in Luke unless something fundamental stops them.
The cause: a Pull request tab belonged to an agent and only showed the pull request from the branch that agent is on now. The same agent opened both PRs. It switched to a new branch for #3799 after opening #3798, so nothing in Luke counted #3798 as anyone's, and its link went to GitHub. Every endpoint the tab reads and writes through was keyed by agent id alone.
What changes
Service, wire, host. The tab's reads and writes can now name a pull request with an optional number query:
- Covered: what the agent published, changes, the overview's pull request, checks and conversation, viewed files, and the pull request action.
- With a number, the service reads that PR of the agent's repository fresh (
agentPullRequestOfNumber). It never writes it on the agent's row. - Without one, everything works as before.
- This is threaded through
service-paths, the client, the act/gateway schemas (codingAgentPullRequestReadParamsSchema, plusnumberon the action params) andhost-operator. - Review options and GitHub images are per repository, so they are unchanged.
Panel.
ChangesStripTabgains an optionalnumber, whichsameTab,tabKey, the stored tab schema, pins and per-tab views all respect.- The tab passes its number down a context (
pull-request-number.ts), so its writes include it: comments, threads, reactions, viewed marks, and merge/close. Each read binds it too. - A numbered tab gets its title, counts and mark from
numberedPullRequests, kept separately from the agents' own PRs. - A link to any PR of the task's repository now opens in Luke from a task, an agent's page or an Inbox item. If an agent's own PR matches, that agent's tab opens. Otherwise the PR opens in a numbered tab on the first agent. A numbered link to an agent's own PR still opens its own tab.
Not covered
Links outside a task's own places still go to GitHub when the PR isn't any listed agent's current one: Factory, Chat, another task's card. That would need Luke links to carry a PR number; I left it out to keep this small.
Tests
- Service: a numbered read returns the earlier PR (title, branch, counts), and a numbered action reaches GitHub with that number. Without a number, the agent's own PR is used. A bad
numberis refused. - Host: the gateway passes
numberthrough to the client. - Panel: a numbered tab reads, counts and changes its own PR.
showPullRequestwith a number opens a separate tab unless the number is the agent's own.openPullRequestsHeresends another PR of the repository to a numbered tab. - UI:
repositoryPullRequestOfand the Inbox target. - JSON-schema fixtures: updated under
LUKE_UPDATE_FIXTURES=1. There is one new fixture, and the action params gainnumber.
Typecheck passes in every package, run one package at a time. pnpm check:affected couldn't finish in the sandbox: the parallel typecheck ran out of memory and two unrelated features tests timed out under load, then passed when re-run alone.
Made with Luke