Repository navigation
Commit 5706ac9
feat(server): agents link GitHub issues to their thread over MCP (#1441)
## What Changed
Agents link GitHub issues to their own thread over MCP, the way they link pull requests.
| Tool | Does |
| --- | --- |
| `link_issue` | links by URL, or repository and number, as `agent` |
| `unlink_issue` | removes a link; reports whether one existed |
| `list_thread_issues` | the thread's links with last known state |
- **Thread:** always the calling token's own thread
- **Host default:** the project's host when only a number is given
- **Repeat link:** `alreadyLinked`, no error
- **Absent unlink:** `wasLinked: false`, no error
- **Other rejections:** stay failures
- **Deleted thread:** not found, never a no-op
- **Stored URL:** canonical issue URL only
- **Hosts:** github.com or the project's host
- **Capability:** rides the pull request tools' gate
- **Instruction:** one line beside the pull request linking line
Upstream files change only by `fork-hook` lines in `McpHttpServer.ts` and `RuntimeInstructions.ts`.
## Why
Agents already register the pull requests they open; the issues they work on stayed invisible to the thread.
This is layer 3 of #1430, on the link model from #1440.
## Checks
```text
vp fmt --check (changed files) → exit 0
vp lint (changed files) → exit 0
tsc --noEmit (apps/server) → exit 0
vp test run issues toolkit + instructions → exit 0 (13 tests)
vp run fork:ci → exit 0
```
## Evidence
A real Claude thread on this branch's dev server, told to use only its MCP tools:
1. `link_issue` the issue URL
2. `link_issue` it again
3. `list_thread_issues`
4. `unlink_issue` it
5. `unlink_issue` it again
6. `list_thread_issues`

## Close conditions
Closes #1433
- [x] link_issue: links by URL as agent
- [x] unlink_issue: removes the link
- [x] list_thread_issues: lists the thread's links
- [x] Idempotent: a repeat link changes nothing
- [x] Scope: a call reaches only its own thread
- [x] Missing thread: fails, never "already linked"
| Condition | Evidence |
| --- | --- |
| link_issue | "links by URL with source agent on the token's thread" |
| unlink_issue | "unlinks a linked issue and reports a missing one as wasLinked=false" |
| list_thread_issues | "lists the shell's links, with unknown state until the first read" |
| Idempotent | "treats a duplicate link as alreadyLinked rather than an error" |
| Scope | the thread comes from the invocation token, never the input |
| Missing thread | "fails cleanly when the token's thread no longer exists"; "reports a thread deleted between lookup and dispatch as not found" |
## Checklist
- [x] This PR is small and focused
- [x] I explained what changed and why
- [x] I included before/after screenshots for any UI changes
- [x] I included a video for animation/interaction changes
No UI changes; the capture above is server evidence.
Opus 5.5 via Claude Code in T3 Code.
## Fork trailers
Squashes:
- 08f914e feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441)
- ccc7cbd fixup! feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441)
- 5f9c06ea466 feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441)
- 13b58374c19 fixup! feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441)
- 8022f708420 feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441)
- 05e302b39db fixup! feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441)
- dda4b199691 fixup! feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441)
- b06df04900a feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441)
- ead034c270b fix(fork): adapt fork seams to v0.0.46-nightly.20261005.2689
Fork-Domain: github-issues
Fork-Tier: qol
Fork-Upstreamable: no1 parent aedf0ca commit 5706ac9
10 files changed
Lines changed: 1066 additions & 0 deletions
File tree
- apps/server/src
- mcp
- toolkits/issues
- orchestration-v2/testkit
- provider
- packages/provider-core
- src/server
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
1150 | 1151 | | |
1151 | 1152 | | |
1152 | 1153 | | |
| 1154 | + | |
1153 | 1155 | | |
1154 | 1156 | | |
1155 | 1157 | | |
| |||
0 commit comments