Skip to content

Commit 175f70c

Browse files
committed
fix: repair sidebar agent actions
1 parent f96ecd6 commit 175f70c

11 files changed

Lines changed: 126 additions & 22 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to this project are documented here. The format is based on
55

66
## [Unreleased]
77

8+
## [1.0.2] - 2026-07-18
9+
10+
### Fixed
11+
12+
- Fixed the grouped sidebar actions so Launch, Favorite, Update, and Setup Guide consistently receive
13+
the selected agent instead of the surrounding tree node.
14+
- Removed launch commands from the virtual Agent Doctor report so command-line credentials cannot be
15+
reproduced in its Markdown table.
16+
817
## [1.0.1] - 2026-07-18
918

1019
### Changed

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ authors:
55
- family-names: Gasperini
66
given-names: Michael
77
url: "https://github.com/TheStreamCode/super-cli"
8-
version: "1.0.1"
8+
version: "1.0.2"
99
license: MIT

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ defined explicitly for Windows, macOS, and Linux; WSL deliberately selects the L
6666
**Super CLI: Manage Built-in Agents**. Hiding a favorite safely clears the favorite selection.
6767
- **Agent Doctor.** Run an explicit, bounded local diagnostic to see detected CLI versions and
6868
missing or failing version checks. It does not perform network update checks and its report omits
69-
environment variables, credentials, `PATH` contents, and captured command output.
69+
environment variables, `PATH` contents, launch commands, and raw diagnostic output. The report is
70+
a single read-only virtual document that is replaced on every run and is never written to disk.
7071
- **Agent-specific artwork.** Built-ins use vendor-sourced CLI marks where suitable SVGs are
7172
available, with a documented compact fallback for Kimi and a ThemeIcon fallback for custom agents.
7273
- **Built-in presets.** Claude Code, Codex, GitHub Copilot CLI, Cursor, Droid, Grok, Kilo, Kiro,
@@ -220,6 +221,9 @@ This extension does not collect telemetry, analytics, or personal data. It never
220221
modifies shell profiles; it only runs launch and user-requested update commands in your integrated
221222
terminal, plus bounded version commands when you explicitly run Agent Doctor.
222223

224+
Keep credentials in each CLI's supported credential store or environment configuration rather than
225+
embedding them directly in launch, update, or version command strings.
226+
223227
## Brand assets
224228

225229
The Router S combines the Super CLI initial with two directional command paths. The artwork is kept

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Super CLI: Claude Code, Codex & AI Agent Launcher",
44
"description": "Launch Claude Code, Codex CLI, Copilot CLI, Google Antigravity, OpenCode, Kiro, OpenClaw and other AI coding agents from one VS Code sidebar.",
55
"publisher": "mikesoft",
6-
"version": "1.0.1",
6+
"version": "1.0.2",
77
"repository": {
88
"type": "git",
99
"url": "https://github.com/TheStreamCode/super-cli.git"

src/agents.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,31 @@ export interface Agent extends Omit<AgentDefinition, 'command' | 'updateCommand'
2727
versionCommand?: string;
2828
}
2929

30+
function isAgent(value: unknown): value is Agent {
31+
if (!value || typeof value !== 'object') {
32+
return false;
33+
}
34+
35+
const candidate = value as Partial<Agent>;
36+
return typeof candidate.id === 'string'
37+
&& typeof candidate.label === 'string'
38+
&& typeof candidate.command === 'string';
39+
}
40+
41+
/** Accepts both direct command arguments and agent nodes supplied by VS Code tree item menus. */
42+
export function resolveCommandAgentArgument(argument: unknown): Agent | undefined {
43+
if (isAgent(argument)) {
44+
return argument;
45+
}
46+
47+
if (!argument || typeof argument !== 'object') {
48+
return undefined;
49+
}
50+
51+
const node = argument as { kind?: unknown; agent?: unknown };
52+
return node.kind === 'agent' && isAgent(node.agent) ? node.agent : undefined;
53+
}
54+
3055
function onAllPlatforms(command: string): Record<CommandPlatform, string> {
3156
return { windows: command, macos: command, linux: command };
3257
}

src/doctor.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export function buildDoctorReport(
167167
};
168168
const rows = agents.map((agent) => {
169169
const result = results.get(agent.id) ?? { status: 'version-unavailable' as const };
170-
return `| ${escapeMarkdownCell(agent.label)} | ${labels[result.status]} | ${escapeMarkdownCell(result.version ?? '—')} | ${escapeMarkdownCell(agent.command)} |`;
170+
return `| ${escapeMarkdownCell(agent.label)} | ${labels[result.status]} | ${escapeMarkdownCell(result.version ?? '—')} |`;
171171
});
172172

173173
return [
@@ -178,11 +178,11 @@ export function buildDoctorReport(
178178
`- Workspace trusted: ${workspaceTrusted ? 'yes' : 'no'}`,
179179
'- Update availability is not checked over the network.',
180180
'',
181-
'| Agent | Status | Version | Launch command |',
182-
'| --- | --- | --- | --- |',
181+
'| Agent | Status | Version |',
182+
'| --- | --- | --- |',
183183
...rows,
184184
'',
185-
'This report intentionally excludes environment variables, credentials, PATH contents, and command output.',
185+
'This report excludes environment variables, PATH contents, launch commands, and raw diagnostic output.',
186186
'',
187187
].join('\n');
188188
}

