8000 feat(plugins): add bundled session-share import plugin by blueberrycongee · Pull Request #1303 · blueberrycongee/wuu · GitHub
[go: up one dir, main page]

Skip to content

feat(plugins): add bundled session-share import plugin - #1303

Open
blueberrycongee wants to merge 3 commits into
mainfrom
feat/session-share-import
Open

blueberrycongee wants to merge 3 commits into
mainfrom
feat/session-share-import

Conversation

@blueberrycongee
@blueberrycongee blueberrycongee commented Nov 8, 2026 •
Copy link
Copy Markdown
Owner

Summary

  • Add a bundled session-share plugin that imports a reviewed SharedDocument v1 (produced by session/share/read or the owner's wuu session-share CLI) as the context seed of a new user-visible conversation, closing the "share my session context to a teammate" loop on the recipient side
  • import_shared_context validates the document (version, item kinds, roles, attachment metadata), renders it into the context-seed budget keeping the newest items, and deduplicates repeated imports via a canonical-digest request_id
  • /import-share prompt command walks the agent through the flow; a small system-prompt section marks the boundary (plugins cannot create grants; owner-side publishing stays on wuu session-share)
  • Documented in docs/{en,zh-cn}/customize/session-sharing.md

Host contract changes (fix after review)

The first revision could not create a valid session on a real host: a shared
document's session_id is foreign to the importing store, but context seeds
required a local source snapshot, and host.session.model cannot read a
user-owned calling session. 246112bd7 fixes the contract:

  • through_seq: 0 now marks a seed source as a non-local reference recorded
    only as provenance (never resolved against local history). Positive cutoffs
    keep requiring a local source session and head check. Advertised as host
    feature session.seed.external_source.v1; the plugin requires it at
    initialize so older hosts reject it cleanly.
  • Seed creates may omit provider/model when parent_session_id supplies
    the runtime selection (the pair must still be specified together). The
    import is a child of the calling session, inheriting provider, model and
    workspace binding.
  • The dedup request_id digests the canonical document plus name, intent,
    provider and model scoped by workspace: retries of one import dedup to the
    same conversation while changed arguments intentionally create a new one.
  • Document validation now mirrors sessionshare.Document.Validate: attachment
    items carry no text and declare at most 8 MiB, the compact projection caps
    at 2 MiB, session_id and intent are bounded, non-string arguments are
    rejected.
  • 11278ca01 (second review round): imported user conversations now emit
    thread/started so they appear in the sidebar without a refresh; session
    deletion no longer collects provenance-only seeds when a local session id
    collides with an external source id.

Scope notes

  • Recipient online reads over a paired remote connection and owner-side share UI are intentionally out of scope; a downloaded document is an independent copy (documented: no post-download revocation)
  • Unrelated working-tree changes on this checkout were left out of the commit

Test plan

  • node --test plugins/session-share/test/import.test.mjs — 10 tests: import contract, JSON text, provider/model pairing, malformed/out-of-contract documents, budget truncation, canonical-digest dedup, prompt capability
  • go test ./internal/session — external-source seed persists without a local source; positive cutoffs still enforce local snapshot
  • go test ./internal/appserver — seed create inherits parent runtime and replays dedup; orphan/half-pair seeds rejected (broad Seed|Handoff|Create|Plugin|Session run, 174s)
  • go test ./internal/ 8000 plugin ./internal/pluginhost, go vet
  • node scripts/bundled-plugins-e2e.mjs — all bundled plugins incl. new session-share scenario (real JSONL runtime; asserts seed shape, replay dedup, launch params, contract rejection)
  • node scripts/build-bundled-plugins.mjs --check, npm --prefix plugins run typecheck (tsc), plugin-sdk npm test, make docs-policy-check test-policy-check
  • Not exercised: the rendered imported conversation in the desktop UI

Generated with Devin

blueberrycongee and others added 3 commits November 9, 2026 01:29
A reviewed SharedDocument v1 produced by session/share/read can now be seeded into a new user-visible conversation through the import_shared_context tool or the /import-share command, so shared context can continue in the recipient workspace. The plugin validates the document, keeps the newest items within the context-seed budget, defaults provider/model to the calling session, and deduplicates repeated imports by document digest.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The bundled session-share plugin could not create a valid session on a
real host: a shared document's session_id is foreign to the importing
store, but context seeds required a local source snapshot, and seed
admission required provider/model that host.session.model cannot read
for a user-owned calling session.

- Allow through_seq 0 as an external source reference recorded only as
  provenance; positive cutoffs still require a local source session and
  head check. Advertise the semantic as host feature
  session.seed.external_source.v1 and require it from the plugin.
- Allow seed creates to omit provider/model when a parent session
  supplies the runtime selection; a half-specified pair is rejected.
- Import sessions inherit provider, model and workspace from the
  calling session through parent_session_id instead of the unauthorized
  host.session.model lookup.
- Scope the dedup request id to workspace, document and mutable args
  over canonical JSON, so retries dedup while a changed intent or model
  creates a new conversation.
- Align document validation with sessionshare.Document.Validate:
  attachment items carry no text and declare at most 8 MiB, the compact
  projection caps at 2 MiB, session_id is bounded, intent is bounded,
  and non-string arguments are rejected.
- Cover the real create path: seed persistence tests, appserver
  admission and inheritance tests, and a bundled-plugins e2e scenario.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…eeds

Follow-ups from the second review:

- A user-visible imported conversation emitted no thread/started
  notification and stayed invisible in the desktop sidebar until a full
  refresh; announce it after the create returns (seed creation keeps the
  shared notification suppressed for launch ordering).
- Session deletion collected context seeds by source id alone, so a
  local session colliding with an external source id could destroy an
  imported seed; skip provenance-only (through_seq 0) seeds.
- Assert the intent launch params in the bundled e2e scenario.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0