Skip to content

plugins: triage the Codex findings that arrived after #2 merged #172

Closed

Description

@ibetitsmike

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

# 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

Related to #2.

Found by a read-only review of fork main that listed the unresolved review threads of every merged PR.

Activity

  1. added
    followup
    needs-triage
    on Nov 11, 2026
  2. ibetitsmike commented on Nov 11, 2026

    @ibetitsmike
    OwnerAuthor

    Xum (AI agent) triaged this on behalf of @ibetitsmike.

    Lead triage under the plan's scope rule (drop races, abnormal environments, cosmetic or defensive-only fixes):

    # Thread Verdict
    1 rotate encrypted plugin configs Fixed by #142 (#122). Reply with the link and resolve.
    2 strip Coder credentials before invoking plugins Accept. Before forwarding a webhook request to a plugin, strip the Coder session cookie, Coder-Session-Token, Authorization, and the query token. A browser that opens the webhook URL on the Coder origin sends the session cookie.
    3 route replies only to the link bound to the chat Accept. One user with two linked identities on one plugin is a normal setup. Deliver to the link whose active_chat_id is the chat.
    4 run the expired link-code cleanup Covered by #167.
    5 validate plugin webhook status codes Drop: a misbehaving plugin. The server recovers the panic as a 500.
    6 retire consumed link codes Drop: cosmetic, and the code clears itself when it expires.
    7 keep polling through transient errors Accept. One failed poll stops linking until a reload, and transient errors are normal.
    8 serialize link-code mutations across plugins Drop: double-click race.
    9 make link-code replacement atomic Drop: concurrent-request race.
    10 scope link-code hashes by plugin Drop: needs thousands of stored codes, and a collision fails the insert, so the user retries.
    11 reject installs beyond the runner limit Drop: more than 50 enabled plugins is an abnormal deployment.

    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.

  3. removed
    needs-triage
    on Nov 11, 2026
  4. ibetitsmike commented on Nov 11, 2026

    @ibetitsmike
    OwnerAuthor

    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.

    Xum (AI agent) commented on behalf of @ibetitsmike.

  5. ibetitsmike commented on Nov 11, 2026

    @ibetitsmike
    OwnerAuthor

    Fork follow-ups status: two more PRs are open.

    Xum posted this update on behalf of @ibetitsmike.

  6. ibetitsmike commented on Nov 11, 2026

    @ibetitsmike
    OwnerAuthor

    Xum posted this status update on Mike's behalf.

    Status of the follow-ups:

  7. ibetitsmike commented on Nov 11, 2026

    @ibetitsmike
    OwnerAuthor

    Xum posted this status update on Mike's behalf.

    Status of the follow-ups:

  8. ibetitsmike commented on Nov 11, 2026

    @ibetitsmike
    OwnerAuthor

    Xum posted this status update on Mike's behalf.

    #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    followup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions