Skip to content

feat(plugins): contributed task sources, with an Azure DevOps Boards capability - #22174

Open
wizlif wants to merge 62 commits into
stablyai:mainfrom
wizlif:feat/plugin-task-source-platform
Open

wizlif wants to merge 62 commits into
stablyai:mainfrom
wizlif:feat/plugin-task-source-platform

Conversation

@wizlif

@wizlif wizlif commented Sep 22, 2026 •

Copy link
Copy Markdown

ELI5

Orca's Tasks view could only ever show the trackers Orca itself ships. This adds a way for an installed plugin to contribute its own task list — and uses that to build an Azure DevOps Boards plugin that lives in its own repo, not in Orca.

The plugin never sees your credentials. It says "fetch this path from this organization", and Orca attaches the token and checks the path against an allowlist.

What Changed

Before: Tasks offered GitHub, GitLab, Jira and Linear. Nothing else could be added without changing Orca.

After: a plugin can contribute a task source and it appears as its own tab beside the built-in ones, with a list, filters, a detail panel with comments, item creation, and Start workspace.

The mechanism, in four parts:

  1. A task-source contribution point (contributes.taskSources) plus a worker protocol — status, listScopes, listItems, getItem, listComments, addComment, listItemTypes, createItem, listFacetOptions. A plugin returns data; Orca renders it. No plugin HTML reaches the Tasks view.
  2. A host-mediated Azure DevOps Boards capability. The host owns the origin and the credential; the plugin names a method, path and body. Paths are allowlisted to wit and projects, and the guard chain is ordered because a WHATWG URL parse strips TAB/LF/CR before parsing, which defeats naive raw-string checks.
  3. Composable filter facets. status() declares facets (single/multi, optionally dynamic), the query carries a selection map, and listFacetOptions supplies per-scope options. AND across facets, OR within one. Selections persist per source.
  4. Contributed linked work items. The linked-item provider union gains one plugin member so a workspace started from a contributed item keeps its link.

Contributed sources also render their own icon, shipped as an SVG in the plugin and drawn as a CSS mask so it takes its colour from the theme rather than the plugin.

Why

The alternative was a first-party Azure DevOps provider inside Orca. That solves one tracker and leaves the next one in the same position, and it puts a vendor integration in core that core then owns forever. A contribution point costs more up front and is the thing that generalises.

Credentials are host-mediated rather than handed to the plugin because plugin-worker-env.ts already denies plugins Orca's env secrets, and handing a PAT to third-party plugin code to reuse an existing Orca configuration would undo that on purpose.

filterId/filters are kept alongside the new facet model rather than replaced: clients and remote hosts update independently, so an older client keeps sending filterId and an older host keeps sending filters.

Linked Issue

None — this was not tracked by an issue. Happy to open one if the project wants it recorded before review.

Visual Proof

Before: there was no way to add a task source, so there is no "before" state of this UI to show — the tab, the list and the panel below do not exist on main. The before/after is: these surfaces are absent, then present.

After, with an Azure DevOps Boards plugin installed:

The contributed tab sits beside the built-in trackers, icon-only like they are:

Azure tab beside GitHub and Jira

The list, grouped by state, with the facet bar, project scope picker and title search:

Work item list with facet bar

A facet open — options are read per project, so a customized workflow's own states are what you filter on:

State facet open

The detail panel: description, comments, quoted replies, and the composer:

Detail panel with comments

Start workspace, carrying the item into the composer as a linked source:

Start workspace with linked item

Captured in dark mode via Playwright over CDP against a live Azure DevOps organization. The content is substituted, not redacted — titles, people and tags are rewritten in the page before capture, consistently (one real person always maps to the same invented one, avatar initials regenerated to match). Work item numbers, states, priorities and timestamps are untouched. Full note: docs/screenshots/README.md.

Images are hosted in the plugin's own repository rather than committed here, per the template's "never add attachments to the PR files".

Testing

  • vitest across the touched areas: 4,545 passing, 1 pre-existing environmental failure (plugin-install.test.ts fails on this machine because of a global tag.gpgsign true).
  • Both typechecks clean (tsconfig.tc.web.json, tsconfig.node.json).
  • Changed-code quality gate: 0 new in every category.
  • Key behaviours were mutation-checked — the guard was inverted, the test that should catch it was confirmed to fail, then restored.
  • Verified live on macOS against two real Azure DevOps organizations: multi-org scope listing, WIQL escaping (an injected x' OR ''=' returns 0 rows rather than the whole board), comment round-tripping, facet composition (set-identical to a direct project query), and filter persistence across a restart.

