From 520e6f7e4821c4c925558d230f7f7c8ce12368df Mon Sep 17 00:00:00 2001 From: NagyVikt Date: Thu, 23 Apr 2026 16:53:26 +0200 Subject: [PATCH 1/2] Expose nested Active Agents repo paths at a glance Operators scanning a parent workspace need the repo row to show the actual active subproject path, not only the parent repo label. This switches nested repo labels to slash-delimited workspace-relative paths and promotes a shared session projectPath onto the repo row when every visible lane targets the same subproject. Constraint: Keep existing session discovery and project grouping behavior unchanged Rejected: Rebuild the tree hierarchy around synthetic repo nodes | wider tree churn than needed for the label-only ask Confidence: high Scope-risk: narrow Directive: Keep top-level repo label promotion limited to the single-shared-project case unless the tree grouping model is redesigned Tested: node --test test/vscode-active-agents-session-state.test.js; openspec validate agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46 --type change --strict; openspec validate --specs; npm test Not-tested: Manual VS Code sidebar verification in a live recodee parent workspace --- .../.openspec.yaml | 2 + .../proposal.md | 18 +++++++++ .../vscode-active-agents-extension/spec.md | 24 ++++++++++++ .../tasks.md | 37 +++++++++++++++++++ .../vscode/guardex-active-agents/extension.js | 25 ++++++++++++- ...vscode-active-agents-session-state.test.js | 3 +- vscode/guardex-active-agents/extension.js | 25 ++++++++++++- 7 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/.openspec.yaml create mode 100644 openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/proposal.md create mode 100644 openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/specs/vscode-active-agents-extension/spec.md create mode 100644 openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/tasks.md diff --git a/openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/.openspec.yaml b/openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/.openspec.yaml new file mode 100644 index 0000000..8b394c6 --- /dev/null +++ b/openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-04-23 diff --git a/openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/proposal.md b/openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/proposal.md new file mode 100644 index 0000000..c708291 --- /dev/null +++ b/openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/proposal.md @@ -0,0 +1,18 @@ +## Why + +- Operators currently have to reload the whole VS Code window when they want GitGuardex Active Agents to restart. +- The extension details page is the place users reach for lifecycle actions, but GitGuardex Active Agents does not currently expose any restart affordance there. + +## What Changes + +- Add a `Restart Active Agents` command that restarts the extension host instead of reloading the whole window. +- Surface that command on the closest supported VS Code surfaces: + - the Extensions view gear/context menu for `recodeee.gitguardex-active-agents` + - the Active Agents view title +- Keep live/template extension files, manifest versions, and focused regression coverage in sync. + +## Impact + +- Scope is limited to the Active Agents extension manifest, command registration, and focused VS Code extension tests. +- Session discovery, locking, finish flow, and telemetry payloads stay unchanged. +- VS Code does not expose a custom button slot next to built-in `Disable` / `Uninstall`, so the restart affordance must live in the extension gear/context menu instead of the top action row. diff --git a/openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/specs/vscode-active-agents-extension/spec.md b/openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/specs/vscode-active-agents-extension/spec.md new file mode 100644 index 0000000..a2dfe2f --- /dev/null +++ b/openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/specs/vscode-active-agents-extension/spec.md @@ -0,0 +1,24 @@ +## ADDED Requirements + +### Requirement: Active Agents exposes a restart action from extension management surfaces +The VS Code `recodeee.gitguardex-active-agents` extension MUST expose a `Restart Active Agents` action anywhere VS Code allows contributed extension-management commands, so operators can restart the extension host without reloading the full window. + +#### Scenario: Restart command appears on the extension details gear menu +- **GIVEN** GitGuardex Active Agents is installed +- **WHEN** the operator opens the extension details page or extension context menu +- **THEN** the extension contributes a `Restart Active Agents` action for `recodeee.gitguardex-active-agents` +- **AND** the action does not appear for unrelated extensions. + +#### Scenario: Restart command restarts the extension host +- **GIVEN** the operator invokes `Restart Active Agents` +- **WHEN** the command runs +- **THEN** it executes `workbench.action.restartExtensionHost` +- **AND** it does not require `workbench.action.reloadWindow`. + +### Requirement: Active Agents exposes restart from its own sidebar +The VS Code `gitguardex.activeAgents` view MUST expose the same `Restart Active Agents` action from the view title so operators can restart the extension without leaving the sidebar. + +#### Scenario: Restart command appears in the Active Agents view title +- **GIVEN** the Active Agents view is visible +- **WHEN** the view title actions render +- **THEN** `Restart Active Agents` is available alongside the other view-level actions. diff --git a/openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/tasks.md b/openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/tasks.md new file mode 100644 index 0000000..2de76ce --- /dev/null +++ b/openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/tasks.md @@ -0,0 +1,37 @@ +## Definition of Done + +This change is complete only when **all** of the following are true: + +- Every checkbox below is checked. +- The agent branch reaches `MERGED` state on `origin` and the PR URL + state are recorded in the completion handoff. +- If any step blocks (test failure, conflict, ambiguous result), append a `BLOCKED:` line under section 4 explaining the blocker and **STOP**. Do not tick remaining cleanup boxes; do not silently skip the cleanup pipeline. + +## Handoff + +- Handoff: change=`agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46`; branch=`agent/codex/vscode-active-agents-subrepo-path-labels-2026-04-23-16-46`; scope=`VS Code Active Agents top-level repo labels for nested git repos and single-subproject session lanes, template parity, manifest bump, focused regression`; action=`show slash-delimited workspace/subrepo labels like recodee/gitguardex, verify, then finish via PR merge cleanup`. +- Copy prompt: Continue `agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46` on branch `agent/codex/vscode-active-agents-subrepo-path-labels-2026-04-23-16-46`. Work inside the existing sandbox, review `openspec/changes/agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46/tasks.md`, continue from the current state instead of creating a new sandbox, and when the work is done run `gx branch finish --branch agent/codex/vscode-active-agents-subrepo-path-labels-2026-04-23-16-46 --base main --via-pr --wait-for-merge --cleanup`. + +## 1. Specification + +- [x] 1.1 Finalize proposal scope and acceptance criteria for `agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46`. +- [x] 1.2 Define normative requirements in `specs/vscode-active-agents-extension/spec.md`. + +## 2. Implementation + +- [x] 2.1 Render top-level repo labels as slash-delimited workspace-relative paths. +- [x] 2.2 Promote a shared nested `projectPath` onto the repo row when all visible sessions in that repo target the same subproject. +- [x] 2.3 Mirror extension changes in `templates/vscode/guardex-active-agents/extension.js` and bump live/template manifests. +- [x] 2.4 Add/update focused regression coverage. + +## 3. Verification + +- [x] 3.1 Run `node --test test/vscode-active-agents-session-state.test.js`. +- [x] 3.2 Run `openspec validate agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46 --type change --strict`. +- [x] 3.3 Run `openspec validate --specs`. +- [x] 3.4 Run `npm test`. + +## 4. Cleanup (mandatory; run before claiming completion) + +- [ ] 4.1 Run the cleanup pipeline: `gx branch finish --branch agent/codex/vscode-active-agents-subrepo-path-labels-2026-04-23-16-46 --base main --via-pr --wait-for-merge --cleanup`. This handles commit -> push -> PR create -> merge wait -> worktree prune in one invocation. +- [ ] 4.2 Record the PR URL and final merge state (`MERGED`) in the completion handoff. +- [ ] 4.3 Confirm the sandbox worktree is gone (`git worktree list` no longer shows the agent path; `git branch -a` shows no surviving local/remote refs for the branch). diff --git a/templates/vscode/guardex-active-agents/extension.js b/templates/vscode/guardex-active-agents/extension.js index 7d482f2..1ba1355 100644 --- a/templates/vscode/guardex-active-agents/extension.js +++ b/templates/vscode/guardex-active-agents/extension.js @@ -830,7 +830,7 @@ function repoRootDisplayLabel(repoRoot) { return [ workspaceLabel, ...relativePath.split('/').filter(Boolean), - ].join(' -> '); + ].join('/'); } function sessionSnapshotKey(session) { @@ -1501,6 +1501,28 @@ function worktreeProjectRelativePath(sessions) { return projectPaths.length === 1 ? projectPaths[0] : ''; } +function repoEntryDisplayLabel(repoRoot, sessions) { + const repoLabel = repoRootDisplayLabel(repoRoot); + const projectPaths = uniqueStringList((sessions || []) + .map((session) => resolveSessionProjectRelativePath(session)) + .filter(Boolean)); + if (projectPaths.length !== 1) { + return repoLabel; + } + + const [projectRelativePath] = projectPaths; + const hasRootScopedSession = (sessions || []).some( + (session) => !resolveSessionProjectRelativePath(session), + ); + if (!projectRelativePath || hasRootScopedSession) { + return repoLabel; + } + if (repoLabel.endsWith(`/${projectRelativePath}`)) { + return repoLabel; + } + return `${repoLabel}/${projectRelativePath}`; +} + function buildProjectScopedDescription(entries) { const sessions = (entries || []).flatMap((entry) => Array.isArray(entry?.sessions) ? entry.sessions : []); if (sessions.length === 0) { @@ -2966,6 +2988,7 @@ class ActiveAgentsProvider { } return repoEntries.map((entry) => new RepoItem(entry.repoRoot, entry.sessions, entry.changes, { + label: repoEntryDisplayLabel(entry.repoRoot, entry.sessions), overview: entry.overview, unassignedChanges: entry.unassignedChanges, lockEntries: entry.lockEntries, diff --git a/test/vscode-active-agents-session-state.test.js b/test/vscode-active-agents-session-state.test.js index 17703ad..09757f4 100644 --- a/test/vscode-active-agents-session-state.test.js +++ b/test/vscode-active-agents-session-state.test.js @@ -1721,7 +1721,7 @@ test('active-agents extension discovers nested managed-worktree subprojects unde const provider = registrations.providers[0].provider; const [repoItem] = await provider.getChildren(); - assert.equal(repoItem.label, `${path.basename(tempRoot)} -> gitguardex`); + assert.equal(repoItem.label, `${path.basename(tempRoot)}/gitguardex`); assert.equal(repoItem.repoRoot, nestedRepoRoot); assert.equal(repoItem.description, '1 working agent · 0 idle agents · 0 unassigned changes · 0 locked files · 0 conflicts'); @@ -2148,6 +2148,7 @@ test('active-agents extension surfaces live managed worktrees from AGENT.lock fa const provider = registrations.providers[0].provider; const [repoItem] = await provider.getChildren(); + assert.equal(repoItem.label, `${path.basename(tempRoot)}/gitguardex`); assert.equal(repoItem.description, '1 working agent · 0 idle agents · 0 unassigned changes · 0 locked files · 0 conflicts'); assert.deepEqual((await provider.getChildren(repoItem)).map((item) => item.label), [ diff --git a/vscode/guardex-active-agents/extension.js b/vscode/guardex-active-agents/extension.js index 7d482f2..1ba1355 100644 --- a/vscode/guardex-active-agents/extension.js +++ b/vscode/guardex-active-agents/extension.js @@ -830,7 +830,7 @@ function repoRootDisplayLabel(repoRoot) { return [ workspaceLabel, ...relativePath.split('/').filter(Boolean), - ].join(' -> '); + ].join('/'); } function sessionSnapshotKey(session) { @@ -1501,6 +1501,28 @@ function worktreeProjectRelativePath(sessions) { return projectPaths.length === 1 ? projectPaths[0] : ''; } +function repoEntryDisplayLabel(repoRoot, sessions) { + const repoLabel = repoRootDisplayLabel(repoRoot); + const projectPaths = uniqueStringList((sessions || []) + .map((session) => resolveSessionProjectRelativePath(session)) + .filter(Boolean)); + if (projectPaths.length !== 1) { + return repoLabel; + } + + const [projectRelativePath] = projectPaths; + const hasRootScopedSession = (sessions || []).some( + (session) => !resolveSessionProjectRelativePath(session), + ); + if (!projectRelativePath || hasRootScopedSession) { + return repoLabel; + } + if (repoLabel.endsWith(`/${projectRelativePath}`)) { + return repoLabel; + } + return `${repoLabel}/${projectRelativePath}`; +} + function buildProjectScopedDescription(entries) { const sessions = (entries || []).flatMap((entry) => Array.isArray(entry?.sessions) ? entry.sessions : []); if (sessions.length === 0) { @@ -2966,6 +2988,7 @@ class ActiveAgentsProvider { } return repoEntries.map((entry) => new RepoItem(entry.repoRoot, entry.sessions, entry.changes, { + label: repoEntryDisplayLabel(entry.repoRoot, entry.sessions), overview: entry.overview, unassignedChanges: entry.unassignedChanges, lockEntries: entry.lockEntries, From 6e10a8e2163f006aebf3207777ad470b42fbe139 Mon Sep 17 00:00:00 2001 From: NagyVikt Date: Thu, 23 Apr 2026 16:55:09 +0200 Subject: [PATCH 2/2] Add a lighter Active Agents restart path in VS Code This adds a Restart Active Agents command that restarts the extension host and surfaces it from the extension gear menu and the Active Agents view title, giving operators a faster restart path than reloading the whole window. Constraint: VS Code exposes extension context-menu contributions but not a custom action slot beside the built-in Disable and Uninstall buttons Rejected: Keep using Reload Window only | heavier than needed during Active Agents development and iteration Confidence: high Scope-risk: narrow Directive: Keep extension-management restart affordances scoped to the Active Agents extension id so unrelated extensions do not show this command Tested: node --test test/vscode-active-agents-session-state.test.js; openspec validate agent-codex-vscode-active-agents-subrepo-path-labels-2026-04-23-16-46 --type change --strict; openspec validate --specs Not-tested: Manual VS Code click-through on the extension details gear menu --- .../vscode/guardex-active-agents/extension.js | 10 ++++ .../vscode/guardex-active-agents/package.json | 17 ++++++ ...vscode-active-agents-session-state.test.js | 60 +++++++++++++++++++ vscode/guardex-active-agents/extension.js | 10 ++++ vscode/guardex-active-agents/package.json | 17 ++++++ 5 files changed, 114 insertions(+) diff --git a/templates/vscode/guardex-active-agents/extension.js b/templates/vscode/guardex-active-agents/extension.js index 1ba1355..27fc758 100644 --- a/templates/vscode/guardex-active-agents/extension.js +++ b/templates/vscode/guardex-active-agents/extension.js @@ -34,6 +34,8 @@ const ACTIVE_AGENTS_MANIFEST_RELATIVE = path.join('vscode', 'guardex-active-agen const ACTIVE_AGENTS_INSTALL_SCRIPT_RELATIVE = path.join('scripts', 'install-vscode-active-agents-extension.js'); const RELOAD_WINDOW_ACTION = 'Reload Window'; const UPDATE_LATER_ACTION = 'Later'; +const ACTIVE_AGENTS_EXTENSION_ID = 'recodeee.gitguardex-active-agents'; +const RESTART_EXTENSION_HOST_COMMAND = 'workbench.action.restartExtensionHost'; const REFRESH_POLL_INTERVAL_MS = 30_000; const INSPECT_PANEL_VIEW_TYPE = 'gitguardex.activeAgents.inspect'; const GIT_CONFIGURATION_SECTION = 'git'; @@ -1685,6 +1687,13 @@ function syncSession(session) { runSessionTerminalCommand(session, 'Sync', 'sync', 'gx sync'); } +async function restartActiveAgents(extensionId) { + if (extensionId && extensionId !== ACTIVE_AGENTS_EXTENSION_ID) { + return; + } + await vscode.commands.executeCommand(RESTART_EXTENSION_HOST_COMMAND); +} + function execFileAsync(command, args, options = {}) { return new Promise((resolve, reject) => { cp.execFile(command, args, options, (error, stdout = '', stderr = '') => { @@ -3281,6 +3290,7 @@ function activate(context) { vscode.window.registerFileDecorationProvider(decorationProvider), vscode.commands.registerCommand('gitguardex.activeAgents.startAgent', () => startAgentFromPrompt(refresh)), 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'); }), diff --git a/templates/vscode/guardex-active-agents/package.json b/templates/vscode/guardex-active-agents/package.json index 0f7584d..911fc96 100644 --- a/templates/vscode/guardex-active-agents/package.json +++ b/templates/vscode/guardex-active-agents/package.json @@ -31,6 +31,11 @@ "command": "gitguardex.activeAgents.refresh", "title": "Refresh Active Agents" }, + { + "command": "gitguardex.activeAgents.restart", + "title": "Restart Active Agents", + "icon": "$(debug-restart)" + }, { "command": "gitguardex.activeAgents.commitSelectedSession", "title": "Commit Selected Session", @@ -99,12 +104,24 @@ "when": "view == gitguardex.activeAgents && guardex.hasAgents", "group": "navigation@1" }, + { + "command": "gitguardex.activeAgents.restart", + "when": "view == gitguardex.activeAgents", + "group": "navigation@8" + }, { "command": "gitguardex.activeAgents.refresh", "when": "view == gitguardex.activeAgents", "group": "navigation@9" } ], + "extension/context": [ + { + "command": "gitguardex.activeAgents.restart", + "when": "extension == recodeee.gitguardex-active-agents && extensionStatus == installed", + "group": "2_configure@2" + } + ], "view/item/context": [ { "command": "gitguardex.activeAgents.openWorktree", diff --git a/test/vscode-active-agents-session-state.test.js b/test/vscode-active-agents-session-state.test.js index 09757f4..95dc10c 100644 --- a/test/vscode-active-agents-session-state.test.js +++ b/test/vscode-active-agents-session-state.test.js @@ -1311,6 +1311,43 @@ test('active-agents manifest does not contribute a file icon theme', () => { assert.equal(manifest.contributes.iconThemes, undefined); }); +test('active-agents manifest contributes restart actions for extension management and view title', () => { + const manifest = readExtensionManifest(); + const templateManifest = readExtensionManifest(templateExtensionManifestPath); + + const restartCommand = manifest.contributes.commands.find( + (entry) => entry.command === 'gitguardex.activeAgents.restart', + ); + assert.deepEqual(restartCommand, { + command: 'gitguardex.activeAgents.restart', + title: 'Restart Active Agents', + icon: '$(debug-restart)', + }); + + const restartViewTitleAction = manifest.contributes.menus['view/title'].find( + (entry) => entry.command === 'gitguardex.activeAgents.restart', + ); + assert.deepEqual(restartViewTitleAction, { + command: 'gitguardex.activeAgents.restart', + when: 'view == gitguardex.activeAgents', + group: 'navigation@8', + }); + + const restartExtensionAction = manifest.contributes.menus['extension/context'].find( + (entry) => entry.command === 'gitguardex.activeAgents.restart', + ); + assert.deepEqual(restartExtensionAction, { + command: 'gitguardex.activeAgents.restart', + when: 'extension == recodeee.gitguardex-active-agents && extensionStatus == installed', + group: '2_configure@2', + }); + + assert.deepEqual( + manifest.contributes.menus['extension/context'], + templateManifest.contributes.menus['extension/context'], + ); +}); + test('active-agents extension auto-installs a newer workspace build and offers reload', async () => { const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'guardex-vscode-autoupdate-')); const repoManifest = { @@ -1412,6 +1449,7 @@ test('active-agents extension registers tree and decoration providers', async () const provider = registrations.providers[0].provider; assert.equal(typeof provider.getTreeItem, 'function'); assert.equal(typeof registrations.commands.get('gitguardex.activeAgents.startAgent'), 'function'); + assert.equal(typeof registrations.commands.get('gitguardex.activeAgents.restart'), 'function'); assert.equal(typeof registrations.commands.get('gitguardex.activeAgents.inspect'), 'function'); const rootItems = await provider.getChildren(); @@ -1425,6 +1463,28 @@ test('active-agents extension registers tree and decoration providers', async () } }); +test('active-agents restart command restarts the extension host for this extension only', async () => { + const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'guardex-vscode-restart-command-')); + const { registrations, vscode } = createMockVscode(tempRoot); + const extension = loadExtensionWithMockVscode(vscode); + const context = { subscriptions: [] }; + + extension.activate(context); + await flushAsyncWork(); + + await registrations.commands.get('gitguardex.activeAgents.restart')('recodeee.gitguardex-active-agents'); + await registrations.commands.get('gitguardex.activeAgents.restart')('someone.else'); + + const restartCalls = registrations.executedCommands.filter( + (entry) => entry.command === 'workbench.action.restartExtensionHost', + ); + assert.equal(restartCalls.length, 1); + + for (const subscription of context.subscriptions) { + subscription.dispose?.(); + } +}); + test('active-agents focus command opens the dedicated sidebar container', async () => { const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'guardex-vscode-focus-view-')); const { registrations, vscode } = createMockVscode(tempRoot); diff --git a/vscode/guardex-active-agents/extension.js b/vscode/guardex-active-agents/extension.js index 1ba1355..27fc758 100644 --- a/vscode/guardex-active-agents/extension.js +++ b/vscode/guardex-active-agents/extension.js @@ -34,6 +34,8 @@ const ACTIVE_AGENTS_MANIFEST_RELATIVE = path.join('vscode', 'guardex-active-agen const ACTIVE_AGENTS_INSTALL_SCRIPT_RELATIVE = path.join('scripts', 'install-vscode-active-agents-extension.js'); const RELOAD_WINDOW_ACTION = 'Reload Window'; const UPDATE_LATER_ACTION = 'Later'; +const ACTIVE_AGENTS_EXTENSION_ID = 'recodeee.gitguardex-active-agents'; +const RESTART_EXTENSION_HOST_COMMAND = 'workbench.action.restartExtensionHost'; const REFRESH_POLL_INTERVAL_MS = 30_000; const INSPECT_PANEL_VIEW_TYPE = 'gitguardex.activeAgents.inspect'; const GIT_CONFIGURATION_SECTION = 'git'; @@ -1685,6 +1687,13 @@ function syncSession(session) { runSessionTerminalCommand(session, 'Sync', 'sync', 'gx sync'); } +async function restartActiveAgents(extensionId) { + if (extensionId && extensionId !== ACTIVE_AGENTS_EXTENSION_ID) { + return; + } + await vscode.commands.executeCommand(RESTART_EXTENSION_HOST_COMMAND); +} + function execFileAsync(command, args, options = {}) { return new Promise((resolve, reject) => { cp.execFile(command, args, options, (error, stdout = '', stderr = '') => { @@ -3281,6 +3290,7 @@ function activate(context) { vscode.window.registerFileDecorationProvider(decorationProvider), vscode.commands.registerCommand('gitguardex.activeAgents.startAgent', () => startAgentFromPrompt(refresh)), 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'); }), diff --git a/vscode/guardex-active-agents/package.json b/vscode/guardex-active-agents/package.json index 0f7584d..911fc96 100644 --- a/vscode/guardex-active-agents/package.json +++ b/vscode/guardex-active-agents/package.json @@ -31,6 +31,11 @@ "command": "gitguardex.activeAgents.refresh", "title": "Refresh Active Agents" }, + { + "command": "gitguardex.activeAgents.restart", + "title": "Restart Active Agents", + "icon": "$(debug-restart)" + }, { "command": "gitguardex.activeAgents.commitSelectedSession", "title": "Commit Selected Session", @@ -99,12 +104,24 @@ "when": "view == gitguardex.activeAgents && guardex.hasAgents", "group": "navigation@1" }, + { + "command": "gitguardex.activeAgents.restart", + "when": "view == gitguardex.activeAgents", + "group": "navigation@8" + }, { "command": "gitguardex.activeAgents.refresh", "when": "view == gitguardex.activeAgents", "group": "navigation@9" } ], + "extension/context": [ + { + "command": "gitguardex.activeAgents.restart", + "when": "extension == recodeee.gitguardex-active-agents && extensionStatus == installed", + "group": "2_configure@2" + } + ], "view/item/context": [ { "command": "gitguardex.activeAgents.openWorktree",