Skip to content

Conversation

@Emyrk
Copy link
Member

@Emyrk Emyrk commented Jan 26, 2026

Relates to coder/internal#1282

Only task workspaces have the checks in wsbuilder for violating the managed agent caps in the license.

Stopped tasks that are resumed with a regular workspace start still count as usage.

Creating a workspace normally (not through task) should not trigger
license task usage
@Emyrk Emyrk force-pushed the stevenmasley/ai_license branch from 5730438 to abf819b Compare January 27, 2026 14:01
@Emyrk Emyrk changed the title test: agentic license entitlement when using workspaces with tasks fix: do not enforce managed agent limit for non-task workspaces Jan 27, 2026
@Emyrk Emyrk marked this pull request as ready for review January 27, 2026 15:18
@coder-tasks
Copy link
Contributor

coder-tasks bot commented Jan 27, 2026

Documentation Check

No Changes Needed

This is an internal bug fix that corrects managed agent limit enforcement for task workspaces. The change affects internal workspace builder logic only and has no user-facing documentation impact. Task workspace behavior and managed agent limits are already documented correctly.


Automated review via Coder Tasks


var _ usage.Inserter = (*UsageInserter)(nil)

type UsageInserter struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: throw in a sync.RWMutex, or make it a chan?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Through in the mutex, it was easier.

@coder-tasks
Copy link
Contributor

coder-tasks bot commented Jan 27, 2026

Documentation Check

Previous Feedback

Previous doc-check comment was accurate - no documentation changes are needed for this PR.

No Changes Needed

This PR is an internal bug fix that corrects managed agent limit enforcement logic. The change ensures that:

  1. Task workspaces - Workspaces created via the Tasks API properly enforce managed agent limits
  2. Regular workspaces with AI tasks - Workspaces that contain AI task definitions (in the template) but are not launched as task workspaces do NOT trigger usage checks

The fix affects only internal workspace builder logic (wsbuilder.go) and usage checking signatures. Since the managed agent limit feature and task workspace behavior are already documented correctly (task workspaces count toward usage, regular workspaces don't), no documentation updates are required.

The PR includes comprehensive tests in enterprise/coderd/workspaces_test.go that verify both scenarios work correctly.


Automated review via Coder Tasks

Emyrk and others added 2 commits January 27, 2026 12:27
Co-authored-by: Cian Johnston <cian@coder.com>
@Emyrk Emyrk merged commit 799b190 into main Jan 28, 2026
31 checks passed
@Emyrk Emyrk deleted the stevenmasley/ai_license branch January 28, 2026 01:01
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants