From 18d6c27ea8c42dd642cb2373027e5374a57ae900 Mon Sep 17 00:00:00 2001 From: NagyVikt Date: Sat, 25 Apr 2026 15:56:07 +0200 Subject: [PATCH] Keep Active Agents in its VS Code container VS Code rejects activity bar container identifiers that contain dots, which caused the Active Agents contribution to fall back into Explorer and left the focus command targeting a container that was never registered. The live and template manifests now use a hyphenated container id while the existing view id stays unchanged. Constraint: VS Code view container ids allow only alphanumeric characters, underscore, and hyphen Rejected: Rename the gitguardex.activeAgents view id | wider command/menu/test churn was unnecessary Confidence: high Scope-risk: narrow Directive: Keep live and template Active Agents manifests and focus commands in sync when changing VS Code contribution ids Tested: node --test test/vscode-active-agents-session-state.test.js Tested: npm test Tested: node scripts/install-vscode-active-agents-extension.js --- .../.openspec.yaml | 2 ++ .../notes.md | 25 +++++++++++++++++++ .../vscode/guardex-active-agents/extension.js | 2 +- .../vscode/guardex-active-agents/package.json | 4 +-- ...vscode-active-agents-session-state.test.js | 7 +++--- vscode/guardex-active-agents/extension.js | 2 +- vscode/guardex-active-agents/package.json | 4 +-- 7 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 openspec/changes/agent-codex-fix-active-agents-view-container-id-2026-04-25-15-48/.openspec.yaml create mode 100644 openspec/changes/agent-codex-fix-active-agents-view-container-id-2026-04-25-15-48/notes.md diff --git a/openspec/changes/agent-codex-fix-active-agents-view-container-id-2026-04-25-15-48/.openspec.yaml b/openspec/changes/agent-codex-fix-active-agents-view-container-id-2026-04-25-15-48/.openspec.yaml new file mode 100644 index 0000000..1b75776 --- /dev/null +++ b/openspec/changes/agent-codex-fix-active-agents-view-container-id-2026-04-25-15-48/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-04-25 diff --git a/openspec/changes/agent-codex-fix-active-agents-view-container-id-2026-04-25-15-48/notes.md b/openspec/changes/agent-codex-fix-active-agents-view-container-id-2026-04-25-15-48/notes.md new file mode 100644 index 0000000..a9b2268 --- /dev/null +++ b/openspec/changes/agent-codex-fix-active-agents-view-container-id-2026-04-25-15-48/notes.md @@ -0,0 +1,25 @@ +# agent-codex-fix-active-agents-view-container-id-2026-04-25-15-48 (minimal / T1) + +Branch: `agent/codex/fix-active-agents-view-container-id-2026-04-25-15-48` + +Fix the VS Code Active Agents view container registration. VS Code rejects contributed activity bar container IDs containing dots, so the companion extension must use an alphanumeric/underscore/hyphen-only container ID while preserving the existing `gitguardex.activeAgents` view ID and commands. + +Scope: +- Update live and template Active Agents manifests to use `gitguardex-active-agents-container`. +- Update the focus command target to `workbench.view.extension.gitguardex-active-agents-container`. +- Add regression coverage for the container ID character constraint and focus command target. + +Verification: +- `node --test test/vscode-active-agents-session-state.test.js` +- Manifest parity check covered by the focused test. + +## Handoff + +- Handoff: change=`agent-codex-fix-active-agents-view-container-id-2026-04-25-15-48`; branch=`agent/codex/fix-active-agents-view-container-id-2026-04-25-15-48`; scope=`vscode/guardex-active-agents/package.json, templates/vscode/guardex-active-agents/package.json, paired extension.js focus command, test/vscode-active-agents-session-state.test.js`; action=`replace invalid dotted view-container id, verify focused extension test, then finish via PR merge + cleanup`. +- Copy prompt: Continue `agent-codex-fix-active-agents-view-container-id-2026-04-25-15-48` on branch `agent/codex/fix-active-agents-view-container-id-2026-04-25-15-48`. Work inside the existing sandbox, keep live/template VS Code extension files in sync, and when verification is clean run `gx branch finish --branch agent/codex/fix-active-agents-view-container-id-2026-04-25-15-48 --base main --via-pr --wait-for-merge --cleanup`. + +## Cleanup + +- [ ] Run: `gx branch finish --branch agent/codex/fix-active-agents-view-container-id-2026-04-25-15-48 --base main --via-pr --wait-for-merge --cleanup` +- [ ] Record PR URL + `MERGED` state in the completion handoff. +- [ ] Confirm sandbox worktree is gone (`git worktree list`, `git branch -a`). diff --git a/templates/vscode/guardex-active-agents/extension.js b/templates/vscode/guardex-active-agents/extension.js index 1b70667..463dd80 100644 --- a/templates/vscode/guardex-active-agents/extension.js +++ b/templates/vscode/guardex-active-agents/extension.js @@ -3587,7 +3587,7 @@ function activate(context) { vscode.commands.registerCommand('gitguardex.activeAgents.refresh', refresh), vscode.commands.registerCommand('gitguardex.activeAgents.restart', restartActiveAgents), vscode.commands.registerCommand('gitguardex.activeAgents.focus', async () => { - await vscode.commands.executeCommand('workbench.view.extension.gitguardex.activeAgentsContainer'); + await vscode.commands.executeCommand('workbench.view.extension.gitguardex-active-agents-container'); }), vscode.commands.registerCommand('gitguardex.activeAgents.commitSelectedSession', commitSelectedSession), vscode.commands.registerCommand('gitguardex.activeAgents.openWorktree', async (session) => { diff --git a/templates/vscode/guardex-active-agents/package.json b/templates/vscode/guardex-active-agents/package.json index 894cc7d..dcf89ba 100644 --- a/templates/vscode/guardex-active-agents/package.json +++ b/templates/vscode/guardex-active-agents/package.json @@ -79,14 +79,14 @@ "viewsContainers": { "activitybar": [ { - "id": "gitguardex.activeAgentsContainer", + "id": "gitguardex-active-agents-container", "title": "Active Agents", "icon": "media/active-agents-hivemind.svg" } ] }, "views": { - "gitguardex.activeAgentsContainer": [ + "gitguardex-active-agents-container": [ { "id": "gitguardex.activeAgents", "name": "Active Agents", diff --git a/test/vscode-active-agents-session-state.test.js b/test/vscode-active-agents-session-state.test.js index ff89201..ce990fd 100644 --- a/test/vscode-active-agents-session-state.test.js +++ b/test/vscode-active-agents-session-state.test.js @@ -1308,13 +1308,14 @@ test('active-agents manifest uses a dedicated activity bar container with a hive const manifest = readExtensionManifest(); const activitybarContainers = manifest.contributes.viewsContainers?.activitybar || []; const activeAgentsContainer = activitybarContainers.find( - (entry) => entry.id === 'gitguardex.activeAgentsContainer', + (entry) => entry.id === 'gitguardex-active-agents-container', ); assert.ok(activeAgentsContainer, 'Expected the Active Agents activity bar container.'); + assert.match(activeAgentsContainer.id, /^[A-Za-z0-9_-]+$/); assert.equal(activeAgentsContainer.title, 'Active Agents'); assert.equal(activeAgentsContainer.icon, 'media/active-agents-hivemind.svg'); - const activeAgentsViews = manifest.contributes.views?.['gitguardex.activeAgentsContainer'] || []; + const activeAgentsViews = manifest.contributes.views?.['gitguardex-active-agents-container'] || []; assert.deepEqual(activeAgentsViews, [ { id: 'gitguardex.activeAgents', @@ -1540,7 +1541,7 @@ test('active-agents focus command opens the dedicated sidebar container', async assert.equal( registrations.executedCommands.some((entry) => ( - entry.command === 'workbench.view.extension.gitguardex.activeAgentsContainer' + entry.command === 'workbench.view.extension.gitguardex-active-agents-container' )), true, ); diff --git a/vscode/guardex-active-agents/extension.js b/vscode/guardex-active-agents/extension.js index 1b70667..463dd80 100644 --- a/vscode/guardex-active-agents/extension.js +++ b/vscode/guardex-active-agents/extension.js @@ -3587,7 +3587,7 @@ function activate(context) { vscode.commands.registerCommand('gitguardex.activeAgents.refresh', refresh), vscode.commands.registerCommand('gitguardex.activeAgents.restart', restartActiveAgents), vscode.commands.registerCommand('gitguardex.activeAgents.focus', async () => { - await vscode.commands.executeCommand('workbench.view.extension.gitguardex.activeAgentsContainer'); + await vscode.commands.executeCommand('workbench.view.extension.gitguardex-active-agents-container'); }), vscode.commands.registerCommand('gitguardex.activeAgents.commitSelectedSession', commitSelectedSession), vscode.commands.registerCommand('gitguardex.activeAgents.openWorktree', async (session) => { diff --git a/vscode/guardex-active-agents/package.json b/vscode/guardex-active-agents/package.json index 894cc7d..dcf89ba 100644 --- a/vscode/guardex-active-agents/package.json +++ b/vscode/guardex-active-agents/package.json @@ -79,14 +79,14 @@ "viewsContainers": { "activitybar": [ { - "id": "gitguardex.activeAgentsContainer", + "id": "gitguardex-active-agents-container", "title": "Active Agents", "icon": "media/active-agents-hivemind.svg" } ] }, "views": { - "gitguardex.activeAgentsContainer": [ + "gitguardex-active-agents-container": [ { "id": "gitguardex.activeAgents", "name": "Active Agents",