opencode-forgekeeper 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +140 -825
- package/dist/index.js +1838 -770
- package/dist/tui.js +95 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,880 +1,195 @@
|
|
|
1
1
|
# opencode-forgekeeper
|
|
2
2
|
|
|
3
|
-
An [OpenCode](https://opencode.ai) plugin that
|
|
4
|
-
|
|
5
|
-
footer, and surfaces new review feedback in a persistent inbox. It supports GitLab and GitHub. The status
|
|
6
|
-
and review notifications are optional; see [Keep only session titles](#keep-only-session-titles).
|
|
3
|
+
An [OpenCode](https://opencode.ai) plugin that keeps coding sessions connected to their issues,
|
|
4
|
+
PRs/MRs, review feedback, and CI status. It supports GitHub and GitLab.
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
Session titles include the references you're working on. The prompt footer shows what needs
|
|
7
|
+
attention, and optional summaries bring review feedback back into the relevant conversation.
|
|
8
|
+
A session can track several PRs/MRs across repositories.
|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
This capture shows optional session delivery. Current releases default to the feedback inbox;
|
|
13
|
+
notification wording has changed since this capture.
|
|
11
14
|
|
|
12
15
|
## Installation
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
Requires OpenCode 2.2 or later, plus an authenticated [`gh`](https://cli.github.com/) for GitHub
|
|
18
|
+
or [`glab`](https://gitlab.com/gitlab-org/cli) for GitLab. The CLI must be available on the
|
|
19
|
+
OpenCode server's `PATH`; only the CLI for your forge is required.
|
|
20
|
+
|
|
21
|
+
```sh
|
|
15
22
|
opencode plugin add opencode-forgekeeper
|
|
16
23
|
```
|
|
17
24
|
|
|
18
|
-
|
|
25
|
+
OpenCode loads the server and terminal parts automatically. Forgekeeper uses your forge CLI's
|
|
26
|
+
credentials and has none of its own. Without a forge CLI, session naming still works, and
|
|
27
|
+
`/forge-status` explains what's missing.
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"$schema": "https://opencode.ai/config.json",
|
|
23
|
-
"plugins": ["opencode-forgekeeper"]
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
The package has a server entry point and a CLI entry point, which OpenCode loads automatically.
|
|
28
|
-
The server owns session targets, title prefixes, forge lookups, polling, and notification
|
|
29
|
-
delivery. The CLI holds leases on the sessions it has shown, their latest snapshots, and each
|
|
30
|
-
directory's settings. It renders the status that the server serves and shows its notices as
|
|
31
|
-
toasts.
|
|
32
|
-
|
|
33
|
-
### Requirements
|
|
34
|
-
|
|
35
|
-
- [`glab`](https://gitlab.com/gitlab-org/cli) for GitLab and [`gh`](https://cli.github.com/)
|
|
36
|
-
for GitHub, on the `PATH` of the OpenCode server. Each is only needed for its forge.
|
|
37
|
-
- Each CLI logged in to every host it's used for: `glab auth login --hostname <host>` and
|
|
38
|
-
`gh auth login --hostname <host>`. The plugin uses their credentials and has none of its
|
|
39
|
-
own.
|
|
40
|
-
- For self-managed GitLab hosts not named `gitlab.*`, and for GitHub Enterprise, the
|
|
41
|
-
`hosts` and `githubHosts` [options](#options).
|
|
42
|
-
|
|
43
|
-
Without a forge CLI, titles still follow targets and branches, and `/forge-status` reports
|
|
44
|
-
what's missing, such as `glab is not installed`.
|
|
45
|
-
|
|
46
|
-
## Upgrade from forgekeeper 2.x
|
|
47
|
-
|
|
48
|
-
Forgekeeper 3 changes where review notifications go, and renames its options:
|
|
49
|
-
|
|
50
|
-
- **Notifications:** review feedback no longer resumes the session or asks the agent to
|
|
51
|
-
address it. It goes to the `/forge-feedback` inbox. To also post it to the session, set
|
|
52
|
-
`delivery.reviews` to `"passive"` or `"summary"`. See
|
|
53
|
-
[Review notifications](#review-notifications).
|
|
54
|
-
- **Options:** Forgekeeper no longer reads the former option names. It shows an error toast
|
|
55
|
-
that names each one, and uses that option's default instead. For example, a former
|
|
56
|
-
`reviewStatus: false` leaves status on, so rename it to `status: false` before you upgrade.
|
|
57
|
-
- **Monitoring:** Forgekeeper also watches recent sessions with PR/MR targets that no CLI
|
|
58
|
-
has shown, and announces conflicts, failed jobs, and merges of their targets. See
|
|
59
|
-
[Which sessions the server watches](#which-sessions-the-server-watches) and
|
|
60
|
-
[Merge request updates](#merge-request-updates). Set `watch.lifecycle` to `false` to
|
|
61
|
-
stop the merge request updates.
|
|
62
|
-
|
|
63
|
-
Rename the former options as follows:
|
|
64
|
-
|
|
65
|
-
| Former option | Now |
|
|
66
|
-
| ------------------------------------------- | --------------------------------------------------------------------------------------- |
|
|
67
|
-
| `reviewStatus` | `status` |
|
|
68
|
-
| `notifyHumanReviews` | `watch.humanReviews` |
|
|
69
|
-
| `notifyAutomatedReviews`, `notifyDuoReview` | `watch.automatedReviews`, and `watch.reviewBots` for review bots |
|
|
70
|
-
| `resumeSession` | `delivery.reviews`: `"summary"` starts a turn, and `"passive"` queues for the next turn |
|
|
29
|
+
For self-managed hosts, configure `hosts` for GitLab hosts not named `gitlab.*`, or
|
|
30
|
+
`githubHosts` for GitHub Enterprise.
|
|
71
31
|
|
|
72
32
|
## Session targets
|
|
73
33
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
When you establish or change the primary issue, PR, or MR, the agent sets its full
|
|
78
|
-
URL as the session target. Background references, comparisons, and dependencies keep the
|
|
79
|
-
current target. After the agent creates a PR/MR for the current task, it sets the new PR/MR
|
|
80
|
-
as the target, passing the current issue as `issue_url`.
|
|
81
|
-
|
|
82
|
-
For example, if the title starts with `[#123, !45]` and you ask the agent to review MR `!456`,
|
|
83
|
-
the prefix becomes `[!456]`. Without `issue_url`, the server reads the PR/MR's source branch
|
|
84
|
-
and takes the issue number from its name, so reviewing an MR from `321-fix-timeout` produces
|
|
85
|
-
`[#321, !456]`.
|
|
86
|
-
|
|
87
|
-
Targets persist per session across plugin reloads. Calling `set_session_target` with
|
|
88
|
-
`target: "branch"` returns to branch-based naming. Child sessions and untitled sessions are
|
|
89
|
-
skipped.
|
|
90
|
-
|
|
91
|
-
### Several targets
|
|
92
|
-
|
|
93
|
-
A session can work on up to 50 issues and PRs/MRs at once, such as a set of related MRs
|
|
94
|
-
under review. Pass their full URLs in `targets` instead of `target`, and choose how they
|
|
95
|
-
change the current targets with `operation`:
|
|
96
|
-
|
|
97
|
-
| `operation` | Effect |
|
|
98
|
-
| ------------------- | ------------------------------------------------------------------------------ |
|
|
99
|
-
| `replace` (default) | Sets exactly the given targets. |
|
|
100
|
-
| `add` | Appends the given targets and keeps the current ones. |
|
|
101
|
-
| `remove` | Drops the given targets. Removing the last one returns to branch-based naming. |
|
|
102
|
-
|
|
103
|
-
```json
|
|
104
|
-
{
|
|
105
|
-
"targets": [
|
|
106
|
-
"https://gitlab.com/group/project/-/merge_requests/101",
|
|
107
|
-
"https://gitlab.com/group/other/-/merge_requests/102"
|
|
108
|
-
],
|
|
109
|
-
"operation": "add"
|
|
110
|
-
}
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
The server normalizes and deduplicates the URLs, which can come from different projects.
|
|
34
|
+
Ask the agent to work on an issue or PR/MR. Forgekeeper provides `set_session_target` and
|
|
35
|
+
instructions for the agent to keep the session's target up to date, including after creating
|
|
36
|
+
a PR/MR. Targets persist across reloads and need not match the checked-out branch.
|
|
114
37
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
38
|
+
For example, a session working on issue `#12` and MR `!45` gets a title prefix such as
|
|
39
|
+
`[#12, !45]`. Several targets produce `[!101, !102]`, or `[!101, !102, !103, +3]` for a larger set.
|
|
40
|
+
Your own title text is preserved.
|
|
118
41
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
it adds the new one instead of replacing the others.
|
|
42
|
+
Without an explicit target, naming follows the checked-out branch and its open PR/MR. Ask the
|
|
43
|
+
agent to return to branch-based naming when you want that behavior again. Default branches
|
|
44
|
+
get no branch-based prefix. Child sessions aren't renamed.
|
|
123
45
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
name, the issue comes first, such as `[#12, !101, !102]`. More than four targets list the
|
|
127
|
-
first three and count the rest, such as `[!101, !102, !103, +3]`.
|
|
46
|
+
See the reference for [target rules](https://github.com/pedropombeiro/opencode-plugins/blob/main/packages/forgekeeper/docs/reference.md#session-targets) and
|
|
47
|
+
[branch-based naming](https://github.com/pedropombeiro/opencode-plugins/blob/main/packages/forgekeeper/docs/reference.md#branch-based-naming).
|
|
128
48
|
|
|
129
|
-
|
|
130
|
-
GitHub URLs are accepted on any host that isn't recognizably GitLab, so GitHub Enterprise
|
|
131
|
-
targets work.
|
|
49
|
+
## PR/MR status
|
|
132
50
|
|
|
133
|
-
|
|
51
|
+
The footer shows CI, unresolved threads, conflicts, approvals, and running automated reviews.
|
|
52
|
+
Several targets show aggregate counts. Click the PR/MR number or pipeline to open it in the
|
|
53
|
+
browser, or another indicator to open the status dialog.
|
|
134
54
|
|
|
135
|
-
|
|
55
|
+
For example, this footer tracks four MRs, with one conflict and two already merged:
|
|
136
56
|
|
|
137
|
-
|
|
138
|
-
without one.
|
|
139
|
-
2. It adds the newest open PR/MR from the branch, or `!N/A` (GitLab) or `#N/A` (GitHub)
|
|
140
|
-
until one exists.
|
|
57
|
+

|
|
141
58
|
|
|
142
|
-
|
|
143
|
-
Text you add to the title, including your own bracketed prefixes, is kept.
|
|
144
|
-
|
|
145
|
-
Branch names longer than 40 characters are shortened with an ellipsis in the prefix. Titles
|
|
146
|
-
stay within 100 characters by shortening the text after the prefix, never the prefix
|
|
147
|
-
itself, so the plugin can still find and replace its prefix later.
|
|
148
|
-
|
|
149
|
-
The default branch and branches named `main`, `master`, `develop`, or `HEAD` get no prefix.
|
|
150
|
-
|
|
151
|
-
The branch's remote, pushed branch name, and forge come from the same repository discovery
|
|
152
|
-
as the status footer. That discovery uses the branch's push or upstream remote, recognizes
|
|
153
|
-
forks, and classifies hosts with the `hosts` and `githubHosts` options.
|
|
154
|
-
|
|
155
|
-
| Pattern | Example branch | Issue |
|
|
156
|
-
| --------------------------------- | ----------------------- | ----- |
|
|
157
|
-
| `<prefix>/<number>-<description>` | `feature/123-add-login` | `123` |
|
|
158
|
-
| `<number>-<description>` | `123-fix-typo` | `123` |
|
|
159
|
-
| `<description>-<number>` | `fix-typo-123` | `123` |
|
|
160
|
-
| `<prefix>/<number>/<description>` | `user/123/some-work` | `123` |
|
|
161
|
-
| `issue-<number>`, `gh-<number>` | `gh-42-improve-perf` | `42` |
|
|
162
|
-
| `fix-<number>`, `feat-<number>` | `fix-99` | `99` |
|
|
163
|
-
|
|
164
|
-
## Status footer
|
|
165
|
-
|
|
166
|
-
The server picks each session's PRs/MRs in this order:
|
|
167
|
-
|
|
168
|
-
1. The explicit targets.
|
|
169
|
-
1. A PR/MR number in a title prefix that you wrote, such as `!456` in `[!456] Review`.
|
|
170
|
-
1. The checked-out branch's open PRs/MRs.
|
|
171
|
-
|
|
172
|
-
A prefix that the plugin wrote from the branch doesn't count as a title reference, so the
|
|
173
|
-
footer follows the branch when its PR/MR closes and another opens. The title prefix itself
|
|
174
|
-
reuses a branch's PR/MR number for up to 10 minutes.
|
|
175
|
-
|
|
176
|
-
Explicit targets that aren't PRs/MRs, such as issues, show no status. Unresolved explicit
|
|
177
|
-
PRs/MRs never fall back to the branch.
|
|
178
|
-
|
|
179
|
-
Without a PR/MR to show, the footer stays empty, even when a lookup fails, such as in a new
|
|
180
|
-
session before the server answers. It shows `PR/MR status unavailable` only when none of
|
|
181
|
-
the session's explicit PR/MR targets can be looked up or found. `/forge-status` explains
|
|
182
|
-
why.
|
|
183
|
-
|
|
184
|
-
The server runs at most four `glab` or `gh` commands at once for status and review
|
|
185
|
-
feedback, across all sessions. When some target lookups fail, the footer shows the others
|
|
186
|
-
and counts the failures as `N unavailable`. A target whose lookup failed with an error
|
|
187
|
-
keeps its previous status until a later poll succeeds. A GitLab response that reports an
|
|
188
|
-
error counts as a failed lookup, never as a missing MR, so it's retried with backoff.
|
|
189
|
-
|
|
190
|
-
When the CLI can't reach the server, such as while the server plugin reloads, the footer
|
|
191
|
-
keeps the last status and marks it `stale`. The CLI never looks PRs/MRs up itself, so it
|
|
192
|
-
can't show another project's PR/MR with the same number as a target.
|
|
193
|
-
|
|
194
|
-
With several PR/MR targets, the footer shows counts instead of one PR/MR's status, such as
|
|
195
|
-
`5 MRs · 🤖 2 reviewing · 1 CI failed · 1 conflict · 1 merged`. Clicking it opens the
|
|
196
|
-
status dialog, which lists each PR/MR.
|
|
197
|
-
|
|
198
|
-
The footer shows checks or the pipeline, unresolved threads, conflicts, approval, and a
|
|
199
|
-
running automated review, from GitLab Duo or GitHub Copilot. GitHub also shows a requested
|
|
200
|
-
change. Unknown mergeability stays unknown rather than appearing conflict-free.
|
|
201
|
-
|
|
202
|
-
The footer shows `approved` only when GitLab reports that approval requirements are met,
|
|
203
|
-
at least one person approved, and every human reviewer approved. Bot approvals, such as
|
|
204
|
-
Duo's, don't count. While human reviewers haven't approved, it shows `awaiting @username`,
|
|
205
|
-
or `awaiting N reviewers` for more than two.
|
|
206
|
-
|
|
207
|
-
Clicking the PR/MR number or pipeline opens it in the browser. Clicking any other indicator
|
|
208
|
-
opens the status dialog. These commands are also available from the command palette:
|
|
209
|
-
|
|
210
|
-
- `/forge-status` opens a dialog with full status and a refresh action. Aliases:
|
|
211
|
-
`/mr-status` and `/pr-status`.
|
|
212
|
-
- `/forge-open` opens the PR/MR in the browser. Aliases: `/mr-open` and `/pr-open`.
|
|
213
|
-
|
|
214
|
-
The server caches each session's status and polls every 2 minutes while a CLI shows an open
|
|
215
|
-
PR/MR, or every 30 seconds while an automated review runs. Each change reaches the CLIs as
|
|
216
|
-
an RPC event.
|
|
217
|
-
|
|
218
|
-
Sessions in the same checkout share cached status and human-feedback fetches for the same
|
|
219
|
-
forge, host, project, and PR/MR number. Overlapping requests share one in-flight fetch.
|
|
220
|
-
Successful status results remain fresh for the polling interval, capped at 30 seconds
|
|
221
|
-
while an automated review runs. Complete human-feedback results remain fresh for 60 seconds.
|
|
222
|
-
Failures and incomplete feedback are not retained for reuse. Each cache keeps at most
|
|
223
|
-
1,000 entries and is cleared when the plugin stops.
|
|
224
|
-
|
|
225
|
-
Session timers, review baselines, and acknowledgements remain independent. Manual refresh
|
|
226
|
-
invalidates the selected session's target caches and feedback fetch timestamps. Completed turns invalidate the checkout's caches
|
|
227
|
-
before notifying watched sessions, so changes such as pushes can be observed. Caches are
|
|
228
|
-
not shared between checkouts, whose CLI credentials and repository context may differ.
|
|
229
|
-
|
|
230
|
-
### Which sessions the server watches
|
|
231
|
-
|
|
232
|
-
The server discovers recent sessions at startup, every 5 minutes, and after target changes
|
|
233
|
-
or completed turns. A session qualifies when it is a non-archived root session in the
|
|
234
|
-
checkout, has an explicit PR/MR target, and has a user message in the last 72 hours.
|
|
235
|
-
A compaction drops earlier messages from the session's context, so when the context has no
|
|
236
|
-
user message, the newest compaction counts instead, since compactions run only during
|
|
237
|
-
turns. Viewing a tab, changing its title, or receiving a background notification does not
|
|
238
|
-
extend that window. Sessions without readable conversation activity are skipped. Discovery
|
|
239
|
-
reads conversation timestamps locally; it does not send conversations to a model.
|
|
240
|
-
|
|
241
|
-
Discovered sessions poll without a CLI lease while at least one explicit target is open.
|
|
242
|
-
Targets that couldn't be resolved, such as while the forge returns nothing for them, keep
|
|
243
|
-
being retried, even when the session's other targets closed or merged. While none of the
|
|
244
|
-
targets resolves, retries back off like failed lookups. Once every target is found and
|
|
245
|
-
closed or merged, polling stops. Discovery reevaluates the activity window
|
|
246
|
-
every 5 minutes. It runs only while OpenCode has this checkout's plugin instance loaded;
|
|
247
|
-
it is not a separate scheduler and cannot wake an unloaded location or stopped service.
|
|
248
|
-
|
|
249
|
-
The server also watches sessions that a CLI has shown since it started. The CLI renews a
|
|
250
|
-
lease on each of them every minute, and a lease that isn't renewed for 3 minutes ends, such
|
|
251
|
-
as after the CLI exits. A session keeps polling while it's on screen in any CLI. A hidden
|
|
252
|
-
session with a lease keeps polling while it has a running automated review, human feedback
|
|
253
|
-
to watch, or a notification to retry.
|
|
254
|
-
|
|
255
|
-
A hidden session that the server hasn't looked up yet, such as after the server plugin
|
|
256
|
-
reloads, is looked up once to find out whether it has reviews to watch. A target change
|
|
257
|
-
also looks up a hidden session that isn't polling.
|
|
258
|
-
|
|
259
|
-
Each checkout's server plugin instance watches only the sessions in that checkout. When a
|
|
260
|
-
session moves to another worktree, the CLI moves its lease to that checkout's instance. The
|
|
261
|
-
old instance stops watching the session, even if another CLI still leases it there. Before
|
|
262
|
-
each notification, the server reads the session again, so a session that moved while a
|
|
263
|
-
lookup or fetch ran is left to its new checkout. A review that finishes during the move can
|
|
264
|
-
go unannounced, because the new instance never saw it running. If the session can't be
|
|
265
|
-
read, the notification is retried later instead of being dropped.
|
|
266
|
-
|
|
267
|
-
After that read, the server checks the targets again and records feedback for the
|
|
268
|
-
PRs/MRs that are still targets. A target removed in the meantime isn't mentioned.
|
|
269
|
-
|
|
270
|
-
When the server plugin stops, such as on a reload, no new lookup, fetch, notification,
|
|
271
|
-
title update, or target change starts, and queued `glab` and `gh` commands don't run. A
|
|
272
|
-
title update that is still looking up its branch doesn't rename the session or store
|
|
273
|
-
anything, because the replacement instance owns the session's state by then. Notifications
|
|
274
|
-
that were already being sent can finish and store their outcome, so the replacement instance
|
|
275
|
-
doesn't send them again. Cleanup waits up to 5 seconds for them. One that takes longer may be
|
|
276
|
-
sent again.
|
|
277
|
-
|
|
278
|
-
## Review notifications
|
|
279
|
-
|
|
280
|
-
For each explicit target that is an open PR/MR, the server records new review feedback.
|
|
281
|
-
A target that merges or closes gets no more notifications, and a notification waiting for a
|
|
282
|
-
retry is dropped.
|
|
283
|
-
Feedback goes to a persistent inbox. The `delivery.reviews` option sets what else
|
|
284
|
-
an update does:
|
|
285
|
-
|
|
286
|
-
- `inbox`, the default, posts nothing to the session.
|
|
287
|
-
- `passive` queues a session message with `resume: false`, which starts no turn. It
|
|
288
|
-
doesn't mark the session unread, because the TUI marks sessions unread only when a
|
|
289
|
-
turn ends. When something else wakes the session, the message can run as its own
|
|
290
|
-
step; Forgekeeper then sends only the notice, without tools or the session's history.
|
|
291
|
-
- `summary` queues a message that starts a summary turn, described below. A turn that
|
|
292
|
-
ends marks the session unread. Updates without comments, such as Copilot reviews,
|
|
293
|
-
get a passive message instead.
|
|
294
|
-
|
|
295
|
-
Session messages contain the notification title, when the newest comment was written, and
|
|
296
|
-
links, not review bodies or instructions to act. Updates without comments, such as Copilot
|
|
297
|
-
reviews, show when Forgekeeper detected them instead. Times are absolute and local, with
|
|
298
|
-
their time zone, such as `Oct 28, 2026 at 3:25 PM GMT+1`, so they stay accurate in the
|
|
299
|
-
session's history. `/forge-feedback` shows the same time, and a summary starts by saying it.
|
|
300
|
-
|
|
301
|
-
Each update keeps the mode it was recorded in, so changing `delivery.reviews`
|
|
302
|
-
affects later updates only: switching to `summary` never starts turns for updates already
|
|
303
|
-
in the inbox. Summarize those with Ctrl+R instead. Stable message IDs deduplicate
|
|
304
|
-
automatic retries, including after reloads. Updates that haven't reached their session are
|
|
305
|
-
retried every minute and after a reload, each on its own, so one that keeps failing doesn't
|
|
306
|
-
hold the others back. Delivery doesn't hold up the inbox: `/forge-feedback`, pausing, and
|
|
307
|
-
acknowledging work while a summary reads its comments, and an update in flight isn't sent
|
|
308
|
-
again by a retry. An update acknowledged or cleared while its comments are read isn't
|
|
309
|
-
posted, and one paused meanwhile waits until monitoring resumes. An update whose session was deleted, archived, or moved, or that no
|
|
310
|
-
longer targets the PR/MR, is dropped, including when that changed while its comments were
|
|
311
|
-
read. Switching `delivery.reviews` to `inbox` stops retries of review updates, and
|
|
312
|
-
leaves them undelivered, so they go again once it's switched back. Merge request updates
|
|
313
|
-
follow `delivery.lifecycle` the same way. A summary requested from `/forge-feedback` is a
|
|
314
|
-
new request each time.
|
|
315
|
-
|
|
316
|
-
### Summary turns
|
|
317
|
-
|
|
318
|
-
A summary turn runs after any active turn finishes, including its tool calls. Forgekeeper
|
|
319
|
-
reads the announced comments, at most 20 of them and 4,000 characters each, with context
|
|
320
|
-
the summary can't fetch itself:
|
|
321
|
-
|
|
322
|
-
- Earlier replies in each comment's thread, at most 5 of 1,000 characters each. GitHub
|
|
323
|
-
provides only the comment a reply answers.
|
|
324
|
-
- The code an inline comment is on, at most 3,000 characters. On GitLab, that's 10 lines
|
|
325
|
-
on either side of the commented line, from the MR's head commit, or from its base commit
|
|
326
|
-
for a removed line, for at most 10 files. On GitHub, it's the end of the diff hunk. A
|
|
327
|
-
file that can't be read leaves out only its code.
|
|
328
|
-
|
|
329
|
-
The PR/MR's author wrote that code, so the summary treats it as untrusted, like the
|
|
330
|
-
comments. Forgekeeper keeps all of this in plugin storage until the next user prompt, or for
|
|
331
|
-
at most 7 days. It never enters the session's history, where later turns with tools could
|
|
332
|
-
read it.
|
|
333
|
-
|
|
334
|
-
#### Linked notes
|
|
335
|
-
|
|
336
|
-
On GitLab, review comments often link to supporting notes, such as an issue in another
|
|
337
|
-
project with further details. A summary can read those with one tool,
|
|
338
|
-
`fetch_linked_review_note(url)`, which accepts only links that the announced comments'
|
|
339
|
-
own text contains:
|
|
340
|
-
|
|
341
|
-
- HTTPS links without credentials or a port, on the MR's GitLab host, to an issue, work
|
|
342
|
-
item, or MR note (`…/-/issues/1#note_2`). Notes in other projects count. Links in thread
|
|
343
|
-
replies, in code, or in a linked note don't, so nothing a linked note says can widen
|
|
344
|
-
what the summary reads.
|
|
345
|
-
- At most 5 links per summary, each at most 300 characters, without duplicates or links
|
|
346
|
-
to the announced comments.
|
|
347
|
-
|
|
348
|
-
Forgekeeper stores these links with the summary's record before posting its message. The
|
|
349
|
-
tool reads a note with one fixed GraphQL query through `glab`, and keeps it only if the
|
|
350
|
-
note GitLab returns, of any note type, has the link's note ID and names the same project,
|
|
351
|
-
issue or MR, and note. GitLab returns nothing for notes you can't read. The model supplies
|
|
352
|
-
only the link: never a host, query, method, or header.
|
|
353
|
-
|
|
354
|
-
Each summary gets 5 calls. Every call counts, including repeats, refused links, and failed
|
|
355
|
-
reads, and is spent before the read, so neither concurrent calls nor a reload restore it.
|
|
356
|
-
A linked note keeps at most 4,000 characters, and all of them together at most 12,000.
|
|
357
|
-
The comments come first in the request's 40,000-character budget. Linked notes, with
|
|
358
|
-
their links and status lines, get only what the comments leave; notes that don't fit are
|
|
359
|
-
reported as left out, and without room for the readable links, the request offers no tool.
|
|
360
|
-
|
|
361
|
-
The tool returns only a receipt that names the link, which is what stays in the session's
|
|
362
|
-
history. The note's text goes to the summary's record, and from there only into the
|
|
363
|
-
summary's next requests, as a `<linked-note>` block. Every request that can hold linked
|
|
364
|
-
notes, including the last one, which has no tool, keeps the instructions that treat them
|
|
365
|
-
as untrusted like the comments.
|
|
366
|
-
|
|
367
|
-
The tool works only for the summary of the session's latest model request, and checks
|
|
368
|
-
the session's context again on each call, so a user prompt ends its access even before
|
|
369
|
-
the next request. A record older than 7 days counts as missing in every check, not just
|
|
370
|
-
at the next startup. After a reload, the tool refuses until the next request. A stopped
|
|
371
|
-
instance writes nothing, and cleanup waits for its calls, so a late call can't overwrite
|
|
372
|
-
the budget its replacement uses. Ordinary requests never include the tool, and summaries
|
|
373
|
-
without links, notices, and steps whose summary can't be read get no tools at all.
|
|
374
|
-
GitHub summaries don't read linked notes.
|
|
375
|
-
|
|
376
|
-
Forgekeeper recognizes a step whose input is one of its messages in two independent ways:
|
|
377
|
-
|
|
378
|
-
- Every message it posts ends with a tag naming its ID, such as
|
|
379
|
-
`[forgekeeper:msg_forgekeeper_…]`, which the context hook finds in the request it's
|
|
380
|
-
about to send. This doesn't depend on stored state, so a failed restore or an expired
|
|
381
|
-
record can't let the message run as an ordinary request. A tag in a user prompt, such
|
|
382
|
-
as a pasted transcript, doesn't count when the session's context shows the prompt.
|
|
383
|
-
- It tracks every message it posts until a user prompt follows that message, and reads the
|
|
384
|
-
session's context before each request. A message still in the queue stays tracked while
|
|
385
|
-
earlier steps run, and a reminder sent after the message doesn't end its step.
|
|
386
|
-
|
|
387
|
-
Before each model request that either way identifies, its context hook:
|
|
388
|
-
|
|
389
|
-
- removes every tool from the request, except the linked-note tool while the summary has
|
|
390
|
-
links left to read;
|
|
391
|
-
- replaces the system prompt with summary instructions that treat comments as untrusted;
|
|
392
|
-
- replaces the conversation with one message holding the comments and the linked notes
|
|
393
|
-
read so far, or the notice, so the request resends neither the session's history nor
|
|
394
|
-
the step's own tool calls;
|
|
395
|
-
- caps the output at 1,200 tokens.
|
|
396
|
-
|
|
397
|
-
If the review text is missing, such as after its record expired, the request asks for a
|
|
398
|
-
short reply saying so, still without tools or history. If the hook can't build the
|
|
399
|
-
replacement message, the request fails rather than keeping any of the session's messages.
|
|
400
|
-
|
|
401
|
-
As backstops, Forgekeeper refuses every tool execution other than the linked-note tool,
|
|
402
|
-
which checks its own calls and asks for no permissions, and every permission request,
|
|
403
|
-
while the session's latest model request was one of these, and treats a step it can't classify as
|
|
404
|
-
one, such as when the session's context can't be read, or when a compaction left no
|
|
405
|
-
input in it. The turn ends at the next user prompt. A later turn that another plugin starts
|
|
406
|
-
without a user prompt also runs without tools. The summary is the only part that stays in
|
|
407
|
-
the session's history.
|
|
408
|
-
|
|
409
|
-
`/forge-feedback` lists pending feedback for
|
|
410
|
-
the current checkout. Select an update to open its PR/MR or comment links, press Ctrl+D
|
|
411
|
-
to acknowledge it, press Ctrl+R to summarize it in its session in any delivery mode, or
|
|
412
|
-
press Ctrl+S to pause or resume review monitoring. Acknowledgement
|
|
413
|
-
only dismisses the local update; it does not reply to or resolve a remote discussion.
|
|
414
|
-
A session's footer shows how many of its own updates are pending. The home screen, where
|
|
415
|
-
new sessions start, shows no count. `/forge-feedback` lists the whole checkout's updates,
|
|
416
|
-
and connected CLIs in the checkout show a toast even when the session's tab has never been
|
|
417
|
-
visited. With session tabs on, those CLIs also reopen the session's tab, without leaving
|
|
418
|
-
the session you're in.
|
|
419
|
-
|
|
420
|
-
An update leaves the inbox when you acknowledge it, or when it no longer needs attention:
|
|
421
|
-
|
|
422
|
-
- Once every comment it announced is resolved, by anyone. Comments that can't be resolved,
|
|
423
|
-
such as GitLab comments outside a thread or GitHub review bodies, need acknowledging,
|
|
424
|
-
and so do updates without comments, such as Copilot reviews.
|
|
425
|
-
- Once its PR/MR merges or closes, or its session stops targeting it.
|
|
426
|
-
|
|
427
|
-
Forgekeeper checks resolution and PR/MR state only for sessions it monitors. Resolution
|
|
428
|
-
counts only from a fetch that no later change made obsolete, and state only after a lookup
|
|
429
|
-
finishes, so a reload doesn't clear updates before the session's targets are known. A
|
|
430
|
-
target change clears that target's updates right away, whether or not Forgekeeper
|
|
431
|
-
monitors the session. Working on the feedback, with or without the agent, doesn't clear an
|
|
432
|
-
update by itself.
|
|
433
|
-
|
|
434
|
-
The inbox retains the newest 500 updates per checkout across plugin reloads. It stores
|
|
435
|
-
session IDs, target URLs, notification titles, comment URLs, and timestamps, not comment
|
|
436
|
-
bodies or credentials. A pause persists across reloads and leaves status display available.
|
|
437
|
-
|
|
438
|
-
PRs/MRs from the title or the branch don't get review notifications.
|
|
439
|
-
|
|
440
|
-
Before it sends a notification, the server checks that the PR/MR is still one of the
|
|
441
|
-
session's targets. A lookup that started before the targets changed is discarded, so a
|
|
442
|
-
removed target never triggers a notification.
|
|
443
|
-
|
|
444
|
-
| Notification | GitLab | GitHub |
|
|
445
|
-
| ------------------------------------------ | -------------------------------- | -------------- |
|
|
446
|
-
| An automated review finished with feedback | GitLab Duo | GitHub Copilot |
|
|
447
|
-
| Comments from review bots | Security reviewers, `reviewBots` | `reviewBots` |
|
|
448
|
-
| New human review feedback | MR comments | PR comments |
|
|
449
|
-
|
|
450
|
-
- **Duo reviews**: new unresolved inline findings from the GitLab Duo bot create inbox
|
|
451
|
-
updates after the findings remain unchanged for five minutes. Forgekeeper does not need
|
|
452
|
-
to observe the review running. Summary-only reviews, approvals without inline findings,
|
|
453
|
-
system notes, and resolved findings send nothing. Comment IDs persist independently of
|
|
454
|
-
human feedback, including an empty baseline when monitoring starts without findings.
|
|
455
|
-
Existing findings become the initial baseline; new findings posted while OpenCode is
|
|
456
|
-
offline are detected after monitoring resumes if a baseline was already stored.
|
|
457
|
-
When available, `duoCreatedSession.id` groups findings by code-review workflow run.
|
|
458
|
-
A linked workflow must be terminal before delivery, and the watcher refetches before
|
|
459
|
-
notifying. Older GitLab versions and permission-hidden workflows use comment IDs and
|
|
460
|
-
the settling window without a workflow link. Separate runs use distinct inbox IDs.
|
|
461
|
-
- **Copilot reviews**: the server notifies when a submitted, undismissed review has at least
|
|
462
|
-
one inline comment. A review without inline comments, such as one that
|
|
463
|
-
found nothing or couldn't run for lack of quota, sends nothing. Copilot reviews are
|
|
464
|
-
identified, so a review that started and finished between two polls is announced too. A
|
|
465
|
-
review that the server finds on a PR's first look isn't announced. Observed and delivered
|
|
466
|
-
review IDs persist across restarts. A completed review can be announced while another
|
|
467
|
-
review is requested.
|
|
468
|
-
- **Human reviews**: new comments and replies from people other than you and bots are
|
|
469
|
-
announced once none of their unresolved comments has changed for 5 minutes. Expect one
|
|
470
|
-
update 5 to 7 minutes after the review goes quiet. Resolved threads are skipped.
|
|
471
|
-
- **Review bots**: comments from the bot accounts that `reviewBots` names are announced
|
|
472
|
-
like human reviews, including comments without a file or line, such as a security
|
|
473
|
-
review's findings. `reviewBots` maps each host to exact usernames, ignoring case. By
|
|
474
|
-
default, it names GitLab.com's security reviewers for `gitlab-org`:
|
|
475
|
-
|
|
476
|
-
```json
|
|
477
|
-
{
|
|
478
|
-
"reviewBots": {
|
|
479
|
-
"gitlab.com": ["duo-security-review-gitlab-org", "ai-appsec-security-mr-reviewer-gitlab-org"]
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
```
|
|
483
|
-
|
|
484
|
-
Duo Security Review has one account per top-level group, so add yours, such as
|
|
485
|
-
`duo-security-review-acme`, and a self-managed instance's accounts under its host. Your
|
|
486
|
-
list replaces the defaults, and `watch.reviewBots: false` turns this off. Names have no
|
|
487
|
-
wildcards, since a group owner can create a bot account with any free name, such as one
|
|
488
|
-
that starts like a security reviewer's. Only accounts that the forge flags as bots count,
|
|
489
|
-
and only on the host they're listed for. `watch.reviewBots` controls them on its own,
|
|
490
|
-
apart from `watch.humanReviews` and `watch.automatedReviews`. GitLab Duo's code review
|
|
491
|
-
findings always go through their own watcher instead. Internal notes, such as Duo
|
|
492
|
-
Security Review's, count when your account can read them.
|
|
493
|
-
|
|
494
|
-
The first look at a PR/MR records its newest comment as a baseline, so older comments never
|
|
495
|
-
count as new. Announced comments are stored per session and PR/MR, so a restart replays
|
|
496
|
-
nothing but still catches comments posted in the meantime.
|
|
497
|
-
|
|
498
|
-
Feedback counts as announced once the inbox has it. If Forgekeeper can't record it, such as
|
|
499
|
-
when its storage fails, it shows an error toast and tries again after 10 minutes. Duo and
|
|
500
|
-
human feedback then keep their comment IDs unannounced, so a restart can retry them, and
|
|
501
|
-
Copilot notifications stay pending in storage while the review still has feedback and the
|
|
502
|
-
PR remains an open target. Legacy state-only Duo pending notifications are discarded.
|
|
503
|
-
|
|
504
|
-
A session message that fails, such as when the comment text can't be read for a summary,
|
|
505
|
-
shows an error toast. The update stays in the inbox, which retries the message every
|
|
506
|
-
minute. Acknowledging the update ends those retries, and the update doesn't come back.
|
|
507
|
-
|
|
508
|
-
Every checkout's server plugin instance shares the plugin's storage, so each baseline and
|
|
509
|
-
each pending notification has its own storage key. Instances never overwrite each other's
|
|
510
|
-
records. A failed storage write shows an error toast once.
|
|
511
|
-
|
|
512
|
-
On GitLab, the server reads the newest 2,000 comments. On busier MRs, edits to older
|
|
513
|
-
comments don't count as activity.
|
|
514
|
-
|
|
515
|
-
### Live comment subscriptions
|
|
516
|
-
|
|
517
|
-
GitLab feedback monitoring attempts an outbound TLS WebSocket connection to the MR's host,
|
|
518
|
-
using GitLab's internal `Noteable::NotesChannel` Action Cable interface. Sessions targeting
|
|
519
|
-
the same MR share one subscription within a checkout. No webhook receiver or project
|
|
520
|
-
administration permission is required. This interface is not a public GraphQL subscription
|
|
521
|
-
and can differ across GitLab versions.
|
|
522
|
-
|
|
523
|
-
After the server confirms a subscription, comment events trigger a feedback fetch. Events
|
|
524
|
-
within a one-second window share a refresh. Quiet connections reconcile comments every
|
|
525
|
-
15 minutes, on the next scheduled status check. The five-minute settling window still
|
|
526
|
-
applies, and the watcher fetches again before delivering pending feedback. Initial connection
|
|
527
|
-
and reconnection also trigger a fetch to catch changes while disconnected.
|
|
528
|
-
|
|
529
|
-
GitHub and hosts that cannot establish a subscription keep polling. Connection failures,
|
|
530
|
-
rejections, and missing heartbeats restore normal feedback polling. Reconnection attempts
|
|
531
|
-
back off from 30 seconds to 15 minutes. Pausing feedback, removing the last session watching
|
|
532
|
-
an MR, or unloading the plugin closes its connection. Subscriptions only accelerate comment
|
|
533
|
-
monitoring; status, pipeline, and automated-review polling continue at their existing intervals.
|
|
534
|
-
|
|
535
|
-
On HTTP 429, subscription retries honor `Retry-After` and GitLab's `RateLimit-Reset` and
|
|
536
|
-
`RateLimit-ResetTime` headers, even when the wait exceeds 15 minutes. The cooldown applies
|
|
537
|
-
to all MR subscriptions on that origin within the checkout and survives removing and
|
|
538
|
-
re-adding a target during the plugin instance's lifetime. Other origins remain independent.
|
|
539
|
-
Bun's native WebSocket client hides rejected-handshake headers, so a failed handshake
|
|
540
|
-
triggers one HTTP upgrade probe with a 10-second timeout and redirects disabled. The probe
|
|
541
|
-
reads the reset headers and discards the body. A 429 without usable headers delays retries
|
|
542
|
-
by at least one minute. Normal authenticated API polling continues during this subscription
|
|
543
|
-
cooldown.
|
|
544
|
-
|
|
545
|
-
GitLab can classify bearer-authenticated `/-/cable` requests as unauthenticated for rate
|
|
546
|
-
limiting: its rate-limit authentication checks API and feed routes, while Action Cable
|
|
547
|
-
authenticates the bearer token later. A valid API token therefore does not necessarily
|
|
548
|
-
avoid the unauthenticated per-IP limit on this route.
|
|
549
|
-
|
|
550
|
-
On GitHub, the server reads three lists: conversation comments, the text of submitted
|
|
551
|
-
reviews, and the inline comments of review threads. It keeps the newest 2,000 of each.
|
|
552
|
-
It scans every thread to include recent replies in old threads, within a limit of 200 API
|
|
553
|
-
requests per fetch. If it cannot complete that scan, it defers notifications until a complete
|
|
554
|
-
fetch succeeds. Review text counts when it isn't empty, whether the
|
|
555
|
-
review approves, requests changes, or only comments. Comments from GitHub Apps, such as
|
|
556
|
-
Copilot, count as bots. Hidden comments and unsubmitted review comments are skipped.
|
|
557
|
-
The baseline also records comment IDs at its timestamp, so a new comment posted in the same
|
|
558
|
-
second can still be announced. Baselines stored by older plugin versions retain their
|
|
559
|
-
timestamp-only behavior until a new baseline is created.
|
|
560
|
-
|
|
561
|
-
## Merge request updates
|
|
562
|
-
|
|
563
|
-
Forgekeeper also watches each session's explicit PR/MR targets for three changes:
|
|
564
|
-
|
|
565
|
-
- **Conflicts:** a target that could merge starts to conflict with its target branch.
|
|
566
|
-
- **Failed jobs:** a job fails in a target's head pipeline, even while the pipeline still
|
|
567
|
-
runs.
|
|
568
|
-
- **Merges:** a target merges.
|
|
569
|
-
|
|
570
|
-
All come from the forge's own state, compared between two lookups, never from comments
|
|
571
|
-
such as GitLab's "can no longer be merged" note. The first lookup of a target only records
|
|
572
|
-
it, so nothing that happened before Forgekeeper first saw the target is announced. Records
|
|
573
|
-
persist across restarts, so a change that happened while OpenCode wasn't running is
|
|
574
|
-
announced at the next lookup. A
|
|
575
|
-
mergeability the forge hasn't settled yet, such as while GitLab rechecks an MR after a
|
|
576
|
-
push to it or to its target branch, keeps the last known state. A conflict that ends and
|
|
577
|
-
starts again is a new update.
|
|
578
|
-
Sessions are watched the same way as for review feedback, without visiting their tabs.
|
|
579
|
-
|
|
580
|
-
Failed jobs don't wait for the pipeline to finish, which can take much longer than the
|
|
581
|
-
job. Each lookup reads the pipeline's failed jobs:
|
|
582
|
-
|
|
583
|
-
- On GitLab, the first 10 failed jobs that aren't retried, with the MR, and no other
|
|
584
|
-
query. One that isn't allowed to fail is enough to know the pipeline fails. When all
|
|
585
|
-
10 are allowed to fail and more failed, an unread one may fail the pipeline, but none
|
|
586
|
-
counts as failing it while the pipeline runs. Once the pipeline finishes as failed,
|
|
587
|
-
which jobs allowed to fail never cause, the update reports that a job past those 10
|
|
588
|
-
failed it.
|
|
589
|
-
- On GitHub, the head commit's failed checks, which count as one pipeline.
|
|
590
|
-
|
|
591
|
-
Each job attempt counts once. A lookup that finds new failed jobs makes one update for
|
|
592
|
-
them, which names and links them, lists the jobs that failed earlier in that pipeline,
|
|
593
|
-
and says whether the pipeline still runs. That update replaces the pipeline's earlier one
|
|
594
|
-
in the inbox, and reaches the session again. A retry that fails again is a new attempt,
|
|
595
|
-
so it's a new failure. Forgekeeper remembers the newest 500 attempts it saw in a pipeline,
|
|
596
|
-
so one that newer failures push past the jobs it reads isn't new when it comes back.
|
|
597
|
-
Another pipeline that fails, such as after a push, is new too. At
|
|
598
|
-
most 10 jobs are named, and more are counted. Records stored before Forgekeeper told job
|
|
599
|
-
attempts apart only record the jobs, without an update. The update clears once the
|
|
600
|
-
pipeline no longer has failed jobs, another pipeline replaces it, or the PR/MR closes.
|
|
601
|
-
Forgekeeper only reports failed jobs: it doesn't retry or fix them.
|
|
602
|
-
|
|
603
|
-
Each change waits in the target's record until it reaches the inbox, in the same storage
|
|
604
|
-
write as the record. A merge stops polling, so waiting changes are retried every minute
|
|
605
|
-
and after a reload, without another lookup. Updates go to `/forge-feedback`, and
|
|
606
|
-
`delivery.lifecycle` sets what else they do: `"inbox"`, the default, `"passive"`, or
|
|
607
|
-
`"summary"`, as for [review feedback](#review-notifications). Each change keeps the mode
|
|
608
|
-
from when it was detected, so turning on summaries never starts turns for changes found
|
|
609
|
-
earlier. A summary turn has no tools, and gets only Forgekeeper's facts about the change,
|
|
610
|
-
never comments.
|
|
611
|
-
|
|
612
|
-
A conflict update clears once the conflict ends or the PR/MR closes. A merge update stays
|
|
613
|
-
until you acknowledge it, because the merge is the news. Updates for targets the session
|
|
614
|
-
drops clear right away. Setting `watch.lifecycle` to `false` stops all three kinds, and
|
|
615
|
-
retarget proposals too, since nothing notices merges then.
|
|
616
|
-
|
|
617
|
-
### Stacked PRs/MRs
|
|
618
|
-
|
|
619
|
-
A target **builds on** another of the session's targets when it targets that one's source
|
|
620
|
-
branch in the same project, on the same host. Forgekeeper links them only when exactly one
|
|
621
|
-
target matches, and keeps the link once the parent merges, because forges may retarget the
|
|
622
|
-
dependent PR/MR or delete the merged branch at that point. Sharing a session doesn't make
|
|
623
|
-
two PRs/MRs a stack.
|
|
624
|
-
|
|
625
|
-
When a parent merges, its update lists each dependent, and `lifecycleExecution.parentMerged`
|
|
626
|
-
sets what Forgekeeper works out about them:
|
|
627
|
-
|
|
628
|
-
| Mode | What happens |
|
|
629
|
-
| ----------- | ------------------------------------------------------------------------------------- |
|
|
630
|
-
| `"notify"` | The default. The update names the dependents and the branch they target, and no more. |
|
|
631
|
-
| `"prepare"` | Forgekeeper works out the listed actions and proposes them in the update. |
|
|
632
|
-
|
|
633
|
-
`actions` lists what `prepare` works out, so it needs at least one. `parentMerged`
|
|
634
|
-
supports `"retarget"`:
|
|
59
|
+

|
|
635
60
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
61
|
+
| Command | Action |
|
|
62
|
+
| --- | --- |
|
|
63
|
+
| `/forge-status` | Show detailed status and refresh it. Aliases: `/mr-status`, `/pr-status`. |
|
|
64
|
+
| `/forge-open` | Open the PR/MR in your browser. Aliases: `/mr-open`, `/pr-open`. |
|
|
65
|
+
| `/forge-feedback` | Browse pending review feedback and PR/MR updates. |
|
|
641
66
|
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
gets no proposal, since its branch lives in another project. Only dependents the session
|
|
647
|
-
still targets count.
|
|
67
|
+
Status normally refreshes every 2 minutes, or every 30 seconds during automated reviews and
|
|
68
|
+
while new review feedback settles.
|
|
69
|
+
Explicit PR/MR targets take precedence over title references and branch discovery. Issue
|
|
70
|
+
targets have no PR/MR status.
|
|
648
71
|
|
|
649
|
-
|
|
650
|
-
four dependent MRs when the merge deletes the source branch, so a proposal usually means
|
|
651
|
-
the branch was kept, which may be deliberate. Retarget the MR yourself, and rebase it if
|
|
652
|
-
the parent was squashed, since its commits stay on the dependent branch. Each event keeps
|
|
653
|
-
the policy it happened under, and the stricter of that and the current policy applies, so
|
|
654
|
-
enabling `prepare` never reads dependents again for earlier merges.
|
|
72
|
+
## Reviews and updates
|
|
655
73
|
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
74
|
+
Forgekeeper watches explicit PR/MR targets for human and automated review feedback, conflicts,
|
|
75
|
+
failed jobs, and merges. Recent top-level sessions can receive updates even if their tabs
|
|
76
|
+
aren't open. Branch-derived PRs/MRs get status but no review notifications.
|
|
659
77
|
|
|
660
|
-
|
|
78
|
+
By default, updates go to a persistent local inbox. In `/forge-feedback`, select an update to
|
|
79
|
+
open its links, acknowledge it, summarize it in its session, or pause monitoring.
|
|
80
|
+
Acknowledging an update doesn't reply to or resolve a remote discussion.
|
|
661
81
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
Monitoring uses the existing authenticated `gh` and `glab` clients for fixed read-only
|
|
665
|
-
GraphQL queries and GitLab MR REST lookups. GitLab subscriptions read the host's token with
|
|
666
|
-
`glab config get token --host` and send it in the WebSocket authorization header over TLS.
|
|
667
|
-
Tokens are not stored in plugin storage or included in URLs. Subprocesses use argument arrays
|
|
668
|
-
rather than shell interpolation, share
|
|
669
|
-
the existing concurrency limit of four, and time out after 30 seconds. Their credentials
|
|
670
|
-
and environment are those of the OpenCode service; monitoring does not provide OS-level
|
|
671
|
-
isolation or reduce those credentials' scopes.
|
|
672
|
-
|
|
673
|
-
The `inbox` mode invokes a model only when you ask for a summary with Ctrl+R in
|
|
674
|
-
`/forge-feedback`. The `passive` mode starts no turn, but when
|
|
675
|
-
something else wakes the session, its message can run as one step that sends the model
|
|
676
|
-
only the notice's title, time, and links, without tools. The `summary` mode sends review
|
|
677
|
-
text to the session's model in a request whose only possible tool reads GitLab notes that
|
|
678
|
-
the comments link to, as described in [Linked notes](#linked-notes). It reads with your
|
|
679
|
-
`glab` credentials, so it can read private notes in other projects on the same host that
|
|
680
|
-
those links name. No mode executes commands from
|
|
681
|
-
review content, edits repository files, commits, pushes, posts replies, or resolves
|
|
682
|
-
discussions.
|
|
683
|
-
|
|
684
|
-
Forgekeeper changes nothing on a forge. For stacked PRs/MRs, it only proposes retargets.
|
|
685
|
-
See [Stacked PRs/MRs](#stacked-prsmrs).
|
|
686
|
-
Comment links are opened only after user selection and must use HTTPS on the target's
|
|
687
|
-
origin without embedded credentials. Review bodies remain external data, not trusted
|
|
688
|
-
instructions. Analysis and remediation are outside this feature's scope.
|
|
689
|
-
|
|
690
|
-
Pending updates are stored locally through OpenCode's plugin storage. Conversation history
|
|
691
|
-
is inspected locally only to find the latest user-message timestamp, with at most four
|
|
692
|
-
session checks in flight. The 72-hour window limits monitoring eligibility, not access
|
|
693
|
-
rights. OpenCode's provider, integration, and organization policies still apply. This
|
|
694
|
-
implementation has not received AppSec approval.
|
|
695
|
-
|
|
696
|
-
Set options with the object form of the `plugins` entry in `opencode.json`:
|
|
82
|
+
To bring summaries into conversations automatically, set both delivery options to `summary`:
|
|
697
83
|
|
|
698
84
|
```json
|
|
699
85
|
{
|
|
700
86
|
"plugins": [
|
|
701
|
-
{
|
|
87
|
+
{
|
|
88
|
+
"package": "opencode-forgekeeper",
|
|
89
|
+
"options": {
|
|
90
|
+
"delivery": { "reviews": "summary", "lifecycle": "summary" }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
702
93
|
]
|
|
703
94
|
}
|
|
704
95
|
```
|
|
705
96
|
|
|
706
|
-
|
|
707
|
-
| ------------------------ | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
708
|
-
| `status` | `true` | Show the PR/MR status and monitor the session's PRs/MRs. Set to `false` to keep only session targets and titles. |
|
|
709
|
-
| `hosts` | `["gitlab.com"]` | GitLab hosts whose remotes are recognized, besides hosts named `gitlab.*`. |
|
|
710
|
-
| `githubHosts` | `["github.com"]` | GitHub hosts, including GitHub Enterprise hosts. |
|
|
711
|
-
| `pollSeconds` | `120` | Normal polling interval. Running automated reviews poll at 30 seconds or this value, whichever is lower. |
|
|
712
|
-
| `watch.humanReviews` | `true` | Watch for new review feedback from people. |
|
|
713
|
-
| `watch.automatedReviews` | `true` | Watch for automated reviews that finish with feedback, such as GitLab Duo's and GitHub Copilot's. |
|
|
714
|
-
| `watch.reviewBots` | `true` | Watch for comments from the accounts `reviewBots` lists. |
|
|
715
|
-
| `watch.lifecycle` | `true` | Watch for targets that start to conflict, get failed jobs, or merge. See [Merge request updates](#merge-request-updates). |
|
|
716
|
-
| `reviewBots` | GitLab.com security reviewers | Bot accounts whose comments count as review feedback, by host, with exact usernames. See [Review bots](#review-notifications). |
|
|
717
|
-
| `delivery.reviews` | `"inbox"` | What a review update does besides entering the inbox: `"inbox"`, `"passive"`, or `"summary"`. See [Summary turns](#summary-turns). |
|
|
718
|
-
| `delivery.lifecycle` | `"inbox"` | What a merge request update does besides entering the inbox: `"inbox"`, `"passive"`, or `"summary"`. |
|
|
719
|
-
| `lifecycleExecution` | `"notify"` | What Forgekeeper works out when a parent PR/MR merges, in `parentMerged`. See [Stacked PRs/MRs](#stacked-prsmrs). |
|
|
720
|
-
|
|
721
|
-
`watch` and `delivery` list only what you change, and sources added in later releases start
|
|
722
|
-
on. For example, this summarizes review feedback and stops watching merge request changes:
|
|
97
|
+
Each delivery option accepts:
|
|
723
98
|
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
99
|
+
- `inbox`: retain the update without posting to the session. This is the default.
|
|
100
|
+
- `passive`: queue a notice without starting a turn.
|
|
101
|
+
- `summary`: start a restricted summary turn after active work finishes. Review updates
|
|
102
|
+
without comments use a passive notice instead.
|
|
727
103
|
|
|
728
|
-
|
|
729
|
-
|
|
104
|
+
Human and GitLab Duo feedback wait for a four-minute quiet period, with status polling every
|
|
105
|
+
30 seconds meanwhile, so an update arrives within about 5 minutes of the last comment. That's
|
|
106
|
+
before a typical 5-minute prompt cache expires. Monitoring records an initial baseline rather
|
|
107
|
+
than announcing existing feedback. Pending updates survive reloads and clear when acknowledged
|
|
108
|
+
or no longer relevant; merge updates remain until acknowledged.
|
|
730
109
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
options for its location, so the CLI can show status in one project and not in another.
|
|
110
|
+
Forgekeeper reports failed jobs but doesn't retry or fix them. For tracked stacks, it can
|
|
111
|
+
also propose retargeting dependents after a parent merges, but never retargets or rebases itself.
|
|
734
112
|
|
|
735
|
-
|
|
113
|
+
Optionally, `automation.rules` lets exact reviewers on exact projects, such as GitLab Duo, start
|
|
114
|
+
a coding turn that prepares fixes for their feedback. It runs only on PRs/MRs you wrote, in the
|
|
115
|
+
one session that targets them, with the checkout on the source branch. A rule can require models
|
|
116
|
+
you trust with code changes. The turn uses the session's instructions and permissions, and
|
|
117
|
+
leaves changes uncommitted. In `/forge-feedback`, **Act on feedback** (Ctrl+A) starts the same
|
|
118
|
+
turn on request, and **Retry feedback work** (Ctrl+T) retries one after you inspect it.
|
|
736
119
|
|
|
737
|
-
|
|
120
|
+
See [review detection and summaries](https://github.com/pedropombeiro/opencode-plugins/blob/main/packages/forgekeeper/docs/reference.md#review-notifications),
|
|
121
|
+
[monitoring eligibility](https://github.com/pedropombeiro/opencode-plugins/blob/main/packages/forgekeeper/docs/reference.md#which-sessions-the-server-watches),
|
|
122
|
+
[stacked PRs/MRs](https://github.com/pedropombeiro/opencode-plugins/blob/main/packages/forgekeeper/docs/reference.md#stacked-prsmrs), and
|
|
123
|
+
[preparing fixes](https://github.com/pedropombeiro/opencode-plugins/blob/main/packages/forgekeeper/docs/reference.md#prepare-fixes-from-review-feedback) for details.
|
|
738
124
|
|
|
739
|
-
|
|
740
|
-
{
|
|
741
|
-
"plugins": [{ "package": "opencode-forgekeeper", "options": { "status": false } }]
|
|
742
|
-
}
|
|
743
|
-
```
|
|
125
|
+
## Options
|
|
744
126
|
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
`
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
- Sessions start in branch-based naming. Ask the agent to set their targets again.
|
|
798
|
-
- A title that kept a single-reference prefix from before, such as `[!456] Review`, now looks
|
|
799
|
-
like a reference that you wrote. Until you set a target, the status follows that PR/MR, labeled
|
|
800
|
-
"from the session title". Setting a target adds a second prefix, such as
|
|
801
|
-
`[#12, !45] [!456] Review`. Remove the older prefix by hand. Older prefixes with two
|
|
802
|
-
references, such as `[#12, !45]`, are replaced automatically.
|
|
803
|
-
- The first look at each PR/MR records a new review baseline, so comments posted before then
|
|
804
|
-
aren't announced.
|
|
805
|
-
- Callers of the RPC need the new ID, `opencode-forgekeeper`.
|
|
806
|
-
|
|
807
|
-
With default options, the footer and review monitoring start right away. All notifications
|
|
808
|
-
stay in the feedback inbox, and no session turn starts unless you set `delivery.reviews`
|
|
809
|
-
or `delivery.lifecycle` to `"summary"`. Set `status` to `false` to keep only titles.
|
|
810
|
-
|
|
811
|
-
If you set options for `opencode-forgekeeper` 2.x, also see
|
|
812
|
-
[Upgrade from forgekeeper 2.x](#upgrade-from-forgekeeper-2x).
|
|
813
|
-
|
|
814
|
-
## Code layout
|
|
815
|
-
|
|
816
|
-
- `src/index.ts` wires the server: the forge catalogs from the options, with a shared
|
|
817
|
-
concurrency limit for status, and title lookups.
|
|
818
|
-
- `src/server.ts` registers the tool, the agent guidance, title reconciliation, and the RPC.
|
|
819
|
-
- `src/status-server.ts` connects the status service to sessions, storage, notifications,
|
|
820
|
-
and RPC events. `src/status-service.ts` holds the leases and decides which keys poll.
|
|
821
|
-
- `src/target.ts` parses, normalizes, changes, and formats session targets, and matches
|
|
822
|
-
forge URLs against them.
|
|
823
|
-
- `src/limit.ts` bounds how many forge requests run at once.
|
|
824
|
-
- `src/title.ts` extracts branch issue numbers and reconciles title prefixes.
|
|
825
|
-
- `src/options.ts` reads the plugin's status options.
|
|
826
|
-
- `src/lookups.ts` answers the title's forge questions: the branch's newest PR/MR number
|
|
827
|
-
and a PR/MR's source branch.
|
|
828
|
-
- `src/status-client.ts` holds the CLI's leases, snapshots, and per-directory settings.
|
|
829
|
-
`src/tui.tsx` connects it to the RPC and renders the footer, dialog, commands, and notices.
|
|
830
|
-
`src/notice.ts` decides which notices a CLI shows and which tabs it reopens.
|
|
831
|
-
- `src/forge.ts` defines the forge-neutral types, the `Forge` adapter interface, and
|
|
832
|
-
`ForgeTraits` with its optional `automatedReview`, `feedback`, and `lifecycle`
|
|
833
|
-
capabilities.
|
|
834
|
-
- `src/adapters/gitlab/feedback.ts` and `src/adapters/github/feedback.ts` read each forge's
|
|
835
|
-
comments for its `feedback` capability.
|
|
836
|
-
- `src/adapters/gitlab/adapter.ts` and `src/adapters/github/adapter.ts` provide each forge's
|
|
837
|
-
adapter and traits. Adapters own API calls, pagination, error classification, and status
|
|
838
|
-
normalization. Traits cover
|
|
839
|
-
everything else: hosts, URL parsing, reference syntax, vocabulary, and forge-specific
|
|
840
|
-
footer and dialog content.
|
|
841
|
-
- `src/forges.ts` registers each forge's traits, classifies hosts, opens adapters, and
|
|
842
|
-
parses URLs.
|
|
843
|
-
- `src/git.ts` resolves a checkout's remotes, branch, and pushed branch name.
|
|
844
|
-
- `src/locate.ts` picks each key's PRs/MRs. `src/store.ts` caches lookups, polls, backs off
|
|
845
|
-
after failures, and discards lookups that started before a change. `src/format.ts`
|
|
846
|
-
renders the footer and dialog.
|
|
847
|
-
- `src/automated-review-watch.ts` and `src/human-review-watch.ts` decide when to notify the
|
|
848
|
-
agent.
|
|
849
|
-
- `src/review-monitoring.ts` configures the review watchers, stores their state, and records
|
|
850
|
-
review updates in the inbox.
|
|
851
|
-
- `src/lifecycle-watch.ts` finds conflicts, failed jobs, merges, and stack links between lookups, and
|
|
852
|
-
keeps each event until it reaches the inbox. `src/lifecycle-execution.ts` proposes retargets
|
|
853
|
-
of stacked PRs/MRs.
|
|
854
|
-
- `src/lifecycle-notifications.ts` formats lifecycle updates, checks retarget proposals, and
|
|
855
|
-
connects lifecycle events to the inbox. `src/feedback-cleanup.ts` identifies resolved,
|
|
856
|
-
closed, and settled updates for removal.
|
|
857
|
-
- `src/adapters/gitlab/linked-notes.ts` finds and reads the notes review comments link to.
|
|
858
|
-
- `src/summary-delivery.ts` stores and delivers summary turns, restricts their model requests,
|
|
859
|
-
and handles linked-note access. `src/review-summary.ts` formats their content.
|
|
860
|
-
- `src/keyed-queue.ts` serializes updates by session or record while allowing other keys to progress.
|
|
861
|
-
|
|
862
|
-
Shared code never compares a forge against a specific name. It asks the forge's traits, or
|
|
863
|
-
checks for a capability, instead. To add a forge, add its kind to `ForgeKind` and
|
|
864
|
-
`ReviewRequest`, implement `Forge` and `ForgeTraits`, and register the traits in
|
|
865
|
-
`src/forges.ts`.
|
|
127
|
+
Set options in the object form of the plugin entry in `opencode.json`, as in the example above.
|
|
128
|
+
Only specify values you want to change. The terminal part has no separate options.
|
|
129
|
+
|
|
130
|
+
| Option | Default | Purpose |
|
|
131
|
+
| --- | --- | --- |
|
|
132
|
+
| `status` | `true` | Set to `false` to keep only session targets and titles, without polling or notifications. |
|
|
133
|
+
| `hosts` | `["gitlab.com"]` | Additional recognized GitLab hosts, besides hosts named `gitlab.*`. |
|
|
134
|
+
| `githubHosts` | `["github.com"]` | Recognized GitHub hosts, including Enterprise. |
|
|
135
|
+
| `pollSeconds` | `120` | Normal status polling interval. |
|
|
136
|
+
| `watch.humanReviews` | `true` | Monitor human review feedback. |
|
|
137
|
+
| `watch.automatedReviews` | `true` | Monitor GitLab Duo and GitHub Copilot review feedback. |
|
|
138
|
+
| `watch.reviewBots` | `true` | Monitor configured review-bot accounts. |
|
|
139
|
+
| `watch.lifecycle` | `true` | Monitor conflicts, failed jobs, and merges. |
|
|
140
|
+
| `reviewBots` | GitLab.com security reviewers | Exact bot usernames by host. Your list replaces the defaults. |
|
|
141
|
+
| `delivery.reviews` | `"inbox"` | Review delivery: `inbox`, `passive`, or `summary`. |
|
|
142
|
+
| `delivery.lifecycle` | `"inbox"` | Conflict, job-failure, and merge delivery. |
|
|
143
|
+
| `lifecycleExecution.parentMerged` | `{ "mode": "notify" }` | Optionally prepare retarget proposals for tracked dependents. |
|
|
144
|
+
| `automation.rules` | No rules | Reviewers whose feedback starts a coding turn that prepares fixes, optionally limited to allowed models. |
|
|
145
|
+
| `automation.modelGroups` | No groups | Named lists of `provider/model` IDs that rules reference in `allowedModelGroup`. |
|
|
146
|
+
|
|
147
|
+
See the [configuration reference](https://github.com/pedropombeiro/opencode-plugins/blob/main/packages/forgekeeper/docs/reference.md#options) for validation behavior and
|
|
148
|
+
[review-bot configuration](https://github.com/pedropombeiro/opencode-plugins/blob/main/packages/forgekeeper/docs/reference.md#review-notifications) for account matching.
|
|
149
|
+
|
|
150
|
+
## Security and privacy
|
|
151
|
+
|
|
152
|
+
Monitoring reads forge data through your authenticated CLI. It doesn't modify the forge,
|
|
153
|
+
edit files, commit, push, reply to comments, or resolve discussions. Only an
|
|
154
|
+
[automation rule](https://github.com/pedropombeiro/opencode-plugins/blob/main/packages/forgekeeper/docs/reference.md#prepare-fixes-from-review-feedback)
|
|
155
|
+
or **Act on feedback** starts a coding turn that edits files, with the session's permissions.
|
|
156
|
+
That turn sends reviewer text to the model as untrusted data, keeps it in the session's
|
|
157
|
+
history, and leaves changes uncommitted.
|
|
158
|
+
|
|
159
|
+
Optional review summaries send review text to the session's model, isolated from conversation
|
|
160
|
+
history and ordinary tools. On GitLab, a restricted tool can read notes directly linked by
|
|
161
|
+
the announced comments, including private notes your credentials can access on the same host.
|
|
162
|
+
Review content is treated as untrusted data.
|
|
163
|
+
|
|
164
|
+
The inbox stores identifiers, links, and timestamps locally, not comment bodies or credentials.
|
|
165
|
+
Summary records temporarily retain review text in plugin storage. This is not OS-level
|
|
166
|
+
isolation, and the implementation has not received AppSec approval.
|
|
167
|
+
|
|
168
|
+
See the [security boundary](https://github.com/pedropombeiro/opencode-plugins/blob/main/packages/forgekeeper/docs/reference.md#monitoring-security-boundary) and
|
|
169
|
+
[summary restrictions](https://github.com/pedropombeiro/opencode-plugins/blob/main/packages/forgekeeper/docs/reference.md#summary-turns) for limits and retention details.
|
|
170
|
+
|
|
171
|
+
## Upgrading
|
|
172
|
+
|
|
173
|
+
- **From 2.x:** option names changed, and feedback now defaults to the inbox rather than
|
|
174
|
+
resuming a session. Follow the [2.x upgrade guide](https://github.com/pedropombeiro/opencode-plugins/blob/main/packages/forgekeeper/docs/reference.md#upgrade-from-forgekeeper-2x).
|
|
175
|
+
- **From `opencode-forge-session-title` or Forgekeeper 1.x:** replace the package entry.
|
|
176
|
+
Stored targets don't carry over. Follow the
|
|
177
|
+
[migration guide](https://github.com/pedropombeiro/opencode-plugins/blob/main/packages/forgekeeper/docs/reference.md#migrating-from-opencode-forge-session-title).
|
|
866
178
|
|
|
867
179
|
## Development
|
|
868
180
|
|
|
869
181
|
From the repository root:
|
|
870
182
|
|
|
871
|
-
```
|
|
183
|
+
```sh
|
|
872
184
|
mise run test
|
|
873
185
|
mise run typecheck
|
|
874
186
|
mise run lint
|
|
875
187
|
mise run build forgekeeper
|
|
876
188
|
```
|
|
877
189
|
|
|
190
|
+
The reference includes the [RPC API](https://github.com/pedropombeiro/opencode-plugins/blob/main/packages/forgekeeper/docs/reference.md#rpc) and
|
|
191
|
+
[code layout](https://github.com/pedropombeiro/opencode-plugins/blob/main/packages/forgekeeper/docs/reference.md#code-layout).
|
|
192
|
+
|
|
878
193
|
## License
|
|
879
194
|
|
|
880
|
-
[MIT](
|
|
195
|
+
[MIT](https://github.com/pedropombeiro/opencode-plugins/blob/main/LICENSE)
|