src/extension.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
type AgentDefinition,
66
BUILTIN_AGENTS,
77
filterHiddenBuiltins,
8+
resolveCommandAgentArgument,
89
resolveAgentCommands,
910
resolveAgents,
1011
resolveCommandPlatform,
@@ -328,15 +329,17 @@ export function activate(context: vscode.ExtensionContext): void {
328329
await runLaunchQuickPick(true);
329330
});
330331

331-
const launchAgentCommand = vscode.commands.registerCommand('superCli.launchAgent', async (agent?: Agent) => {
332+
const launchAgentCommand = vscode.commands.registerCommand('superCli.launchAgent', async (argument?: unknown) => {
333+
const agent = resolveCommandAgentArgument(argument);
332334
if (!agent) {
333335
return;
334336
}
335337

336338
await launchWithStatusGuard(agent);
337339
});
338340

339-
const setFavoriteCommand = vscode.commands.registerCommand('superCli.setFavorite', async (agent?: Agent) => {
341+
const setFavoriteCommand = vscode.commands.registerCommand('superCli.setFavorite', async (argument?: unknown) => {
342+
const agent = resolveCommandAgentArgument(argument);
340343
if (!agent) {
341344
return;
342345
}
@@ -345,15 +348,17 @@ export function activate(context: vscode.ExtensionContext): void {
345348
void vscode.window.setStatusBarMessage(`${agent.label} is now the favorite agent`, 2500);
346349
});
347350

348-
const unsetFavoriteCommand = vscode.commands.registerCommand('superCli.unsetFavorite', async (agent?: Agent) => {
351+
const unsetFavoriteCommand = vscode.commands.registerCommand('superCli.unsetFavorite', async (argument?: unknown) => {
352+
const agent = resolveCommandAgentArgument(argument);
349353
if (!agent) {
350354
return;
351355
}
352356

353357
await setFavoriteId('');
354358
});
355359

356-
const updateAgentCommand = vscode.commands.registerCommand('superCli.updateAgent', async (agent?: Agent) => {
360+
const updateAgentCommand = vscode.commands.registerCommand('superCli.updateAgent', async (argument?: unknown) => {
361+
const agent = resolveCommandAgentArgument(argument);
357362
if (!agent) {
358363
return;
359364
}
@@ -363,7 +368,8 @@ export function activate(context: vscode.ExtensionContext): void {
363368

364369
const openAgentDocumentationCommand = vscode.commands.registerCommand(
365370
'superCli.openAgentDocumentation',
366-
async (agent?: Agent) => {
371+
async (argument?: unknown) => {
372+
const agent = resolveCommandAgentArgument(argument);
367373
if (agent) {
368374
await openAgentDocumentation(agent);
369375
}

test/agents.test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const {
55
BUILTIN_AGENTS,
66
filterHiddenBuiltins,
77
getMissingAgentGuidance,
8+
resolveCommandAgentArgument,
89
resolveAgentCommands,
910
resolveAgents,
1011
resolveCommandPlatform,
@@ -18,6 +19,16 @@ function resolveBuiltin(id, platform = 'linux') {
1819
return resolveAgentCommands(definition, platform);
1920
}
2021

22+
test('resolveCommandAgentArgument accepts direct agents and tree item nodes', () => {
23+
const agent = { id: 'example', label: 'Example CLI', command: 'example' };
24+
25+
assert.equal(resolveCommandAgentArgument(agent), agent);
26+
assert.equal(resolveCommandAgentArgument({ kind: 'agent', agent }), agent);
27+
assert.equal(resolveCommandAgentArgument({ kind: 'group', agents: [agent] }), undefined);
28+
assert.equal(resolveCommandAgentArgument({ kind: 'agent', agent: { id: 'broken' } }), undefined);
29+
assert.equal(resolveCommandAgentArgument(undefined), undefined);
30+
});
31+
2132
test('resolveAgents returns the built-ins when no user agents are configured', () => {
2233
const agents = resolveAgents(BUILTIN_AGENTS, undefined, true);
2334
assert.equal(agents.length, BUILTIN_AGENTS.length);

test/doctor.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,16 @@ test('inspectAgents preserves order and limits version checks to three workers',
8181
assert.ok(maximumActive <= 3);
8282
});
8383

84-
test('doctor report contains useful state without raw output or environment data', () => {
84+
test('doctor report contains useful state without commands, raw output, or environment data', () => {
8585
const results = new Map([['example', { status: 'ready', version: 'example 1.2.3' }]]);
86-
const report = buildDoctorReport([agent], results, 'Windows', false, true);
86+
const report = buildDoctorReport([
87+
{ ...agent, command: 'example chat --api-key DOCTOR_SECRET_SENTINEL' },
88+
], results, 'Windows', false, true);
8789

8890
assert.match(report, /Super CLI Agent Doctor/);
8991
assert.match(report, /Example CLI \| Ready \| example 1\.2\.3/);
9092
assert.match(report, /Update availability is not checked/);
9193
assert.doesNotMatch(report, /PATH=/);
94+
assert.doesNotMatch(report, /Launch command/);
95+
assert.doesNotMatch(report, /DOCTOR_SECRET_SENTINEL/);
9296
});

0 commit comments

Comments
 (0)