Skip to content

Commit c0b7abc

Browse files
committed
Add feature flag (coder.experimental.tasks)
1 parent f6d3822 commit c0b7abc

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

package.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@
140140
"experimental"
141141
]
142142
},
143+
"coder.experimental.tasks": {
144+
"markdownDescription": "Enable the experimental [Tasks](https://coder.com/docs/ai-coder/tasks) panel in VS Code. When enabled, a sidebar panel lets you run and manage AI coding agents in Coder workspaces. This feature is under active development and may change. Requires a Coder deployment with Tasks support.",
145+
"type": "boolean",
146+
"default": false,
147+
"tags": [
148+
"experimental"
149+
]
150+
},
143151
"coder.sshFlags": {
144152
"markdownDescription": "Additional flags to pass to the `coder ssh` command when establishing SSH connections. Enter each flag as a separate array item; values are passed verbatim and in order. See the [CLI ssh reference](https://coder.com/docs/reference/cli/ssh) for available flags.\n\nNote: `--network-info-dir` and `--ssh-host-prefix` are ignored (managed internally). Prefer `#coder.proxyLogDirectory#` over `--log-dir`/`-l` for full functionality.",
145153
"type": "array",
@@ -212,7 +220,7 @@
212220
"id": "coder.tasksPanel",
213221
"name": "Coder Tasks",
214222
"icon": "media/tasks-logo.svg",
215-
"when": "coder.authenticated"
223+
"when": "coder.authenticated && coder.tasksEnabled"
216224
}
217225
]
218226
},
@@ -225,7 +233,7 @@
225233
{
226234
"view": "coder.tasksPanel",
227235
"contents": "[Login](command:coder.login) to view tasks.",
228-
"when": "!coder.authenticated && coder.loaded"
236+
"when": "!coder.authenticated && coder.loaded && coder.tasksEnabled"
229237
}
230238
],
231239
"commands": [
@@ -424,7 +432,7 @@
424432
},
425433
{
426434
"command": "coder.tasks.refresh",
427-
"when": "coder.authenticated && view == coder.tasksPanel",
435+
"when": "coder.authenticated && coder.tasksEnabled && view == coder.tasksPanel",
428436
"group": "navigation@1"
429437
}
430438
],

src/core/contextManager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const CONTEXT_DEFAULTS = {
44
"coder.authenticated": false,
55
"coder.isOwner": false,
66
"coder.loaded": false,
7+
"coder.tasksEnabled": false,
78
"coder.workspace.connected": false,
89
"coder.workspace.updatable": false,
910
} as const;

src/extension.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,22 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<void> {
6666
const secretsManager = serviceContainer.getSecretsManager();
6767
const contextManager = serviceContainer.getContextManager();
6868

69+
const syncTasksFlag = () => {
70+
const enabled =
71+
vscode.workspace
72+
.getConfiguration()
73+
.get<boolean>("coder.experimental.tasks") === true;
74+
contextManager.set("coder.tasksEnabled", enabled);
75+
};
76+
syncTasksFlag();
77+
ctx.subscriptions.push(
78+
vscode.workspace.onDidChangeConfiguration((e) => {
79+
if (e.affectsConfiguration("coder.experimental.tasks")) {
80+
syncTasksFlag();
81+
}
82+
}),
83+
);
84+
6985
// Migrate auth storage from old flat format to new label-based format
7086
await migrateAuthStorage(serviceContainer);
7187

src/promptUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ export async function maybeAskAuthMethod(
139139
client: CoderApi,
140140
): Promise<AuthMethod | undefined> {
141141
const experimentalOAuthEnabled = vscode.workspace
142-
.getConfiguration("coder")
143-
.get<boolean>("experimental.oauth", false);
142+
.getConfiguration()
143+
.get<boolean>("coder.experimental.oauth", false);
144144

145145
if (!experimentalOAuthEnabled) {
146146
return "legacy";

0 commit comments

Comments
 (0)