Skip to content

Commit a22e2c5

Browse files
committed
feat: open chat panel from /open when agentId param is present
The existing /open deep link now optionally accepts an agentId query parameter. When present, the chat panel opens alongside the workspace. Old extensions silently ignore unknown query params, so this is fully backwards compatible — no error dialog, no version negotiation needed. The standalone /openChat route is kept for cases where no workspace context is needed (e.g. direct links from the agents page).
1 parent 2712318 commit a22e2c5

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/uri/uriHandler.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,13 @@ function getRequiredParam(params: URLSearchParams, name: string): string {
9191
}
9292

9393
async function handleOpen(ctx: UriRouteContext): Promise<void> {
94-
const { params, serviceContainer, deploymentManager, commands } = ctx;
94+
const {
95+
params,
96+
serviceContainer,
97+
deploymentManager,
98+
commands,
99+
chatPanelProvider,
100+
} = ctx;
95101

96102
const owner = getRequiredParam(params, "owner");
97103
const workspace = getRequiredParam(params, "workspace");
@@ -101,6 +107,11 @@ async function handleOpen(ctx: UriRouteContext): Promise<void> {
101107
params.has("openRecent") &&
102108
(!params.get("openRecent") || params.get("openRecent") === "true");
103109

110+
// Optional: if agentId is present, also open the embedded chat
111+
// panel. Old extensions silently ignore this unknown param,
112+
// giving backwards compatibility.
113+
const agentId = params.get("agentId");
114+
104115
await setupDeployment(params, serviceContainer, deploymentManager);
105116

106117
await commands.open(
@@ -110,6 +121,10 @@ async function handleOpen(ctx: UriRouteContext): Promise<void> {
110121
folder ?? undefined,
111122
openRecent,
112123
);
124+
125+
if (agentId) {
126+
chatPanelProvider.openChat(agentId);
127+
}
113128
}
114129

115130
async function handleOpenDevContainer(ctx: UriRouteContext): Promise<void> {

0 commit comments

Comments
 (0)