Not tested: Linux, Windows, or SSH/remote. The remote path is capability-negotiated and degrades to dropping the link, but that path has unit coverage only — no real remote host.

Note: pnpm is broken in my environment, so I ran vitest/tsc/the gate through node_modules/.bin directly rather than the pnpm scripts.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

AI Disclosure

Written with Claude Code (Claude Opus 5), reviewed and verified by me.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security: the proxy path policy is the boundary — method allowlist, origin-relative, percent-encoding, traversal, colon, $batch, namespace, then normalized-pathname equality, in that order, each pinned by a test. The plugin selects among configured organizations only; an unlisted org is rejected, never defaulted.
  • Remote/SSH: contributed linked items are capability-negotiated. Against a host that predates the provider arm the workspace is still created and the link is dropped with a warning, because that host's param schema would otherwise refuse the whole create.
  • Backwards compatibility: every new contract field is optional; filterId and filters still work.
  • Performance: worth a reviewer's eye. Facet option lookups are per-scope and loadScopes is uncached, so a wide scope selection issues a lot of requests. Sensible next step is caching by content hash.

Checklist

  • This PR is small and focused — it is not. 54 commits, ~157 files. It is a platform slice plus its first consumer; splitting the contribution point from the Boards capability is possible if you'd prefer to review them separately.
  • I explained what changed and why
  • Before/after screenshots or videos attached
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • Lint, typecheck and tests pass locally (via direct binaries; see Testing)

Lets a plugin declare it contributes entries to the Tasks list. Enforces
unique ids and requires a worker entry (main), since the worker supplies
the data.
Adds invokeTaskSource/taskSourceResult messages and a taskSources field
on ready so Orca can invoke a task-source method on a plugin worker.
plugin-host-runtime.ts now reports an empty taskSources list until
worker-side registration lands in a later task.
A plugin's activate(orca) can now call orca.taskSources.register(sourceId,
implementation), the worker reports registered ids on ready, and it answers
invokeTaskSource with taskSourceResult, mirroring the invokeCommand path.
Adds invokePluginTaskSourceMethod, the single seam between the task-source
registry and the plugin worker. It looks up the source before calling the
worker, wraps callWorker so a rejection maps to unavailable instead of an
empty result, and validates the payload against the method's result schema
so a malformed response also maps to unavailable rather than partial data.
Registers a new closed-set capability kind so a later host method can
gate reads/updates to Azure Boards work items behind explicit consent.
Pure allowlist deciding what a plugin may ask the host to fetch from
Azure DevOps: GET/POST/PATCH only, origin-relative paths under
/_apis/wit or /_apis/projects, no percent-encoding, no traversal, no
caller-supplied api-version. Electron-free so desktop and relay share
one decision.
Extends the request helper with method/body/contentType so Boards
writes can send a body, and adds requestAzureDevOpsResponseAtBase to
preserve the upstream HTTP status instead of collapsing every failure
to null, so the Boards proxy can tell 401/404/429 apart.
A plugin names a method, path and body; the host runs the Boards path
policy before any fetch, injects the credential, and returns only the
upstream status and body via requestAzureDevOpsResponseAtBase so 401,
404 and 429 stay distinguishable. Missing config is 412; a transport
failure is 503, never mistaken for an empty result.
Gate it on the azure-devops:boards capability and keep it worker-only
(panel: false) since sandboxed panels have no network scope. Params
are validated by a .strict() schema built from the shared
BOARDS_PROXY_METHODS allowlist; the handler delegates to
executeBoardsProxyRequest without re-implementing its path policy.
@wizlif
wizlif marked this pull request as ready for review September 22, 2026 07:55
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: ce0fd5c8-65b3-44d3-8420-7ffb5797aeba

📥 Commits

Reviewing files that changed from the base of the PR and between bd0e554 and b14e894.

📒 Files selected for processing (6)
  • src/main/azure-devops/azure-devops-api-request.test.ts
  • src/main/azure-devops/azure-devops-api-request.ts
  • src/renderer/src/components/task-page/plugin-source/Content.test.tsx
  • src/renderer/src/components/task-page/plugin-source/Content.tsx
  • src/renderer/src/store/slices/plugin-task-sources.test.ts
  • src/renderer/src/store/slices/plugin-task-sources.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

This PR adds plugin-contributed task sources from shared contracts to the renderer UI. It adds worker protocol, plugin service invocation, IPC and RPC entry points, renderer store state, persistence, and task-page components for listing, filtering, creating, viewing, and commenting on plugin tasks. It also adds Azure DevOps Boards host methods with request policy, multi-organization base-URL handling, and a host-side proxy. Workspace linked items now support provider: 'plugin', with runtime capability gating for remote creation paths and updated compatibility documentation.

Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to b14e8

Configured HTTP Azure DevOps endpoints can receive credentials without transport encryption, and a failed filter-options request can replace filtered tasks with broader results. Resolve these behaviors before merging.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.48% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 83 functions across 56 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description is detailed and covers the requested explanation, changes, rationale, testing, visual proof, AI disclosure, security, compatibility, and performance. However, the required Linked Issue… Add a valid linked issue reference, such as “Fixes #1234,” or create and link an issue before merging. Also document build verification or state that CI will cover it if it was not run locally.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the primary changes: contributed plugin task sources and Azure DevOps Boards capability support.
Full details: Description check

Explanation

The description is detailed and covers the requested explanation, changes, rationale, testing, visual proof, AI disclosure, security, compatibility, and performance. However, the required Linked Issue section states “None,” which does not satisfy the template requirement that every PR include an issue link.

  • Fix all pre-merge checks with AI

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 0f9ece72-affc-471d-ba69-79813a84da58

📥 Commits

Reviewing files that changed from the base of the PR and between 8568d77 and 77578bf.

