Repository navigation
feat(plugin-sdk): add thread plugin metadata - #3508
Closed
samanthar0se wants to merge 5 commits into
Closed
samanthar0se wants to merge 5 commits into
samanthar0se wants to merge 5 commits into
Conversation
added 5 commits
September 11, 2026 00:39
# Conflicts: # packages/db/drizzle/meta/0115_snapshot.json # packages/db/drizzle/meta/_journal.json # packages/db/test/migrate.test.ts
Collaborator
|
Superseded by #3555, which preserves this contribution and includes the completed maintainer review fixes and verification. Thank you @samanthar0se for the implementation. Closing this PR in favor of the successor; the work continues there and has not been merged yet.
|
SawyerHood
added a commit
that referenced
this pull request
Sep 12, 2026
## Human comments ## What was wrong Plugins need persistent per-thread JSON metadata that is available during agent configuration without automatically entering model-facing payloads. This continues @samanthar0se's implementation in #3508 and includes the review fixes: migration conflicts, SDK versioning, validation and status codes, configure snapshots, and discrepancies between the published testing fakes and production. ## What changed - Add per-plugin thread metadata namespaces, GET/PATCH routes, SDK read/update methods, and explicit spawn/fork seeds. Patches are atomic and each namespace is capped at 256 KiB. - Provide each configure callback its own deeply frozen, readonly namespace; forks inherit no metadata. Metadata stays out of ordinary thread responses and provider payloads. - Validate plugin IDs, return 400 for malformed input and 413 for an oversized merged namespace, recover corrupt rows without logging their contents, and align SDK fakes with production attribution and rejection behavior. - Regenerate the migration as 0118, bump the Plugin SDK to 0.4.86, and update Plugin Guide documentation and regression coverage. Namespaces follow ordinary thread access rules and are not an authorization boundary. The unprefixed public API names and cross-namespace access were explicitly accepted during maintainer review. No server/daemon wire fields change. Supersedes #3508, preserving the contributor's commits and adding the reviewed fixes. ## How you verified Verification recorded in the preceding review/fix thread on the unchanged final tip, `87959e5081001423da42c3cf7ec25d7a865ce9ae`: - Turbo typechecks across all affected packages passed. - DB/domain/contract/SDK suites passed: 498 / 209 / 79 / 111 tests. - Full server suite passed: 2,594 tests; 33 plugin suites using the fake host passed. - Integration tests, Drizzle regeneration, both SDK version checks, and tarball smoke passed. - Regression coverage includes first-configure seed visibility, route status codes, atomic size-limit failures, and a freeze test demonstrated to fail with freezing removed. - Prior verification noted formatter drift in unchanged main code in the migration test and SDK threads area. Commit metadata was subsequently updated to credit @samanthar0se on every PR commit; the verified source tree is unchanged. Publication checks: `git diff --check origin/main...HEAD` passed. The clean-secret-models scanner reported zero hits in working-tree, tracked@HEAD, range-added-lines, and range-commit-messages for `origin/main..HEAD`. Fixes #3438 Co-authored-by: samanthar0se <[email protected]> > AGENT GENERATED --------- Co-authored-by: samantha rose <[email protected]> Co-authored-by: samanthar0se <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This replaces the narrower launch-context design from the issue with the maintainer-proposed Thread Plugin Metadata API. Namespaces use ordinary thread access rules and are capped at 256 KiB of normalized UTF-8 JSON.
Implementation
(threadId, pluginId)with cascade deletion and immediate-transaction read/modify/write patches{}, and deep-freeze each snapshotVerification
git diff --checkpassedCloses #3438