For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Show the SSH config alias in the task list workspace title as <workspaceName> [SSH: <alias>] for SSH remote workspaces opened through an alias.
Architecture: Treat the SSH alias as non-sensitive connection metadata. Carry it from the remote connection form into RemoteTarget, persist it in RemoteTargetSnapshot, hydrate it during reconnect, and format the sidebar label from the remote target without changing workspace identity or task realtime semantics.
Tech Stack: TypeScript, React, Zustand, Vitest, existing RemoteTarget / RemoteWorkspaceSessionEntry helpers.
Files:
packages/shared/src/index.tspackages/shared/src/protocol.tspackages/shared/src/validation.tspackages/shared/src/validationAppSettings.tspackages/shared/test/validation.test.tspackages/ui/src/lib/remoteConnectionWizard.tspackages/ui/src/lib/remoteWorkspaceHistory.tspackages/ui/src/SSHDialog.tsxpackages/ui/test/remoteConnectionWizard.test.tsTest: packages/ui/test/remoteWorkspaceHistory.test.ts
[x] Step 1: Write the failing target construction test
Add this test to packages/ui/test/remoteConnectionWizard.test.ts:
it("includes the selected SSH config alias as target metadata", () => {
const result = buildRemoteTarget(intl, {
kind: "ssh",
host: "localhost",
port: "2223",
username: "root",
sshAuthMethod: "password",
password: "secret",
privateKeyPath: "",
privateKeyPassphrase: "",
selectedSshConfigAlias: " linux-arm64 ",
wslDistro: "",
dockerContainer: "",
});
expect(result.target).toMatchObject({
kind: "ssh",
sshConfigAlias: "linux-arm64",
});
});
Add this test to packages/ui/test/remoteWorkspaceHistory.test.ts:
it("persists and hydrates SSH config alias metadata", () => {
const snapshot = createRemoteTargetSnapshot(
"remote:ssh:localhost:2223:root:/root",
{
kind: "ssh",
host: "localhost",
port: 2223,
username: "root",
password: "secret",
sshConfigAlias: "linux-arm64",
},
);
expect(snapshot).toMatchObject({
kind: "ssh",
sshConfigAlias: "linux-arm64",
});
expect(
createRemoteTargetFromSnapshot(snapshot, {
password: "secret",
privateKeyPassphrase: null,
}),
).toMatchObject({
kind: "ssh",
sshConfigAlias: "linux-arm64",
});
});
Run:
pnpm vitest run packages/ui/test/remoteConnectionWizard.test.ts packages/ui/test/remoteWorkspaceHistory.test.ts packages/ui/test/workspaceSidebarRemoteNotice.test.ts
Expected before implementation: FAIL with missing sshConfigAlias in the target and snapshot assertions.
Add optional sshConfigAlias?: string to:
export interface SSHConnectOptions {
kind: "ssh";
host: string;
port?: number;
username: string;
sshConfigAlias?: string;
}
export interface SSHRemoteTargetSnapshot {
kind: "ssh";
host: string;
port?: number;
username: string;
/** 用户建立连接时选择的 SSH config Host alias,仅用于 UI 展示。 */
sshConfigAlias?: string;
}
Add sshConfigAlias: nonEmptyStringSchema.optional() to both SSH zod schemas in packages/shared/src/validation.ts and packages/shared/src/validationAppSettings.ts.
In packages/ui/src/lib/remoteConnectionWizard.ts, add selectedSshConfigAlias?: string | null to RemoteConnectionFormSnapshot and emit the trimmed alias:
const sshConfigAlias = snapshot.selectedSshConfigAlias?.trim();
return {
target: {
kind: "ssh",
host: snapshot.host,
port: snapshot.port ? Number(snapshot.port) : undefined,
username: snapshot.username,
...(sshConfigAlias ? { sshConfigAlias } : {}),
assetInstallMode: snapshot.assetInstallMode,
},
};
In packages/ui/src/SSHDialog.tsx, include selectedSshConfigAlias in the buildRemoteTarget() snapshot. In packages/ui/src/lib/remoteWorkspaceHistory.ts, persist and hydrate the alias:
...(target.sshConfigAlias?.trim()
? { sshConfigAlias: target.sshConfigAlias.trim() }
: {}),
...(snapshot.sshConfigAlias ? { sshConfigAlias: snapshot.sshConfigAlias } : {}),
Run:
pnpm vitest run packages/ui/test/remoteConnectionWizard.test.ts packages/ui/test/remoteWorkspaceHistory.test.ts packages/shared/test/validation.test.ts
Expected after implementation: PASS.
Files:
packages/ui/src/WorkspaceSidebarItem.tsxTest: packages/ui/test/workspaceSidebarRemoteNotice.test.ts
[x] Step 1: Write the failing sidebar rendering test
Add this test to packages/ui/test/workspaceSidebarRemoteNotice.test.ts:
it("SSH 远程工作区有配置别名时,在任务列表标题后展示 SSH 别名标签", () => {
const html = renderWorkspaceItem({
tab: createRemoteWorkspaceTab({
label: "root",
workspacePath: "/root",
remoteTarget: {
kind: "ssh",
host: "localhost",
port: 2223,
username: "root",
sshConfigAlias: "linux-arm64",
},
workspaceIdentity: "remote:ssh:localhost:2223:root:/root",
}),
});
expect(html).toContain("root [SSH: linux-arm64]");
});
Run:
pnpm vitest run packages/ui/test/workspaceSidebarRemoteNotice.test.ts
Expected before implementation: FAIL because the sidebar renders only root.
Add this helper to packages/ui/src/WorkspaceSidebarItem.tsx and render workspaceSidebarLabel instead of tab.label:
function formatWorkspaceSidebarLabel(tab: WorkspaceTabState): string {
if (tab.remoteTarget?.kind !== "ssh") {
return tab.label;
}
const sshConfigAlias = tab.remoteTarget.sshConfigAlias?.trim();
return sshConfigAlias ? `(${sshConfigAlias}) ${tab.label}` : tab.label;
}
Run:
pnpm vitest run packages/ui/test/workspaceSidebarRemoteNotice.test.ts
Expected after implementation: PASS.
Files:
Modify: docs/ui/ssh-config-alias.md
[x] Step 1: Update the feature spec
Document that SSH alias metadata is persisted as optional non-sensitive target metadata and rendered as <workspaceName> [SSH: <alias>] in the task list workspace title. State explicitly that alias does not participate in workspace identity.
Run:
pnpm vitest run packages/ui/test/remoteConnectionWizard.test.ts packages/ui/test/remoteWorkspaceHistory.test.ts packages/ui/test/workspaceSidebarRemoteNotice.test.ts packages/shared/test/validation.test.ts
Expected: PASS.
Run:
pnpm typecheck
Expected: exit 0.
Run:
pnpm lint
Expected: exit 0. Existing warnings outside this feature may still be reported by oxlint.
Run:
git diff --check
git status --short
git add docs/ui/ssh-config-alias.md docs/superpowers/plans/2026-06-13-ssh-alias-workspace-title.md packages/shared/src/index.ts packages/shared/src/protocol.ts packages/shared/src/validation.ts packages/shared/src/validationAppSettings.ts packages/shared/test/validation.test.ts packages/ui/src/SSHDialog.tsx packages/ui/src/WorkspaceSidebarItem.tsx packages/ui/src/lib/remoteConnectionWizard.ts packages/ui/src/lib/remoteWorkspaceHistory.ts packages/ui/test/remoteConnectionWizard.test.ts packages/ui/test/remoteWorkspaceHistory.test.ts packages/ui/test/workspaceSidebarRemoteNotice.test.ts
git commit -m "feat(ui): show ssh alias in workspace task list"
Expected: no whitespace errors, only intended files staged, commit succeeds.