⛔ Files ignored due to path filters (1)
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing (156)
  • docs/reference/remote-wire-compatibility.md
  • examples/plugins/task-source-demo/main.mjs
  • examples/plugins/task-source-demo/orca-plugin.json
  • mobile/src/tasks/mobile-composer-source-types.ts
  • src/main/azure-devops/azure-devops-api-request.test.ts
  • src/main/azure-devops/azure-devops-api-request.ts
  • src/main/azure-devops/azure-devops-organization-base-urls.test.ts
  • src/main/azure-devops/azure-devops-organization-base-urls.ts
  • src/main/azure-devops/boards-proxy.test.ts
  • src/main/azure-devops/boards-proxy.ts
  • src/main/azure-devops/client.ts
  • src/main/ipc/plugins.test.ts
  • src/main/ipc/plugins.ts
  • src/main/persistence/loading-store/normalize-loaded-global-settings.ts
  • src/main/plugins/plugin-activation-coalescer.test.ts
  • src/main/plugins/plugin-activation-coalescer.ts
  • src/main/plugins/plugin-activation-reconciliation.ts
  • src/main/plugins/plugin-command-invocation.ts
  • src/main/plugins/plugin-host-conformance.test.ts
  • src/main/plugins/plugin-host-entry-path.ts
  • src/main/plugins/plugin-host-method-bindings.ts
  • src/main/plugins/plugin-host-methods.test.ts
  • src/main/plugins/plugin-host-methods.ts
  • src/main/plugins/plugin-host-process.test.ts
  • src/main/plugins/plugin-host-process.ts
  • src/main/plugins/plugin-host-runtime.test.ts
  • src/main/plugins/plugin-host-runtime.ts
  • src/main/plugins/plugin-host-service-bindings.ts
  • src/main/plugins/plugin-list-projection.test.ts
  • src/main/plugins/plugin-list-projection.ts
  • src/main/plugins/plugin-service-reconciliation.test.ts
  • src/main/plugins/plugin-service.ts
  • src/main/plugins/plugin-task-source-activation-sharing.test.ts
  • src/main/plugins/plugin-task-source-end-to-end.test.ts
  • src/main/plugins/plugin-task-source-invoker.test.ts
  • src/main/plugins/plugin-task-source-invoker.ts
  • src/main/plugins/plugin-worker-call-tracker.ts
  • src/main/plugins/plugin-worker-controller.test.ts
  • src/main/plugins/plugin-worker-controller.ts
  • src/main/plugins/plugin-worker-invocation.test.ts
  • src/main/plugins/plugin-worker-invocation.ts
  • src/main/plugins/plugin-worker-manager.test.ts
  • src/main/runtime/rpc/methods/plugins.test.ts
  • src/main/runtime/rpc/methods/plugins.ts
  • src/main/startup/main-process-plugins.ts
  • src/preload/api/plugin-host-api.ts
  • src/preload/api/plugins-bridge.ts
  • src/renderer/src/assets/main.css
  • src/renderer/src/components/new-workspace/selection-icon-plugin-source.test.tsx
  • src/renderer/src/components/new-workspace/smart-workspace-name-field-model.ts
  • src/renderer/src/components/new-workspace/smart-workspace-name-input-surface.tsx
  • src/renderer/src/components/new-workspace/smart-workspace-source-row-content.tsx
  • src/renderer/src/components/plugin-task-source-icon.tsx
  • src/renderer/src/components/settings/PluginConsentDialog.test.tsx
  • src/renderer/src/components/settings/PluginMarketplaceBrowser.test.tsx
  • src/renderer/src/components/settings/PluginSettingsRow.test.tsx
  • src/renderer/src/components/settings/PluginsSettingsSection.lifecycle.test.tsx
  • src/renderer/src/components/sidebar/folder-workspace-composer-helpers.ts
  • src/renderer/src/components/task-page-plugin-source-boundary.test.ts
  • src/renderer/src/components/task-page-source-switch-boundary.test.ts
  • src/renderer/src/components/task-page/Content.tsx
  • src/renderer/src/components/task-page/ListChrome.tsx
  • src/renderer/src/components/task-page/SourceBar.test.tsx
  • src/renderer/src/components/task-page/SourceBar.tsx
  • src/renderer/src/components/task-page/plugin-source/Content.test.tsx
  • src/renderer/src/components/task-page/plugin-source/Content.tsx
  • src/renderer/src/components/task-page/plugin-source/CreateItemDialog.test.tsx
  • src/renderer/src/components/task-page/plugin-source/CreateItemDialog.tsx
  • src/renderer/src/components/task-page/plugin-source/FacetBar.test.tsx
  • src/renderer/src/components/task-page/plugin-source/FacetBar.tsx
  • src/renderer/src/components/task-page/plugin-source/FacetPicker.tsx
  • src/renderer/src/components/task-page/plugin-source/ItemDetailCommentComposer.tsx
  • src/renderer/src/components/task-page/plugin-source/ItemDetailComments.tsx
  • src/renderer/src/components/task-page/plugin-source/ItemDetailPanel.test.tsx
  • src/renderer/src/components/task-page/plugin-source/ItemDetailPanel.tsx
  • src/renderer/src/components/task-page/plugin-source/ItemRow.test.tsx
  • src/renderer/src/components/task-page/plugin-source/ItemRow.tsx
  • src/renderer/src/components/task-page/plugin-source/List.test.tsx
  • src/renderer/src/components/task-page/plugin-source/List.tsx
  • src/renderer/src/components/task-page/plugin-source/QueryBar.test.tsx
  • src/renderer/src/components/task-page/plugin-source/QueryBar.tsx
  • src/renderer/src/components/task-page/plugin-source/ScopePicker.test.tsx
  • src/renderer/src/components/task-page/plugin-source/ScopePicker.tsx
  • src/renderer/src/components/task-page/plugin-source/SourceGroup.test.tsx
  • src/renderer/src/components/task-page/plugin-source/SourceGroup.tsx
  • src/renderer/src/components/task-page/plugin-source/comment-reply-draft.test.ts
  • src/renderer/src/components/task-page/plugin-source/comment-reply-draft.ts
  • src/renderer/src/components/task-page/plugin-source/facet-selection.test.ts
  • src/renderer/src/components/task-page/plugin-source/facet-selection.ts
  • src/renderer/src/components/task-page/plugin-source/item-detail-actions.ts
  • src/renderer/src/components/task-page/plugin-source/item-detail-load.ts
  • src/renderer/src/components/task-page/plugin-source/scope-selection.ts
  • src/renderer/src/components/task-page/plugin-source/state-grouping.test.ts
  • src/renderer/src/components/task-page/plugin-source/state-grouping.ts
  • src/renderer/src/components/task-page/plugin-source/task-state-tone.ts
  • src/renderer/src/components/task-page/plugin-source/workspace-seed.test.ts
  • src/renderer/src/components/task-page/plugin-source/workspace-seed.ts
  • src/renderer/src/hooks/composer-state/derived-model.ts
  • src/renderer/src/hooks/composer-state/issue-source-actions.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/assignee-avatar-tone.test.ts
  • src/renderer/src/lib/assignee-avatar-tone.ts
  • src/renderer/src/lib/linked-work-item-context.ts
  • src/renderer/src/lib/new-workspace.test.ts
  • src/renderer/src/store/folder-workspaces/folder-workspace-mutations.ts
  • src/renderer/src/store/index.ts
  • src/renderer/src/store/plugin-linked-item-host-support.ts
  • src/renderer/src/store/plugin-panels.test.ts
  • src/renderer/src/store/plugin-task-source-contributions.test.ts
  • src/renderer/src/store/plugin-task-source-contributions.ts
  • src/renderer/src/store/slices/folder-workspace-contributed-link-capability.test.ts
  • src/renderer/src/store/slices/plugin-task-source-bridge.ts
  • src/renderer/src/store/slices/plugin-task-source-facet-options.ts
  • src/renderer/src/store/slices/plugin-task-source-facet-query.ts
  • src/renderer/src/store/slices/plugin-task-source-selection-persistence.test.ts
  • src/renderer/src/store/slices/plugin-task-source-selection-persistence.ts
  • src/renderer/src/store/slices/plugin-task-sources-slice-contract.ts
  • src/renderer/src/store/slices/plugin-task-sources.test.ts
  • src/renderer/src/store/slices/plugin-task-sources.ts
  • src/renderer/src/store/slices/store-test-helpers.ts
  • src/renderer/src/store/slices/ui/ui-slice-contract-core.ts
  • src/renderer/src/store/slices/worktrees-remote-runtime-create.test.ts
  • src/renderer/src/store/slices/worktrees/create/create-worktree.ts
  • src/renderer/src/store/types.ts
  • src/shared/azure-devops/boards-proxy-path-policy.test.ts
  • src/shared/azure-devops/boards-proxy-path-policy.ts
  • src/shared/azure-devops/boards-proxy-status-classification.test.ts
  • src/shared/azure-devops/boards-proxy-status-classification.ts
  • src/shared/default-global-settings.ts
  • src/shared/global-settings-types.ts
  • src/shared/new-workspace/workspace-source.test.ts
  • src/shared/new-workspace/workspace-source.ts
  • src/shared/plugins/plugin-capabilities.ts
  • src/shared/plugins/plugin-consent-fingerprint.test.ts
  • src/shared/plugins/plugin-content-pack-contributions.test.ts
  • src/shared/plugins/plugin-extension-registry.test.ts
  • src/shared/plugins/plugin-extension-registry.ts
  • src/shared/plugins/plugin-host-api.ts
  • src/shared/plugins/plugin-host-protocol.test.ts
  • src/shared/plugins/plugin-host-protocol.ts
  • src/shared/plugins/plugin-manifest-contribution-validation.ts
  • src/shared/plugins/plugin-manifest.test.ts
  • src/shared/plugins/plugin-manifest.ts
  • src/shared/plugins/plugin-task-source-contract.test.ts
  • src/shared/plugins/plugin-task-source-contract.ts
  • src/shared/plugins/plugin-task-source-icon.test.ts
  • src/shared/plugins/plugin-task-source-icon.ts
  • src/shared/plugins/plugin-task-source-selection-persistence.test.ts
  • src/shared/plugins/plugin-task-source-selection-persistence.ts
  • src/shared/protocol-version.ts
  • src/shared/rpc-contract/plugins-params.ts
  • src/shared/workspace-linked-item-equality.test.ts
  • src/shared/workspace-linked-item-normalization.test.ts
  • src/shared/workspace-linked-item.ts
  • src/shared/workspace-name.ts
  • src/shared/worktree/types.ts
