Skip to content

feat(providers): add reusable plugin templates with native accounts - #1897

Draft
new-Beginner wants to merge 27 commits into
vastsa:mainfrom
new-Beginner:feat/plugin-model-providers
Draft

new-Beginner wants to merge 27 commits into
vastsa:mainfrom
new-Beginner:feat/plugin-model-providers

Conversation

@new-Beginner

@new-Beginner new-Beginner commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Current-main integration update

Current head: cfc4a953446e9a2dbf4e6676eaac5a12c0ac4775.
Latest fetched main: 5aa253883c4e34fd65d31c434256d424c352bf0b.
Both main and prior PR head a2fadb33795e3b41df3656524e76c1f161ac7f27 are ancestors of this head. The existing source branch was fast-forwarded without rewriting published history. The PR remains draft; no merge, release or package publication was performed.

Integration changes

  • Resolve all four textual conflicts while retaining both branches' behavior and E2E scenarios.
  • Composer combines discovery-membership, plugin chat-capability and image-generation exclusions; saved bindings/defaults are unchanged, and republication restores only eligible configured chat models.
  • Use schema 26: main's v25 adds models.discovery_state, while the earlier PR development v25 added provider_template_bindings. Keep discovery v24→v25 before templates v25→v26, and repair template-only development v25 transactionally after backup without resetting existing discovery state or template identities.
  • Regression fixtures cover authentic v24, both v25 layouts, credentials/accounts/model preferences/sessions, readable backups and idempotent reopen. Migration tests query the actual schema version; the plugin fixture supplies main's new complete-discovery flag.
  • Synchronize the ADR and English/Chinese specifications and E2E documentation.

Verification for the current candidate

Windows/Git Bash, Node 24.19.0, pnpm 12.8.1, Rust 1.98.1; reused dependency stores/Electron, isolated mutable Host outputs and test profiles. No real accounts, production database, running-user Desktop or paid API.

  • Passed: JS build, recursive package typecheck, lint, docs checks (88 language pairs, 605 pages), agent-policy, diff whitespace and latest-main ancestry checks.
  • Passed source tests: shared 656, SDK 235, DevKit 53, i18n 31; Host Runtime 125 (3 skipped); targeted Agent provider/runtime/subagent/image suites 576; Desktop template/plugin/OAuth/chooser/discovery/Composer selection 170.
  • Passed Rust filters: db:: 41, plugins:: 124 (1 ignored), providers:: 71, turn_queue:: 12, provider_template 12. Filters overlap; do not sum them.
  • Rust formatting and Host build passed; Clippy exit 0 with four existing warnings.
  • Rerun after committing cfc4a9534: node scripts/e2e-model-discovery-state.mjs and both provider-template-native-host.e2e.mjs / provider-template-cleanup-host.e2e.mjs fixtures passed. This covers real Host → IPC → Composer discovery persistence and independent-account lifecycle / cleanup-failure quarantine with synthetic external service boundaries. Tested source fingerprints were checked against the commit.
  • Full local Host remains non-green: 1039 passed, 18 failed, 1 ignored. An independently compiled clean snapshot of the same main produced 1007 passed, the identical 18 failures, 1 ignored. Names were compared directly: data relocation (3), remote tool dispatch (2), worktree fixtures (13), including Windows path/CRLF issues. A process-only autocrlf diagnostic did not resolve them. Host artifacts were cleaned and the candidate explicitly rebuilt after the comparison to prevent cross-source Cargo cache reuse. No assertions/timeouts/skips or Git configuration were weakened.
  • Full workspace JS tests and whole-window Electron acceptance were not rerun for this integration; targeted results are not a full-suite acceptance claim. Live-provider, paid API, SAST/CVE and hostile-plugin containment limitations remain.

Current validation details and fingerprints.

New-head CI was triggered by this push. Documentation and latest-base ancestry checks passed at publication time; the remaining four checks were still running. Historical successes below apply only to their original candidate commits, not this head. Maintainer review/policy resolution is still required before landing.


Summary

Separate reusable plugin integrations from Host-owned native accounts. Installation adds an Add AI service entry, not an account. Explicit setup creates independent native accounts; official services and legacy singletons remain supported.

  • Closed V1 SDK/DevKit templates, Host-run PKCE/device OAuth and separately authorized custom OAuth/chat/image inference.
  • Host-owned UUIDs, encrypted credentials, sparse model preferences, discovery, schema-26 migration and lifecycle/source authorization. Native chat, subagent, image and tool authorization paths remain authoritative.
  • Fix uninstall cleanup failures with durable disabled cleanup-pending intent, exhaustive credential cleanup, safe observable errors and retry without grant revival.
  • Validate OAuth state and callback shape before consuming login; independently revalidate after external I/O.
  • Include interface reference, ADRs, English/Chinese specifications, regression/user-path tests and historical audit/remediation evidence. Historical defect probes retain identical bytes under probes.mjs, outside automatic product-test discovery.

Interface documentation

Plugin provider API reference: SDK exports, manifest examples, fields/limits, custom inference events, scoped credentials, identity, internal RPC/IPC, errors, lifecycle and testing.

Historical candidate and checks (before current-main integration)

Candidate: a2fadb33795e3b41df3656524e76c1f161ac7f27 (implementation 9c4093f20, native-account test fixture follow-up 38b545a6b, transcript fixture synchronization a8581f9c5, and non-destructive integration of newer main documentation; runtime sources unchanged by both follow-ups and the integration).
Base: 850a2679f34b5ae79680beb029b186daa14a906b, latest fetched origin/main, verified ancestor; pnpm check:pr-base passes.
Environment: Windows, Node 24.19.0, pnpm 12.8.1, Rust 1.98.1; reused installed dependencies, synthetic credentials only.

Publication checks previously run on implementation/native-account follow-up candidates (not rerun wholesale for the test-only transcript change):

  • pnpm build:js, Desktop typecheck and pnpm lint.
  • Agent-policy sync, committed architecture check (37 added TS/TSX files), diff whitespace check and 7 Pi patch checks.
  • Documentation check (88 English/Chinese pairs, 603 pages) and build.
  • Fresh targeted Desktop provider/template/setup/settings/session regressions after the follow-up: 169 passed. The original narrower 145-test selection overlaps and is not additional coverage.
  • Rust plugins: 124 passed, 1 ignored; template RPC/security: 11 passed. Filters overlap, not additive.
  • Rust formatting, Clippy (exit 0, four warnings) and rebuilt Host.
  • Two real Rust Host/plugin-child E2Es passed on 38b545a6b, pinned to this worktree's binary: independent accounts through use/restart/uninstall, and cleanup-failure quarantine/reload/restart/recovery.
  • Workspace execution passed SDK, shared, DevKit, i18n and other early packages. Default SDK/shared runs include src/dist duplicates, not extra unique coverage. Supplemental full Host-runtime: 125 passed, 3 skipped.

Historical local limitations / maintainer review (prior candidates)

This is a draft, not an error-free or full-suite acceptance claim.

  • Full local Rust: 1037 passed, 18 failed, 1 ignored. Failures are Windows path handling in data relocation/remote tools and Git CRLF/LF worktree fixtures in unchanged modules. Process-only Git configuration diagnostics did not resolve them. No independently executed clean-main baseline is claimed; assertions and Git configuration were not weakened.
  • pnpm -r --if-present test failed: Agent runtime had one default-5s image-worker bundle timeout (1465 passed, 1 failed, 1 skipped); that unchanged test passed isolated in 2.4s without raising its timeout. Supplemental pi-host tests: 22 passed, 35 failed, 5 skipped, including Windows socket/POSIX fixture/packaging failures. Supplemental full Desktop execution was stopped after running more than 15 minutes without exiting; partial output contains failures in remote-target subscription, logging, macOS release fixtures, timeout handling and model-catalog bindings. The isolated catalog-binding test reproduces 4 passed, 3 failed. No full-workspace-green claim.
  • Latest remote integration checks passed as recorded below; maintainer review remains required. No full-window Electron, live-vendor OAuth/paid inference, SAST/CVE certification or hostile-plugin containment claim. Trusted Node plugins are not OS sandboxes.
  • Repository policy limits outside contributions to fix/perf. This feature is accurately typed feat, not relabeled to bypass policy. Maintainer authorization/policy resolution is required before landing.

No merge, release, package publication or version bump is requested/performed.

Historical remote integration verification

On prior head 38b545a6b, GitHub merge candidate 6c38f0cfe013127de1dd988c0978ace82339e895 had tree 29752c078ed4be2e8d9eff3e9114a4274b8ecb10, identical to that locally tested head tree. JS build/typecheck/lint/architecture/full unit tests, Rust format/lint/full tests, Windows Host E2E, documentation and head/base ancestry passed. Electron failed in Long history: stream stole the reader's scroll position (scripts/e2e-transcript-render.mjs:265): failed job. This historical failure prompted the synchronization fix below; it is not erased by the earlier Electron pass on 9c4093f20.

The isolated catalog-binding check also yields the same 4 passed / 3 failed with runtime/provider-catalog.ts loaded verbatim from origin/main through a scratch-only module hook. The original test and assertions were unchanged. This is a targeted module-source comparison, not a clean-main whole-tree baseline.

First CI iteration and minimal follow-up

On implementation commit 9c4093f20, remote Rust format/lint/full tests, Windows Host E2E, Electron E2E, docs and base ancestry passed. JS build, typecheck, lint and architecture passed; the unit-test step failed in three Desktop cases. Remote Agent-runtime tests passed (1466), Host-runtime passed (128), and pi-host passed (58, 4 skipped).

The three failures were reproduced locally before the follow-up: an image-conversation fixture omitted the required plugin runtime dependency; two settings source-contract tests still asserted the pre-feature editing/toggle/deletion policy. Commit 38b545a6b supplies the external-boundary fixture and synchronizes those contracts with the approved native-account behavior, preserving official routing and legacy singleton deletion guards. No product source, assertions' expected security errors, test timeout or skip settings changed. The combined relevant regression selection passes 169 tests. The latest CI run is separate from that first-iteration evidence.

Transcript CI follow-up (a8581f9c5)

The long-history fixture recorded a supposedly stationary reading baseline while finite disclosure transitions were still running after minimap navigation. Scratch-only Chromium instrumentation reproduced that invalid precondition: the baseline-during-finite-animation assertion failed before the fix, then passed with the fix. The diagnosed trace showed follow already released and no product follow-scroll writes during this interval; this does not claim a deterministic local reproduction of the original remote assertion.

The fixture now waits for finite transitions and stable scroll/viewport geometry before the reader gesture. Infinite activity indicators do not block it. The original 2-pixel streaming-position assertion, existing timeouts, skips, product hooks and navigation behavior are unchanged. Five deterministic tests cover finite/pending motion, scroll/resize corrections, infinite/finished animations and bounded failure.

Fresh verification: pnpm build:js, Biome lint, helper TypeScript check, whitespace/base ancestry checks and 36 targeted tests passed. The isolated production long-history Electron scenario, including the additional baseline precondition, passed on committed candidate a8581f9c5 (reading offset 8991 before and after streaming). The unmodified full local transcript harness reached and passed long history but failed existing fractional-DPR status geometry assertions (51.949px versus 52px); a separate DPR=1 diagnostic instead stopped at an existing disclosure hit-target assertion. Neither full local run is reported as passing. No live Desktop/provider was used.

Historical CI on prior head a2fadb337: all six checks passed. On head a2fadb33795e3b41df3656524e76c1f161ac7f27, GitHub merge candidate 763f007fde633ed4a42d8ce69af0ade77893261b combines base 850a2679f34b5ae79680beb029b186daa14a906b with that head. Its tree 3f1ea95b6769f2f05ea035045cf78b04a54ed325 exactly matches the locally tested head. JS build/typecheck/lint/architecture/full tests, Rust format/lint/full tests, Windows Host E2E, Electron E2E, documentation and base ancestry all succeeded. The downloaded Electron result explicitly reports render, runtimeSlot, smoothText, longHistory and context-overflow recovery passing, with no phase errors. No failed CI run was retried to obtain this result. The PR remains a draft for maintainer review/policy resolution; no merge or release was performed.

Before pushing, main advanced through plugin-documentation PR #1890. Integration commit a2fadb337 preserves the shared branch history and both sides of four English/Chinese documentation conflicts (template entries/contracts plus upstream metadata clarifications). The refreshed integration passes documentation checks (88 pairs, 603 pages), documentation build, whitespace/ancestry checks, the same 36 targeted tests and isolated production long-history E2E (8991 before/after streaming). Prior whole-suite results retain their original candidate identities.

SeanLiu326 and others added 27 commits October 26, 2026 02:17
…ings

isPluginWorkspace built its containment prefix with a literal "/" and
compared spellings verbatim, but the two inputs arrive from different
worlds: the plugin folder comes from a native dialog (backslashes on
Windows) while the workspace comes from the host, which can persist a
forward-slash or //?/X:/… spelling. On Windows no plugin path ever
matched, so the bundled plugin-development skill was never offered for a
workspace a plugin was already loaded from — the manifest.json probe only
rescued the single-plugin-at-root layout.

Containment now folds both sides (separators unified, Windows verbatim
prefix stripped, case folded everywhere but Linux, like the worktree ref
folding) in a dependency-free module so its boundary behavior — sibling
prefixes like repo-x must not count — is tested directly.
Folding a bare root by trimming its trailing separators turned "/" into the empty string, so pluginWorkspaceContains("/", "/tmp/plugins/example") answered false where the prefix check it replaced answered true. Preserve the POSIX root through the fold, compare every absolute path against it directly, and cover the root cases (/ and C:/) alongside the sibling boundary.
Keep integration declarations separate from Host-owned accounts so plugin
services share native credential, model, and execution lifecycles without
replacing official services or legacy singleton contributions.

