feat!: hide Coder Tasks behind the enable-ai-tasks flag - #28008
Draft
david-fraley wants to merge 9 commits into
Draft
feat!: hide Coder Tasks behind the enable-ai-tasks flag#28008david-fraley wants to merge 9 commits into
david-fraley wants to merge 9 commits into
Conversation
Coder Tasks is being withdrawn from the product. Rather than ripping the implementation out now, every user-facing Tasks surface is gated behind a new deployment value that defaults to off. DeploymentValues.TasksEnabled (--enable-tasks, CODER_ENABLE_TASKS, enableTasks) is hidden so it stays out of the generated CLI and configuration reference docs. When it is unset: - The /api/v2/tasks and /api/experimental/tasks route trees respond with the standard route-not-found payload. - rbac.RoleOptions.NoTasks strips every task action from the built-in roles, so the task permissions are neither granted nor settable on a custom role. - The frontend does not register the /tasks and /tasks/:username/:taskId routes, hides the navbar item, the tasks sidebar, task badges and links on workspace surfaces, the Task Events notification group, and the task resource in the custom role editor. - The CLI task command tree is hidden from help and from generated docs. The existing --hide-ai-tasks flag keeps working. The Tasks tab is now visible only when tasks are enabled and that flag is unset. Documentation for Tasks is removed outright since static docs cannot be gated. The generated API reference remains because the handlers still exist behind the flag. coderdtest defaults TasksEnabled to true so the existing Tasks suite keeps exercising the enabled path. Co-authored-by: Coder Agents <noreply@coder.com>
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.
|
…into enable-tasks The Tasks API reference page was still published because the handlers keep their swagger annotations, which TestEndpointsDocumented requires. Add an unpublishedSections set to the apidoc postprocessor so a swagger tag can stay annotated without being written to docs/reference/api or listed in the manifest, and register the Tasks tag there. docs/reference/api/tasks.md is deleted and stays deleted across make gen. Also drop the Coder Tasks glossary entry. --hide-ai-tasks only ever hid the dashboard tab, which --enable-tasks now subsumes. Mark it hidden and point UseInstead at --enable-tasks. It keeps parsing so existing deployments do not break, and it no longer documents Tasks in the CLI or configuration reference. Co-authored-by: Coder Agents <noreply@coder.com>
…ction Drops the annotation blocks from the ten Tasks handlers in coderd/aitasks.go, so the Tasks endpoints leave the swagger spec entirely rather than being filtered out after generation. This also removes the task-only schema definitions (codersdk.Task, TaskState, TasksListResponse and friends) from docs/reference/api/schemas.md, coderd/apidoc/docs.go and swagger.json. Reverts the unpublishedSections filter added to the apidoc postprocessor, which is no longer needed. The handlers stay registered so deployments that set CODER_ENABLE_TASKS keep working, which means TestEndpointsDocumented would flag them as missing an @router annotation. Skip them with isTaskEndpoint, alongside the existing isExperimentalEndpoint and isLegacyAIBridgeAlias skips. Co-authored-by: Coder Agents <noreply@coder.com>
--hide-ai-tasks only hid the dashboard tab, which --enable-tasks subsumes now that Tasks is off by default. Remove it outright rather than carrying a deprecated alias, and rename the new flag to match the naming it used: TasksEnabled -> EnableAITasks tasks_enabled -> enable_ai_tasks --enable-tasks -> --enable-ai-tasks CODER_ENABLE_TASKS -> CODER_ENABLE_AI_TASKS enableTasks -> enableAITasks With HideAITasks gone the tasks-enabled and tasks-tab-visible embedded metadata values were identical, so they collapse into a single ai-tasks-enabled meta tag. useTasksEnabled becomes useAITasksEnabled and is now the navbar's switch too, replacing its inline metadata read. Note for operators: serpent rejects unknown YAML keys, so a config file that still sets client.hideAITasks fails to start. CODER_HIDE_AI_TASKS as an environment variable is ignored silently. Co-authored-by: Coder Agents <noreply@coder.com>
…hind-flag # Conflicts: # docs/ai-coder/agents/index.md # docs/ai-coder/agents/tasks-to-chats-migration.md # docs/manifest.json
coderd.New reloaded the process-wide built-in roles whenever tasks were disabled, which is the default. Any test process that started both a tasks-disabled server and a tasks-enabled server ended up with the task denials applied to both, so the CLI task suite failed after the server suite ran. Route-level 404s already remove every task endpoint, so the role negation added nothing an operator could reach. Drop it and delete the now-stale CLI task golden files, which make gen removes because the command is hidden.
…2.36 deprecation warning
johnstcn
reviewed
Aug 11, 2026
Comment on lines
+105
to
+114
| <> | ||
| Today, Coder Tasks (via UI, CLI, or API) is the only way to | ||
| create agentic workspaces, but additional protocols and APIs | ||
| may be supported as standards emerge. | ||
| </> | ||
| ) : ( | ||
| <> | ||
| Additional protocols and APIs may be supported as standards | ||
| emerge. | ||
| </> |
| ### Coding agent | ||
|
|
||
| An AI agent that reads and writes code on a developer's behalf, such as Claude Code, run through Coder Tasks or Coder Agents. | ||
| An AI agent that reads and writes code on a developer's behalf, such as Claude Code, run through Coder Agents or inside a workspace. |
Member
There was a problem hiding this comment.
You can't really run Claude through Agents right now AFAIK?
Suggested change
| An AI agent that reads and writes code on a developer's behalf, such as Claude Code, run through Coder Agents or inside a workspace. | |
| An AI agent that reads and writes code on a developer's behalf, such as Coder Tasks, or Claude Code via AI Gateway. |
Comment on lines
+30
to
+33
| > [!NOTE] | ||
| > Coder Tasks has since been deprecated and is no longer available in current | ||
| > releases. [Coder Agents](../../ai-coder/agents/index.md) is the long-term | ||
| > replacement. |
Comment on lines
-37
to
-46
| // @Summary Create a new AI task | ||
| // @ID create-a-new-ai-task | ||
| // @Security CoderSessionToken | ||
| // @Accept json | ||
| // @Produce json | ||
| // @Tags Tasks | ||
| // @Param user path string true "Username, user ID, or 'me' for the authenticated user" | ||
| // @Param request body codersdk.CreateTaskRequest true "Create task request" | ||
| // @Success 201 {object} codersdk.Task | ||
| // @Router /api/v2/tasks/{user} [post] |
Member
There was a problem hiding this comment.
I suggest marking these with a comment similar to the below:
// DEPRECATED: this endpoint is being removed in release X.Y.
| // Tasks ship disabled. Tests exercise the enabled behavior by default so | ||
| // the Tasks suite keeps running; tests for the disabled path opt out | ||
| // explicitly via the mutators. | ||
| cfg.EnableAITasks = true |
Comment on lines
-293
to
-295
| --hide-ai-tasks bool, $CODER_HIDE_AI_TASKS (default: false) | ||
| Hide AI tasks from the dashboard. | ||
|
|
Member
There was a problem hiding this comment.
We could alternatively build on top of this and make CODER_HIDE_AI_TASKS also make the endpoints 404?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Coder Tasks is being withdrawn from the product. This hides it rather than removing it: no Tasks implementation code is deleted, every user facing surface is gated behind a deployment value that defaults to off. Docs are removed outright.
Warning
Breaking change. Two things break on upgrade. Customers need to be notified.
1. Coder Tasks disappears. It is off by default, so on upgrade every deployment loses the Tasks tab, the
/tasksURLs, the/api/v2/tasksand/api/experimental/tasksendpoints, and thecoder taskCLI commands. Existing tasks and their workspaces are untouched in the database, they are just unreachable. A deployment that needs Tasks back can setCODER_ENABLE_AI_TASKS=true.2.
--hide-ai-tasksis deleted. Anyone who set it in a YAML config file (client.hideAITasks) or passed--hide-ai-taskson the command line will find that Coder refuses to start, because serpent rejects options it does not recognise. The fix is to delete the line. Setting it as theCODER_HIDE_AI_TASKSenvironment variable is ignored silently and is safe.The flag
DeploymentValues.EnableAITasks--enable-ai-tasksCODER_ENABLE_AI_TASKSenableAITasksfalsetrueHidden: truekeeps the option out ofdocs/reference/cli/server.mdanddocs/admin/setup/configuration-reference.md, so the flag itself does not advertise Tasks.--hide-ai-tasksonly hid the dashboard tab, which this flag subsumes now that Tasks is off by default, so it is removed rather than deprecated.What the flag gates
/api/v2/tasks,/api/experimental/taskshttpmw.RouteNotFound()/tasksand/tasks/:username/:taskIdare not registered, so the URLs 404taskresource is filtered out of the permission editortask/taskscommand tree is hidden fromcoder --helpand from generated CLI docsA single
ai-tasks-enabledembedded metadata value carries the switch to the frontend, read throughuseAITasksEnabled(). The Go server always emits the tag, so an absent value means Vite, Storybook or Vitest is serving the app and Tasks stays visible there. This mirrors the existinguseAIGatewayEnabled()helper. WithHideAITasksgone the oldtasks-tab-visiblemeta was redundant and is removed.coderdtest.DeploymentValuesdefaultsEnableAITasksto true so the existing Tasks suite keeps exercising the enabled path.TestTasksDisabledcovers the off path.Docs
Static docs cannot be gated, so Tasks is removed from the docs entirely:
ai-coder/tasks.md,tasks-core-principles.md,tasks-lifecycle.md,tasks-migration.md,github-to-tasks.md, plus the orphanedai-coder/cli.mdstub and the Tasks images.agents/tasks-to-chats-migration.mdis kept. It is the one page customers still need, so it stays in the manifest under Coder Agents with a warning callout stating that Coder Tasks is deprecated as of Coder v2.36 and that Tasks documentation is only available in previous documentation versions. Its links to the deleted Tasks pages are removed.reference/cli/task*.md) are gone because the command is hidden.reference/api/tasks.mdis gone because the swagger annotations were removed from the ten handlers incoderd/aitasks.go. The Tasks endpoints leave the spec entirely, which also drops the task-only definitions (codersdk.Task,TaskState,TasksListResponseand friends) fromschemas.md,coderd/apidoc/docs.goandswagger.json: about 2,200 lines of generated reference.TestEndpointsDocumentedwould flag them as missing@Router. They are skipped withisTaskEndpoint, alongside the existingisExperimentalEndpointandisLegacyAIBridgeAliasskips.TaskPrompt,TaskAppsand the licensing page) are unlinked, so nothing in the UI points at a 404.tasks-dockerstarter template is deleted (examples/templates/tasks-docker/, its//go:embedline,examples.gen.json,templates init --idenum, generated CLI docs and golden file). It only exists to demo Coder Tasks, so it cannot work on a default deployment.Two deliberate exceptions:
docs/install/releases/esr-2.24-2.29-upgrade.mdandesr-2.29-2.34-upgrade.mdstill mention Tasks. These are historical upgrade guides for operators performing those specific upgrades. Only dead links and forward looking "use Coder Tasks" guidance were removed; deleting the factual record would make the guides wrong.has_ai_taskon workspace builds,taskin the RBAC resource enum,task_manual_pause/task_resumebuild reasons, andenable_ai_tasksinDeploymentValues. Those are the shape of existing API responses, not Tasks pages, and changing them changes the API.Proof
Captured against a live
scripts/develop.shinstance, served from the production frontend build on:3000rather than the Vite dev server, which force-enables the feature.Flag off (default)
Navbar has no Tasks item:
/tasks404s:/tasks/:username/:taskId404s:The custom role permission editor, with advanced permissions shown, has no
taskresource betweentailnet_coordinatorandtemplate:Rendered metadata and API, as an authenticated owner:
Flag on (
CODER_ENABLE_AI_TASKS=true)Tasks returns to the navbar:
The Tasks page loads:
Screenshots are hosted on the
dfraley/tasks-flag-evidencebranch to keep them out of this diff.Known gaps
taskRBAC resource still exists on the built-in roles. An earlier revision negated it viarbac.RoleOptions, but built-in roles are process-global state, so a tasks-disabled server poisoned every other server in the same test process. Since every task route 404s, a task grant reaches nothing, so the negation only bought cosmetics. The custom role editor still filters the resource out of the UI.Implementation plan
Hide Coder Tasks behind a deployment flag
Goal
Make Coder Tasks invisible to users by default, without deleting any Tasks
code. Everything Tasks-related is gated behind a single deployment flag that
defaults to off. Actual code removal is a separate, later change.
Key decisions
New deployment value, default off. Following
254d1b3a48(DisableChatSharing), addDeploymentValues.EnableAITasks:EnableAITasks serpent.Boolenable_ai_tasks--enable-ai-tasksCODER_ENABLE_AI_TASKSenableAITasksfalsetrueHidden: truekeeps the option out ofdocs/reference/cli/server.mdanddocs/admin/setup/configuration-reference.md.--hide-ai-tasksis deleted. It only hid the dashboard tab, which thenew flag subsumes now that Tasks is off by default. Naming follows the old
flag's convention so operators recognise it. This is a breaking change for
deployments that set it via YAML or command line; customers will be
notified.
Gate, do not delete. Route trees, nav items, RBAC permissions and CLI
commands are conditionally registered or conditionally rendered. No Tasks
implementation code is removed.
Docs are removed outright, except the migration guide. Static docs cannot
be flag-gated. Narrative Tasks pages and their manifest entries are deleted.
The Tasks to Chats migration guide is kept, with a deprecation warning
pointing readers at previous documentation versions for Tasks details.
Generated CLI docs disappear once the command is hidden. The generated API
reference goes away by removing the swagger annotations from the handlers,
with an
isTaskEndpointskip in the swagger verifier because the routes stayregistered.
Work items
Backend
codersdk/deployment.go: addEnableAITasks; deleteHideAITasks.coderd/coderd.go:AITasksEnabledinto the site handler options;/api/v2/tasksand/api/experimental/tasks.coderd/httpmw/routenotfound.go: new middleware that answers a whole routetree with the standard route-not-found payload.
coderd/aitasks.go: remove the swagger annotation blocks.coderd/coderdtest/swaggerparser.go: skip the Tasks routes.site/site.go: addAITasksEnabledand emit theai-tasks-enabledhtmlstate value; drop
HideAITasksandTasksTabVisible.site/index.html: singleai-tasks-enabledmeta tag.cli/task.go: setHidden: trueon thetask/taskscommand so it dropsout of
coder --helpand out of generated CLI docs.coderdtest: defaultEnableAITasksto true so the existing Tasks testsuite keeps exercising the enabled path.
Frontend (
site/src)hooks/useEmbeddedMetadata.ts: registerai-tasks-enabled, droptasks-tab-visible.useAITasksEnabled()helper used by every Tasks surface, including thenavbar.
router.tsx: only register/tasksand/tasks/:username/:taskIdwhenenabled, so the URLs 404.
modules/tasks/TasksSidebar/TasksSidebar.tsxmodules/resources/AgentRow.tsx("View task")modules/workspaces/WorkspaceMoreActions/WorkspaceDeleteDialog.tsxpages/WorkspacesPage/WorkspacesTable.tsx(Task badge)pages/WorkspacePage/WorkspaceActions/ShareButton.tsxpages/UserSettingsPage/NotificationsPage/NotificationsPage.tsx(Task Events group)
pages/DeploymentSettingsPage/LicensesSettingsPage/ManagedAgentsConsumption.tsxpages/OrganizationSettingsPage/CustomRolesPage/CreateEditRolePageView.tsx:filter the
taskRBAC resource out of the permission editor so the Tasksrole permissions are not settable.
Docs
Delete and de-manifest:
docs/ai-coder/tasks.mddocs/ai-coder/tasks-core-principles.mddocs/ai-coder/tasks-lifecycle.mddocs/ai-coder/tasks-migration.mddocs/ai-coder/github-to-tasks.mddocs/ai-coder/cli.mddocs/reference/api/tasks.mddocs/reference/cli/task*.mddocs/images/guides/ai-agents/Keep
docs/ai-coder/agents/tasks-to-chats-migration.mdin the manifest, add av2.36 deprecation warning to it, and drop its links to the deleted Tasks pages.
Delete the
tasks-dockerstarter template and regenerate what references it:examples/templates/tasks-docker///go:embed templates/tasks-dockerline inexamples/examples.goexamples/examples.gen.jsondocs/reference/cli/templates_init.mdandcli/testdata/coder_templates_init_--help.goldenScrub inbound references so the weekly link checker stays green:
docs/reference/glossary.mddocs/user-guides/shared-workspaces.mddocs/user-guides/workspace-scheduling.mddocs/ai-coder/custom-agents.mddocs/ai-coder/agent-compatibility.mddocs/ai-coder/ai-governance.mddocs/ai-coder/agents/index.mddocs/install/releases/esr-2.24-2.29-upgrade.mddocs/install/releases/esr-2.29-2.34-upgrade.mdOut of scope
tasks-dockerexample template is the one exception: it is a demo-only starter template, not implementation code.Generated with Coder Agents on behalf of @david-fraley.