Skip to content

feat(site/src): add organization subagent limits to Coder Agents settings - #88

Merged
ibetitsmike merged 5 commits into
mainfrom
mike/org-agent-settings-ui-2-limits-section
Nov 10, 2026
Merged

ibetitsmike merged 5 commits into
mainfrom
mike/org-agent-settings-ui-2-limits-section

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of @ibetitsmike.

Part of #76.

Adds a "Subagent limits" section to the organization part of AI Settings > Coder Agents, behind fork-nested-subagents. It reads and writes GET/PUT /api/v2/chats/fork/organizations/{organization}/subagent-limits (the response shape from #78).

  • Each of the four limits (max depth, running subagents in this organization, running subagents per chat family, live subagents per chat family) shows the organization value in an input plus a line with the deployment value and the effective value. The server computes effective; the UI does not re-derive it. A capacity value of 0 renders as "No limit".
  • An empty field is unset: it is omitted from the PUT and the deployment value applies. Values are validated inline (depth 1 to 16, capacity limits 1 or more) and Save stays disabled while a value is invalid. Inputs are type="text" inputMode="numeric" because a number input reports unparsable text as empty, which would silently unset a limit.
  • Users with update on the organization's chat model configs (the page's existing canEdit) can edit. Users who can only read them, such as org auditors, see the values read-only. Plain members, who get 404 from the API, do not see the section and no request is sent.
  • A refetch updates the inputs while nothing is edited and keeps an unsaved draft.
  • With the experiment off the section renders nothing and sends no request, so the page matches upstream.

All logic lives in new fork files (site/src/api/forkSubagentLimits.ts, site/src/api/queries/forkSubagentLimits.ts, ForkSubagentLimits.tsx, components/ForkSubagentLimitsSettings.tsx). The only upstream edit is the hook in OrganizationAgentSettings.tsx. The container reads DashboardContext directly instead of useDashboard() because the upstream OrganizationAgentSettings tests and stories mount without a DashboardProvider; a missing dashboard counts as the experiment off.

Tests: ForkSubagentLimits.test.tsx (10 Vitest cases: save with the other set limits and cache update, cleared field omitted, invalid values block the save, a refetch refreshes an unedited form but keeps an unsaved edit, read-only viewer, no request with the experiment off or without read permission), each checked to fail with its behavior broken. Stories cover the visual states. pnpm check, pnpm lint and Vitest for src/pages/AISettingsPage pass. UAT ran against the fork UI UAT server (fork main at ec6cdd6, which includes #78) with this branch's Vite dev server: an org admin set the live limit, an org auditor saw it read-only, the section was hidden with the experiment off, and a real chat in the organization was refused a second live subagent (cannot create a child agent: this chat family has 1 live subagents and the maximum is 1).

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 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-10T01:12:01.886221Z e30f3ec 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d8473006d

ℹ️ 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".

A refetch now updates the form while nothing is edited, so the organization
inputs cannot go stale next to fresh deployment and effective values. A
draft still survives a refetch. The tests assert the cache write instead of
rendered copy.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e30f3ecb13

ℹ️ 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

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: e30f3ecb13

ℹ️ 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 (54351e1e1f) and run fork-ci on it. The head is unchanged.

@ibetitsmike ibetitsmike reopened this Nov 10, 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 (54351e1e1f), 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 reopened this Nov 10, 2026
@ibetitsmike
ibetitsmike merged commit c43627a into main Nov 10, 2026
21 of 28 checks passed
@ibetitsmike
ibetitsmike deleted the mike/org-agent-settings-ui-2-limits-section branch November 10, 2026 02:46
@ibetitsmike

Copy link
Copy Markdown
Owner Author

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

Merge evidence for head e30f3ecb1318d90df3e7ec47dcf82193b7fc935a:

  • fork-ci pull_request run 42742504310 passed; its build job checked out Merge e30f3ecb13 into 54351e1e1f (current main, deployed and healthy at 02:43Z). All checks green.
  • Codex review on this exact head: no major issues. Earlier findings were fixed (pristine form refresh, behavior-based Vitest asserts) or dropped with one-line replies; 0 unresolved review threads. Merge state CLEAN. The change is under site/ only.
  • UAT on the fork UI test server: an org admin set the live subagent limit to 1 and the page showed "Effective: 1"; capacity values of 0 show as "No limit"; an org auditor sees read-only values and gets 403 on writes; with fork-nested-subagents off the section is hidden and sends no request; a plain member sees nothing. A real chat then spawned one child and was refused a second at that limit.

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