Skip to content

fix: clamp template port sharing level in SubAgentAPI (#26061)#26318

Merged
f0ssel merged 2 commits into
release/2.29from
backport/26061-to-2.29
Jun 12, 2026
Merged

fix: clamp template port sharing level in SubAgentAPI (#26061)#26318
f0ssel merged 2 commits into
release/2.29from
backport/26061-to-2.29

Conversation

@f0ssel

@f0ssel f0ssel commented Jun 11, 2026

Copy link
Copy Markdown
Member

Backport of #26061 to release/2.29 (SEC-80 / CODAGT-479).

Conflict resolution: CreateSubAgent on this branch predates the terraform-defined devcontainer (req.Id) flow, so only the template fetch and port-share clamp were applied. Dropped BoundaryUsageTracker/LifecycleMetrics options that do not exist on 2.29.

🤖 Backport prepared by Coder Agents on behalf of @f0ssel.

Fixes an issue where sub-agent apps created via CreateSubAgent would
bypass the check for the template's max port sharing level:

- Clamps dynamically inserted `workspace_apps` to the template max
sharing level in `coderd.agentapi.SubAgentAPI`.
- Emits a warning when clamping occurs.
- Adds unit test coverage for the max sharing level matrix.
- Adds an integration-ish test through the devcontainer sub-agent client
path.

> 🤖 Generated by Coder Agents with guidance from a human.
@f0ssel f0ssel changed the title fix(coderd/agentapi): clamp template port sharing level in SubAgentAPI (#26061) fix: clamp template port sharing level in SubAgentAPI (#26061) Jun 12, 2026
@f0ssel f0ssel merged commit c1889d0 into release/2.29 Jun 12, 2026
29 of 30 checks passed
@f0ssel f0ssel deleted the backport/26061-to-2.29 branch June 12, 2026 00:17
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 12, 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.

3 participants