Skip to content

feat(portal): gate VS Code extensions on agent capability - #1463

Open
Cedric Vidal (cedricvidal) wants to merge 1 commit into
mainfrom
cedricvidal-vscode-extensions-gating
Open

Cedric Vidal (cedricvidal) wants to merge 1 commit into
mainfrom
cedricvidal-vscode-extensions-gating

Conversation

@cedricvidal

@cedricvidal Cedric Vidal (cedricvidal) commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

VS Code Extensions support in the Portal was gated by an extensions feature flag. It showed up even when no registered agent could actually use extensions. This PR makes agent capability the only deciding factor. Extensions UI is shown only while at least one available agent declares capabilities.supportsExtensions: true. The same rule applies in both strict and compatibility modes.

  • Capability helpers (types.ts): agentSupportsExtensions(agent) and hasExtensionCapableAgent(agents), exposed through a new useExtensionsSupport() hook.
  • Nav (Layout.tsx): the Extensions item is hidden unless an extension-capable agent exists.
  • Routes (ExtensionsRoute.tsx, App.tsx): /extensions, /extensions/:id and preview redirect away when no agent is capable. This replaces the FeatureRoute featureKey="extensions" guard.
  • Forms: Submit Run, Resubmit (RunsList.tsx), New Profile and New Profile Version show extension pickers only for a selected agent that supports extensions.
  • Feature flag removed: the API no longer seeds extensions in defaultFlags. Migration 031-remove-extensions-feature-flag deletes existing flag documents (down() restores it) and is registered in required-migrations.ts.

Worth noting for review:

  • Every agent.yaml in the repo currently declares supportsExtensions: false. Once this merges, Extensions UI stays hidden everywhere until an agent opts in.
  • In Resubmit with mixed workers there is no single effective agent, so "Choose extensions..." is hidden. When the agent can't be determined, the picker stays hidden.

Demos

Walkthrough (about 98 s, three parts). The second agent is a mock agent registered through the local API for demo purposes only.

  1. Only GitHub Copilot CLI is registered and doesn't support extensions. Extensions is hidden in the nav, /extensions redirects to Statistics, and neither Submit Run nor New Profile shows an Extensions section.
  2. A mock agent declaring supportsExtensions: true registers with the API.
  3. Extensions appears in the nav, on /extensions, in Submit Run and in New Profile. Switching back to Copilot CLI hides the Submit Run section again.

Before

Part 1 of the walkthrough below (no extension-capable agent: Extensions hidden everywhere).

After

walkthrough.mp4

Testing

  • pnpm --filter portal test (targeted: types.test.ts, Layout.test.tsx, ExtensionsRoute.test.tsx): 33 passed
  • pnpm --filter portal test + pnpm --filter db-migrations test (full suites): 588 passed
  • pnpm --filter api test (agent endpoints + OpenAPI): 227 passed
  • Typecheck (tsc --noEmit) for portal, db-migrations and api: clean
  • Manual: local stack (API + portal + Mongo), verified the hidden/shown states end to end while recording the walkthrough

Documentation and compatibility

  • Updated docs/architecture/app-design.md (capability gating), docs/architecture/db.md and docs/architecture/db-migrations.md (migration 031), and website/.../guides/importing-extensions.mdx (requires an extension-capable agent).
  • Compatibility: the extensions feature flag is removed. Run migrations (pnpm migrate:up) to clean up the existing flag document; Admin no longer shows the toggle. No API contract changes.

Checklist

  • If Portal features changed, keep CLI capabilities in sync. (N/A: the CLI never used the extensions flag.)
  • If Portal components changed, update their Storybook stories. (N/A: no visual component changes, only visibility gating.)
  • If database changes require a migration, include up() / down() and keep it CosmosDB-compatible.
  • If dependencies changed, update the lockfile and regenerate NOTICE / NOTICE-REVIEW.txt with pnpm notice as needed. (N/A)
  • Video showing the behavior before the suggested change
  • Video showing the behavior after the suggested change

Extensions UI (nav item, /extensions routes, Submit Run, Resubmit,
profile forms) is now shown only when at least one available agent
declares capabilities.supportsExtensions, independent of strict mode.

The "extensions" feature flag is removed: dropped from the API seed and
deleted from existing databases by migration 031.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added type: documentation Documentation additions, corrections, and improvements. area: infrastructure Cloud resources, hosting, networking, and shared infrastructure. language: javascript Work involving JavaScript code, tooling, or dependencies. area: portal Scope web portal, pages, and user-facing components. topic: testing Test coverage, test infrastructure, and validation quality. topic: ui Portal, visual presentation, layout, and interface components. labels Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #196

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
3197 3197 0 0 0 0 0 1m28s

🎉 All tests passed!

Github Test Reporter

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

area: infrastructure Cloud resources, hosting, networking, and shared infrastructure. area: portal Scope web portal, pages, and user-facing components. language: javascript Work involving JavaScript code, tooling, or dependencies. topic: testing Test coverage, test infrastructure, and validation quality. topic: ui Portal, visual presentation, layout, and interface components. type: documentation Documentation additions, corrections, and improvements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants