Repository navigation
feat: record nested subagent depth and enforce a maximum behind fork-nested-subagents - #33
Conversation
…ind fork-nested-subagents
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b8a2bad38
ℹ️ 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".
…en and the depth flag
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 761a5847aa
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 803ce475be
ℹ️ 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".
…for subagent depth
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41d1d9386a
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Gates checked on head
|
Note
Xum opened this PR for Mike.
Part of #8 (W2 nested subagents, PR 1 of the stack).
Records each subagent's depth and enforces a deployment-wide maximum, behind the new
fork-nested-subagentsexperiment. With the experiment off, spawning behaves exactly like upstream: same errors, no forkdb calls, nochat_subagentsrow.With the experiment on:
chatd.chat_subagentsrow (depth = parent depth + 1) in the same transaction as the chat insert. Chat publishes go through aPublishBuffer, so subscribers see nothing until the transaction commits. The depth check runs again inside the transaction.cannot create a child agent: this chat is at subagent depth N and the maximum subagent depth is M.chat_subagentsrow predates depth tracking, when only roots could spawn, so it counts as depth 1.New option:
--chat-max-subagent-depth/CODER_CHAT_MAX_SUBAGENT_DEPTH, default 2, minimum 1. It lives incodersdk/fork_chat_config.goand hooks into upstream'sChatConfigandOptionswith one line each.Non-root chats do not get the spawn tools yet. That comes in the next PR, so the grandchild path is covered by unit tests here.
Shared seam:
createSubagentChatWithIDincoderd/x/chatd/fork_subagents.gois the spawn-timechat_subagentswrite. W1 (custom agent types) setsagent_typeand W4 extends the same function rather than adding another hook.Upstream chatd internal tests now default to the upstream experiment list (
upstreamExperimentsKnown()), so fork experiments do not change upstream test behavior.Validation
go test ./coderd/x/chatd/(full package, real Postgres in Colima),./coderd/database/forkdb/...,./codersdk/TestCommandHelp,TestServerYAML,TestEnterpriseCommandHelpagainst regenerated goldenschatdmig check; no changes todump.sql,queries.sql.go,querier.goor dbmocktypesGenerated.tsmatchesscripts/apitypingsoutputdocs/reference/apiregenerated withscripts/apidocgenin a Linux container