Fail closed when uninstall credential cleanup fails and authenticate OAuth
callbacks before consuming login. Include SDK and internal API reference,
lifecycle specifications, migration coverage, and synthetic regressions.
Supply the required plugin runtime boundary in the image-selection fixture\nand align settings contracts with native plugin account preferences.\nKeep official account routing and legacy singleton deletion guards covered.
Separate saved model configuration from endpoint publication state so a
previously discovered model cannot silently return to Composer through
configured-binding merging or restart hydration.

Reconcile only complete nonempty answers, retain manual ids and history,
and cover the real Host-to-IPC-to-Composer path with isolated storage.
Schema v25 adds a backed-up migration for durable publication state.

fixes vastsa#1892
The child panel rendered inside the fixed, scrollable root menu, so it was only viewport-anchored while nothing on that menu created a containing block. With one present (the reporter's build carries backdrop-filter: blur(22px) saturate(1.55)) Chromium offsets the child by the menu's own position and the menu's scrollWidth jumps from 194 to 1274, which is the reported flying panel plus horizontal scrollbar. Measured directly in Chromium: plain CSS puts the child at the expected (448,299) with no overflow; adding the reported declaration moves it to (1980,410) — exactly the menu offset (900,110). Portal the panel to the body so no ancestor of the menu can offset it, add the pointer-leave guards for the two halves of the portal, and follow the trigger through root-menu scroll and growth.
The long-history probe captured its reading baseline while minimap
navigation and finite disclosure transitions could still move the view.
Wait for completed finite motion and stable geometry before the reader
gesture, preserving the original streaming-position assertion.

Cover pending motion, scroll and resize corrections, infinite indicators,
and bounded failure with controlled frame tests.
Keep the shared PR branch current without rewriting published history.
Preserve the upstream documentation corrections alongside native-account
template contracts and their matching Chinese examples.
- allow Read/Glob/Grep to run in parallel batches while keeping Task mixed with Read/Glob/Grep sequential
- hold a same-batch parent read behind a preceding writable delegate until it settles while preserving Task's ADR 0089 non-blocking return
- coordinate shared Read against exclusive Write/Edit per path in PathMutex
- isolate delegate path-instruction preflight onto each delegate's own prompt
…ings (vastsa#1883)

Normalize plugin/workspace separator spellings while preserving filesystem roots and sibling boundaries.
)

Keep existing submenu coordinates anchored to the viewport while preserving pointer travel, actions and keyboard focus.
Separate reading ownership from the live-tail status boundary so restored current output reflects active execution without losing scroll ownership.
…stsa#1903)

* fix(delegation): keep the prompt prefix stable across settlements

The parent's system prompt carried the resumable-delegation list, and the
runtime recomposed that prompt every time a delegation settled. Transports
without mid-conversation system messages replay every system message into the
first one, so each settlement rewrote the head of the request and invalidated
the whole provider prompt cache instead of only its tail.

Move discovery to TaskList: its result now reports the resumable chains as both
text and details.resumable, while a failed resume still names the reusable ids
in its own tool error. Instructions no longer change for reasons the user did
not cause, so a long session that spawns many delegates keeps one cache
lineage.

ADR 0337 records the trade-off and supersedes ADR 0279 section 9; the runtime
spec, its zh-CN mirror, and the delegation tests follow the new read path.

* docs(adr): index ADR 0337

The docs check requires every ADR file to appear in the ADR index, so the new
record needs its row before the branch can land.
…stsa#1596)

Prepare file calls in source order, parallelize independent read batches, and preserve mixed Task/read safety and delegate prompt ownership.
…astsa#1901)

Persist endpoint publication state separately from model bindings so complete discovery results survive cache hydration and restart without erasing configuration or changing defaults.
Make resource cleanup discoverable while preserving the selected tab. Keep the work panel open after closing all tabs and release Browser resources through the existing close path.
Preserve PR vastsa#1897 and current-main discovery behavior in one merge
candidate. Combine Composer eligibility filters and migrate both
historical v25 layouts to schema 26 without changing existing accounts
or credentials.

Add compatibility regressions and record isolated validation. The full
Host suite retains the same 18 failures reproduced on the latest main
baseline; relevant migration, provider, plugin and process tests pass.

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.

5 participants