Repository navigation
Description
Xum (AI agent) opened this on behalf of @ibetitsmike.
Problem
#2 (chat plugins, +14457/-129, the largest PR in the fork) merged without a Codex verdict. Codex's summary comment on #2 was created 6 seconds after the merge, and its review of the merged head followed 17 minutes after the merge with 11 findings. None of them was ever answered: every thread has only the Codex comment and is unresolved.
The merge bar in the workstream issues asks for "a clean Codex verdict, or Codex findings that were all fixed or dropped under the scope rule", and "no unresolved threads" (for example the Rules table in #8, row "Merge"). #2 was merged outside the plan (#4, "Outside the plan"), and that bar was not applied to it.
One of the 11 findings was found again independently and fixed: the dbcrypt gap became #122 and #142. The code behind the other ten is unchanged on main, and nobody has decided whether each is a real defect or a drop. The plugin code is on main, behind the plugins experiment.
Evidence
- feat: add chat plugins backed by a chatd fork node #2: last commit
a35c726759at 2026-11-09T01:56:48Z, merged 2026-11-09T02:19:17Z, Codex review submitted 2026-11-09T02:36:47Z (gh pr view 2 --json mergedAt,reviews,commits). reviewThreadson feat: add chat plugins backed by a chatd fork node #2: 11 threads, allisResolved: false, each with 1 comment.- I read the code behind each thread on
mainatce90b5bb74. The column "When it is reached" is my reading, to help triage; it is not a verdict.
| # | Thread | Codex | Still on main? |
When it is reached |
|---|---|---|---|---|
| 1 | plugins.up.sql:23, rotate encrypted plugin configs |
P1 | Fixed by #142 (#122) | Thread only needs a reply and to be resolved |
| 2 | coderd/x/plugins/runner.go:330, strip Coder credentials before invoking plugins |
P1 | Yes. webhook passes req.URL.RequestURI() and every request header to the plugin (runner.go:329-330) |
When the request to the unauthenticated webhook route carries a Coder session cookie, header or query token. Nothing in site/ or cli/ sends one; a signed-in person who calls the webhook from their own client or browser session does |
| 3 | coderd/x/plugins/delivery.go:104, route replies only to the link bound to the chat |
P2 | Yes. deliverChat sends each event to every link of the chat owner (delivery.go:101) and then sets the active chat on all of them (:115) |
When one user links two external identities to the same plugin. The plugin_user_links.active_chat_id column comment says "Chat that last spoke to the external identity. Replies go to this chat." |
| 4 | coderd/database/forkdb/queries/plugins.sql:104, run the expired link-code cleanup |
P2 | Yes. DeleteExpiredPluginLinkCodes has no production caller |
Always, with a small effect: at most one expired row for each user and plugin in normal use |
| 5 | coderd/plugins.go:700, validate plugin webhook status codes |
P2 | Yes. rw.WriteHeader(resp.StatusCode) takes the plugin's status as is |
When a plugin returns a status outside 100 to 999 |
| 6 | LinkedAccountsPage.tsx:49, retire consumed link codes |
P2 | Yes. getUnusedLinkCodes infers use from the set of external IDs |
When an already linked account uses a new code, or a new link is unlinked again. The page then shows a spent code until it expires |
| 7 | LinkedAccountsPage.tsx:68, keep polling through transient errors |
P2 | Yes. refetchInterval returns false once state.error is set |
After one failed poll while a code is waiting |
| 8 | LinkedAccountsPage.tsx:106, serialize link-code mutations across plugins |
P2 | Yes. One shared mutation, only the last plugin's button is disabled | When a user clicks two plugins' buttons before the first request returns |
| 9 | coderd/plugins.go:517, make link-code replacement atomic |
P2 | Yes. Delete then insert in one transaction, no unique constraint on (plugin_id, user_id) |
When the same user sends two create requests at the same time |
| 10 | plugins.up.sql:54, scope link-code hashes by plugin |
P2 | Yes. code_hash is the primary key of plugin_link_codes |
When two stored codes collide across plugins, which needs thousands of stored codes |
| 11 | coderd/x/plugins/manager.go:104, reject installs beyond the runner limit |
P2 | Yes. Installs are not limited, and the manager leases at most MaxPlugins plugins (defaultMaxPlugins = 50, manager.go:35) |
When more than 50 plugins are enabled |
Acceptance
- Each of the 11 threads on feat: add chat plugins backed by a chatd fork node #2 has a reply and is resolved: a link to the fix, or a one-line reason for the drop under the scope rule, as for every other PR.
- A finding that is accepted gets its own
followupissue or fix PR. Thread 4 is already covered by chore(coderd/database/forkdb): three fork queries have no production caller #167.
Related to #2.
Found by a read-only review of fork main that listed the unresolved review threads of every merged PR.
Activity
ibetitsmike commentedon Nov 11, 2026
Lead triage under the plan's scope rule (drop races, abnormal environments, cosmetic or defensive-only fixes):
Coder-Session-Token,Authorization, and the query token. A browser that opens the webhook URL on the Coder origin sends the session cookie.active_chat_idis the chat.Accepted items 2, 3 and 7 get a fix PR. Every #2 thread gets a reply (fix link or the drop reason above) and is resolved.
ibetitsmike commentedon Nov 11, 2026
PR A (thread 2: strip Coder credentials before plugin webhook forwarding) is open as draft #186 at 190c69e; test-audited (negative control proven), fork-ci running, Codex loop next, dev-build UAT in flight.
fix(coderd/x/plugins): keep plugin-owned Authorization on webhook for…
fix(coderd/x/plugins): deliver plugin events only to the active link
ibetitsmike commentedon Nov 11, 2026
Fork follow-ups status: two more PRs are open.
UpdateChatWakeupRunStatus, and a purge-count afterDeleteExpiredPluginLinkCodes); the tests now express the same semantics without the removed queries.deliverChatnow routes to the link whose active chat matches the event's chat; the by-user active-chat update had no callers left and is removed with its query. A new routing test drives a two-link fixture through the bridge plugin and fails against the pre-fix behavior.plugintest.BuildWasm, which shells out togo buildwithout observing the context; a cold CI build outlasted the deadline beforeLoadbegan. Fix 4699448 builds first, then starts the clock; the same ordering fix is in fix(coderd/x/plugins): deliver plugin events only to the active link #197. CI reruns are in flight.ibetitsmike commentedon Nov 11, 2026
Status of the follow-ups:
4699448cca. UAT passed. The plugin webhook gets noCoder-Session-Tokenheader, no session cookie and no token query parameter, and the plugin's ownAuthorization, unrelated cookies, other query parameters and the body all arrive unchanged. Ready to merge.15694d0f1d. UAT passed: a fresh database migrates cleanly, the plugin installs and serves webhooks, and the server ran a 60 s soak with no errors from this change. Ready to merge.LinkedAccountsPagelink code poll fix comes next as a separate PR.fix(coderd/x/plugins): strip Coder credentials before plugin webhook …
ibetitsmike commentedon Nov 11, 2026
Status of the follow-ups:
LinkedAccountsPagekeeps polling for a new link after a failed fetch): merged.723e45d415, CI is green, Codex is clean, and every review thread is resolved.plugin_chat_bindings.deliveredflag records that. A chat a plugin started never moves to another link.(plugin_id, active_chat_id). The other adds thedeliveredflag, and every binding that exists at upgrade counts as delivered.fix(coderd/x/plugins): deliver plugin events only to the active link (#…
ibetitsmike commentedon Nov 11, 2026
#197 merged as 7fda649, after UAT passed at 723e45d. Every item in this issue is done: #186, #194, #199 and #197 are merged, and the #2 threads are answered and resolved. Closing.