Plugin system (1/8): thread ownership#3725
Conversation
Threads carry an owner (user or plugin:<id>); plugin-owned threads are hidden from user-facing projections, activity relays, and client thread state. Includes migration 033 and the decider/projector/read-model wiring. Claude-Session: https://claude.ai/code/session_011H86UHL1RPuWBX3LBTUPsk
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5f24c87. Configure here.
ApprovabilityVerdict: Needs human review Foundational PR for plugin system (1/8) introducing thread ownership concept, new database schema, filtering logic to hide plugin threads from user views, and relay integration. New feature infrastructure warrants human review. You can customize Macroscope's approvability policy. Learn more. |
Clients could send thread.create with owner=plugin:* via the client wire union and forge a hidden thread. Add an owner-less ClientThreadCreateCommand and use it in the client-facing unions; owner stays server-injected. Claude-Session: https://claude.ai/code/session_011H86UHL1RPuWBX3LBTUPsk
|
Fixed in |

What Changed
Adds
projection_threads.owner(default'user', migration 033) so that agent threads created by plugins are attributable and can be filtered out of user-facing surfaces. User-facing snapshots / lists / relay / the live shell stream filter touser-owned threads; the command read model deliberately sees every thread (the decider must, to validate and replay). Nothing plugin-specific ships in this part — it stands on its own.Extending t3code today means forking it. This is part 1 of 8 of a small, dependency-ordered stack that adds a runtime plugin system: install third-party features (server + web/Electron) at runtime behind curated, capability-scoped host APIs — no fork required. Thread ownership is the foundation: once plugins can spawn agent threads, those threads need to be attributable so they don't pollute the user's thread list. This piece is useful and mergeable on its own even if none of the later parts land.
A deliberate goal here is to take pressure off the core. Right now, anyone who wants to customize t3code has to fork it or try to land their feature upstream — which is exactly the stream of unwanted-feature PRs this repo asks people not to open. A plugin system gives that energy somewhere else to go: contributors ship their customizations as installable plugins instead of PRs, so maintainers field fewer feature requests they have to decline and the core stays lean. The intent is to make this the last large feature you have to review — after it, most "can you add X" turns into "ship X as a plugin."
The full project — which parts deliver what
The repo asks for small, focused PRs, so the plugin system is submitted as 8 dependency-ordered PRs. Merge bottom-up (each later part's diff is cumulative against
mainuntil its parent merges — GitHub can't base a fork PR on a fork branch; parts 2–8 are drafts blocked on their parent):@t3tools/plugin-sdkFeature → parts that must be merged:
Example plugin
These APIs are proven by porting a substantial existing feature — a board-as-state-machine workflow engine, 46 RPC methods — into a standalone installable plugin built entirely on the capabilities in this series: 👉 https://github.com/ccdwyer/workflow-boards-plugin (distributed separately, not in these PRs).
Review
Beyond the automated PR bots, every part was reviewed pre-submission by a four-model tribunal — GPT-5.5, Grok, GLM-5.2, and Fable — each reading the slice's final content and tracing execution rather than the diff alone, which surfaced a batch of real issues (SSRF-via-redirect, a credential leak, a cross-client visibility leak, an interrupt-safety bug, and ~25 more) that are all fixed. Findings addressed in this part:
thread.createowner-trust (MUST): a client could forge a hidden plugin-owned thread → the client-facing wire union now uses an owner-less command;owneris server-injected only.latestTurnrehydration gap + owner-grammar drift.UI Changes
N/A — this part is server + contracts only.
Checklist
https://claude.ai/code/session_011H86UHL1RPuWBX3LBTUPsk