💤 Files with no reviewable changes (1)
  • src/main/plugins/plugin-command-invocation.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread src/main/azure-devops/boards-proxy.ts Resolved
The wit namespace also carries classificationnodes and queries, both mutating
POST endpoints. Consent to Azure DevOps Boards does not imply reshaping a
project's Boards metadata or writing stored queries. Reads stay namespace-wide.
The probe read the response to look for VssInvalidPreviewVersionException,
leaving nothing for the caller, so every Azure validation error surfaced as an
opaque 503. It now reads a clone, and cancels the original when it does retry.
A scope dropped mid-refresh stranded the facet load already in flight: its
callbacks saw a scope set that had moved on and discarded themselves, leaving
every facet on loading.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Starting a workspace from a contributed task item loses the plugin/source identity from the stored link on every create path, so the PR's own "Start workspace, carrying the item into the composer as a linked source" flow records a link it cannot resolve back to its source. The Boards proxy boundary itself held up under scrutiny; a few facet-selection and persistence rough edges follow inline.

Reviewed changes

  • Task source contribution point — contributes.taskSources, a worker protocol (invokeTaskSource / taskSourceResult / ready.taskSources), lazy activation with a shared in-flight coalescer, host-side result validation and error scrubbing, and a worker SDK orca.taskSources.register.
  • Host-mediated Azure DevOps Boards capability — azure-devops:boards gating azureDevOps.boardsRequest / boardsOrganizations, a pure path/method/organization policy, multi-organization resolution from the configured list, and status classification into the task-source error vocabulary.
  • Composable filter facets — facet declarations with per-scope dynamic options, declared defaults, selection pruning, and per-source persistence in global settings.
  • Contributed linked work items — a plugin arm on WorkspaceLinkedItem with capability-negotiated degradation to a dropped link on older hosts.
  • Tasks UI — contributed source tab and icon, grouped list, scope picker, query/facet bar, detail panel, comment composer, and create dialog.

⚠️ The contributed link loses its plugin identity on every create path

toFolderWorkspaceLinkedTask copies an explicit field list and never carries pluginKey/sourceId, so the seeded PluginWorkspaceSource — which does set them — is stripped before the create call. All three composer paths run through it, so a workspace started from a contributed item is stored as provider: 'plugin' with no source, on any host, and the source-scoped follow-ups (re-open, comments, icon resolution) have nothing to resolve against.

Technical details
# Contributed linked item identity is dropped before create

## Affected sites
- `src/renderer/src/components/sidebar/folder-workspace-composer-helpers.ts:68-77` — `toFolderWorkspaceLinkedTask` enumerates `provider/type/number/title/url` + `linearIdentifier`/`jiraIdentifier`/`repoId` only; `pluginKey`/`sourceId` are never copied.
- `src/renderer/src/hooks/composer-state/full-creation-execution.ts:178` — worktree create passes `toFolderWorkspaceLinkedTask(submitLinkedWorkItem)`.
- `src/renderer/src/components/sidebar/folder-workspace-composer-submit.ts:163` — folder create passes the same conversion.
- `src/renderer/src/hooks/composer-state/quick-creation-request.ts:63` — quick create passes the same conversion.
- `src/renderer/src/components/task-page/plugin-source/workspace-seed.ts:18-27` — seeds `buildPluginWorkspaceSource({ ..., pluginKey, sourceId })`; the fields exist up to the conversion.
- `src/shared/new-workspace/workspace-source.ts:186-187` — `buildPluginWorkspaceSource` sets them; `:257-259` reads them back for icon/selection.
- `src/shared/workspace-linked-item.ts:30-78` — `normalizeWorkspaceLinkedItem` accepts a plugin item with blank identity, so the host stores it rather than rejecting.

## Required outcome
- A workspace started from a contributed item must persist `pluginKey` and `sourceId` alongside `provider: 'plugin'`.
- `areWorkspaceLinkedItemsEqual` (`workspace-linked-item.ts:24-25`) now compares those fields, so once they survive, a stored identity-less link is correctly seen as different from the seeded one.

## Suggested approach (optional)
- Copy `pluginKey`/`sourceId` in `toFolderWorkspaceLinkedTask`, guarded the way `linearIdentifier`/`jiraIdentifier` are.
- Add a test that drives `toFolderWorkspaceLinkedTask` (or the composer submit path) with a `PluginWorkspaceSource` and asserts the created request retains them. Existing remote/folder capability tests build the linked task by hand and so bypass this conversion.

## Open questions for the human
- Should a `provider: 'plugin'` item with no `pluginKey`/`sourceId` be rejected by `normalizeWorkspaceLinkedItem` rather than accepted silently?

ℹ️ Request params reach the worker unvalidated

The contract defines request schemas per method, but nothing in production applies them: the invoker validates only the method name and then forwards params untouched, both transport schemas use z.unknown(), and the worker runtime passes message.params straight to the handler. The result half of the contract is enforced; the request half is currently test-only.

Technical details
# Task source request params are not validated anywhere

## Affected sites
- `src/main/plugins/plugin-task-source-invoker.ts:99-110` — `invokeContributedTaskSource` checks `isPluginTaskSourceMethod` then `proxy.call(input.method, input.params)`; no params parse.
- `src/main/plugins/plugin-worker-invocation.ts:63-76` — forwards `request.params` with no method→schema lookup.
- `src/shared/plugins/plugin-host-protocol.ts:36-42` — `pluginWorkerInvokeTaskSourceSchema.params: z.unknown().optional()`.
- `src/main/plugins/plugin-host-runtime.ts:183-196` — `const handler = implementation?.[message.method]; await handler(message.params)`.
- `src/shared/rpc-contract/plugins-params.ts:23-28` and `src/main/ipc/plugins.ts` `invokeTaskSourceArgsSchema` — `params: z.unknown().optional()`.
- `src/shared/plugins/plugin-task-source-contract.ts:198-250` — `pluginTaskQuerySchema`, `pluginTaskCreateSchema`, `pluginTaskPatchSchema`, `pluginTaskItemTypeQuerySchema`, `pluginTaskFacetOptionQuerySchema` reference nothing outside `plugin-task-source-contract.test.ts`.

## Required outcome
- Either the host validates params against the per-method request schema before dispatching to the worker (so a malformed renderer/IPC call is a `validation` envelope, not a plugin-side surprise), or the request schemas are removed and the contract comment at `:276-277` scoped to results only.

## Open questions for the human
- Is the worker intentionally the only params validator (each plugin must be defensive), or was wiring the request schemas missed?

ℹ️ Update paths gate only the older linked-item capability

The create path calls resolveHostSupportedLinkedWorkItem for contributed items and drops the link on a host that predates the plugin arm, but updateFolderWorkspace (and the worktree set path) gate only the Jira-era capability and send linkedTask/linkedWorkItem raw. Against a host that advertises the context capability but not the plugin arm, a plugin link in an update is a value the param schema refuses, which fails the whole update rather than degrading.

Technical details
# Update-path capability gate does not cover the plugin linked-item arm

## Affected sites
- `src/renderer/src/store/folder-workspaces/folder-workspace-mutations.ts:136-146` — only `provider === 'jira'` asserts `WORKTREE_LINKED_WORK_ITEM_CONTEXT_RUNTIME_CAPABILITY`; `:152-162` sends `updates` (including `linkedTask`) without `resolveHostSupportedLinkedWorkItem`.
- `src/renderer/src/store/slices/worktrees/metadata/worktree-meta-persist.ts:99-111` — the `worktree.set` path has the same Jira-only guard.
- Contrast `folder-workspace-mutations.ts:79-86` (`createFolderWorkspace`) and the worktree create site, which do call `resolveHostSupportedLinkedWorkItem`.
- `docs/reference/remote-wire-compatibility.md` calls out `worktree.set` alongside the create methods.

## Required outcome
- The update paths should take the same degrade decision as create: drop a contributed link (with the existing warning) when the target host lacks the plugin arm, rather than let the param schema reject the whole update.

## Open questions for the human
- No current UI affordance was found that writes a plugin linked item through `worktree.set`/`folderWorkspace.update`, so this may be latent. If so, closing it is still cheap insurance given the doc names the method.

ℹ️ Nitpicks

  • plugin-task-source-facet-options.ts:128-129 — pluginTaskSourceSeededFacetIds records a facet as seeded once, so a declared default that a scope change pruned away is not re-applied when the user returns to a scope that offers it. The flag cannot tell "the user cleared this" from "another scope pruned it".
  • src/main/plugins/plugin-host-method-bindings.ts:52-59 — the PluginHostServices.azureDevOpsBoardsRequest parameter type omits contentType, though the handler forwards it. Runtime works via structural typing; the interface under-describes the wire.
  • examples/plugins/task-source-demo/main.mjs — getItem returns { ok: true, data: item } where item lacks the detail schema's optional fields; fine for the fixture, but the sample is the copy-paste template for plugin authors.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 41b1f3ce-ebde-40ff-b340-da5eac0b49cb

📥 Commits

Reviewing files that changed from the base of the PR and between 77578bf and bd0e554.

📒 Files selected for processing (6)
  • src/main/azure-devops/azure-devops-api-request.test.ts
  • src/main/azure-devops/azure-devops-api-request.ts
  • src/renderer/src/store/slices/plugin-task-sources.test.ts
  • src/renderer/src/store/slices/plugin-task-sources.ts
  • src/shared/azure-devops/boards-proxy-path-policy.test.ts
  • src/shared/azure-devops/boards-proxy-path-policy.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/main/azure-devops/azure-devops-api-request.test.ts
  • src/shared/azure-devops/boards-proxy-path-policy.test.ts
  • src/shared/azure-devops/boards-proxy-path-policy.ts
  • src/main/azure-devops/azure-devops-api-request.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ The delta is clean. This review covers only the three commits pushed after the previous review; earlier findings were not re-evaluated and remain open.

Reviewed changes (since 77578bf)

  • Facet options reload after a scope drop — loadPluginTaskSourceScopes now calls loadPluginTaskSourceFacetOptions when retainOfferedScopeIds drops a scope, so a facet load whose callbacks self-discard on the moved-on scope set no longer leaves every facet stuck on loading. Two tests pin the reload and the no-op case.
  • Boards writes narrowed to named wit routes — new WIT_WRITE_ROUTES limits non-GET requests to wiql, workitems/$<type>, workitems/<id>/comments, and workitems/<id>, so POST/PATCH can no longer reshape classificationnodes (area/iteration structure) or stored queries. Reads remain namespace-wide, and apiSuffix strips the optional project segment so both spellings match. The route patterns are anchored and tested against the encoded create form.
  • A non-preview 400 keeps its body — shouldRetryWithPreviewApiVersion now reads response.clone(), and the retry path cancels the replaced response. A 400 that is not a preview rejection is still handed to requestAzureDevOpsResponseAtBase with its body intact, so the proxy classifies Azure's validation message instead of an opaque 503.

The route-narrowing change is a genuine tightening of the boundary, and I could not find a bypass: the earlier guards already force new URL(path).pathname === path, reject encoded separators/traversal/control characters, and match the namespace on both raw and decoded forms, so the anchored route regexes see the exact string that is sent.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

A same-origin redirect would carry the request, credential and all, to a path
the Boards proxy policy already checked and no longer governs. Matches the
redirect: 'error' the repo's other sensitive clients already pin.
The scope drop went through a raw set, so it never reached settings: the next
launch restored the retired scope and dropped it again, forever.

A scope change also loads items and facet options in the same commit, so the
items request carried the previous project's option ids, which the source
refuses outright. Only facets whose options have settled for the scope on
screen are sent; a selection whose options failed is kept, not discarded.
The items load has the same stranding as the facet load: its stale guard
returns without clearing pluginTaskSourceLoading, so a scope dropped mid-flight
left the list spinning. It now reloads alongside the facets.

Holding back unsettled facets also needed a way back: when a selection survives
the new scope the prune is a no-op, so nothing reloaded the list and it stayed
unfiltered while the chip still claimed the filter.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The delta closes the three prior findings, but the new facet-settling gate also drops a restored filter from the first list load, so the persisted-filters feature no longer applies on startup or on first selection.

Reviewed changes (since bd0e55484c)

  • Refused credentialed redirects — fetchWithApiVersionRetry pins redirect: 'error', so a same-origin redirect cannot carry a validated Boards request (and its credential) to a path outside the policy; a test asserts the option reaches fetch.
  • Persisted a scope drop — loadPluginTaskSourceScopes routes the retained scope ids through setPluginTaskSourceScopeIds, the only writer that reaches settings, so a retired project is not restored and dropped again on every launch.
  • Gated facetSelections on settled options — buildListQuery sends only facets whose options are ready for the scope on screen, closing the scope-change race where the previous project's option ids reached listItems.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — the previous must-address finding is resolved; one minor efficiency suggestion inline.

Reviewed changes (since c6929da3bd)

  • Reloaded the list once facets settle — Content.tsx derives facetsSettled and adds it to the items effect deps, so a filter that survives a scope change (where the prune is a no-op and query never changes) is applied after the options land. This resolves the regression from the previous review: a persisted filter now reaches listItems.
  • Reloaded items and facet options after a scope drop — loadPluginTaskSourceScopes now reloads both, so the in-flight items load that discards itself on the stale guard no longer leaves the list spinner on. A test pins the spinner clearing.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues in this delta. It is a clean fix to the prior review's inline suggestion, and its test fails without it.

Reviewed changes (since cf57aaaa29)

  • Dropped the redundant unfiltered list load — Content.tsx now treats "no facets declared yet" as unsettled (facets.length > 0 && …) instead of vacuously settled, so the arrival of the declarations no longer flips facetsSettled and fires a second unfiltered listItems; a source that declares no facets simply never re-runs on it.
  • Pinned the call count — the new Content.test.tsx case counts listItems calls from mount until the filtered load lands and asserts at most two; reverting the predicate yields three.

This review is scoped to the delta and is not an approval — the earlier open items raised against the initial review are unchanged by these commits.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

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