Skip to content

feat: return deployment and effective subagent limits from the organization limits API - #78

Merged
ibetitsmike merged 2 commits into
mainfrom
mike/org-agent-settings-ui-1-limits-api
Nov 9, 2026
Merged

ibetitsmike merged 2 commits into
mainfrom
mike/org-agent-settings-ui-1-limits-api

Conversation

@ibetitsmike

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of @ibetitsmike.

Part of #76.

The organization Coder Agents settings UI (next PR in this stack) must show each subagent limit's deployment value and effective value, but the deployment limits are only readable through GET /api/v2/deployment/config, which org admins and org auditors cannot read.

GET and PUT /api/v2/chats/fork/organizations/{organization}/subagent-limits now return ForkOrganizationSubagentLimitsResponse:

  • organization: the stored organization limits (unchanged shape, unset = omitted).
  • deployment: the four deployment limits, with the default depth applied.
  • effective: the limits in force in the organization.

The PUT request body is still ForkOrganizationSubagentLimits. effective comes from chatd.EffectiveSubagentLimits, which subagentLimits in chatd now calls too, so the rule (the lower of the deployment and organization values wins, 0 means no limit) exists once. ForkLimits.withDefaults is exported as WithDefaults for the handler. No behavior change in chatd. Fork files only, plus the existing fork hook line in coderd/x/chatd/limits.go.

Tests: TestForkChatOrganizationSubagentLimits gains DeploymentAndEffective (org lower, deployment 0 = no limit, deployment lower, org unset; PUT response, GET and an org auditor's GET) and DefaultDepth. Both were checked to fail with the rule or the default broken. Generated types and API docs regenerated. No dev-build UAT for this API-only PR (lead decision); the end-to-end UAT runs with the UI PR.

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T22:40:15.694935Z 1eecb62 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 1eecb62f4b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) closed and reopened this on behalf of @ibetitsmike.

Closing and reopening only to make GitHub recompute the merge ref against current main (e8069ca4fe) and run fork-ci on it. The head is unchanged.

@ibetitsmike ibetitsmike closed this Nov 9, 2026
@ibetitsmike ibetitsmike reopened this Nov 9, 2026
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) closed and reopened this again on behalf of @ibetitsmike.

The merge ref now points at current main (e8069ca4fe), but the run started by the first reopen was queued against the old merge ref. This second reopen starts fork-ci on the recomputed merge. The head is unchanged.

@ibetitsmike ibetitsmike closed this Nov 9, 2026
@ibetitsmike ibetitsmike reopened this Nov 9, 2026
@ibetitsmike
ibetitsmike merged commit 25f19f6 into main Nov 9, 2026
21 of 28 checks passed
@ibetitsmike
ibetitsmike deleted the mike/org-agent-settings-ui-1-limits-api branch November 9, 2026 23:17
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) merged this on behalf of @ibetitsmike.

Merge evidence for head 1eecb62f4b655b3262697b906d2c8950d7eb84e3:

  • fork-ci pull_request run 42716825386 passed; its build job checked out Merge 1eecb62f4b into e8069ca4fe (current main, deployed and healthy at 23:16Z). All checks green.
  • Codex review on this exact head: no major issues. 0 unresolved review threads. Merge state CLEAN.
  • End-to-end UAT runs with the site PR on the fork UI UAT server after this deploys; the API is covered by the Go tests in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant