Skip to content

docs: map custom agent types, the subagent cascade, and search_chats in the pstack adapter - #59

Merged
ibetitsmike merged 11 commits into
mainfrom
mike/pstack-adapter-agent-definitions
Nov 9, 2026
Merged

ibetitsmike merged 11 commits into
mainfrom
mike/pstack-adapter-agent-definitions

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Part of #4, #7, #8 and #10.

Updates docs/fork/pstack-adapter.md for #51, which lets spawn_agent take custom agent types behind fork-agent-definitions, for #42, which cascades interrupts and archives through a nested subagent family behind fork-nested-subagents, for #52, which adds search_chats behind fork-chat-todos, for #53, which adds include_tool_calls to wait_agent behind the same experiment, for #45, which lets an organization's max_depth lower the subagent depth, and for #58, which enforces a custom agent's tool fields on its child chats. The page now says what fork main at b457b3f1bf does.

  • Setup. A new step 6 copies <pstack>/agents/*.md to ~/.coder/agents/, which the workspace agent scans, and step 4's name-collision guard now covers ~/.coder/agents/ too. The later steps move up by one, so the AGENTS.md block sits under step 10 with 4-space indentation, and step 14 points to step 11. The block's todo line loses its semicolon.
  • Custom types (Subagent fields, status stays W1). poteto-agent and comment-sicko no longer say "No custom types". With the experiment, pass the type if the spawn_agent description lists it, otherwise fall back to general with the pasted body as before. A new "Custom agent types" section covers where definitions come from, pinning and Refresh context, the system-message body, model resolution, built-in names winning, and the experiment-off error. It says a custom type starts with its base type's tools and loses the ones its tool fields remove.
  • subagent_type: generalPurpose. The type list adds custom types with the experiment, and the advice stays type: "general".
  • Paths row .cursor/agents/, <pstack>/agents/ (status stays W1). "Not read" becomes the four directories the workspace agent reads, which chats get as custom types with the experiment, and points to Setup.
  • Nested subagents. Three sentences for feat(coderd): cascade interrupts and archive active nested subagent families #42: with the experiment on, Stop and interrupt_agent interrupt a chat's active descendants first, and archiving a root whose family is still working interrupts it, waits up to 30 seconds, then archives every member, and that the archive fails and archives nothing if a member is still working after 30 seconds.
  • search_chats (feat(coderd/x/chatd): add the search_chats chat tool #52). The page claimed twice that no tool lists other chats. "Chat transcripts" now says search_chats finds top-level chats with the chat list search syntax, only your user's own chats unless the query adds source:created_by_me,shared_with_me, and that a child's ID comes from list_agents. "Recent work across chats" (status stays W4) lists recent chats with an empty query and reads them with read_chat_transcript, and skips only without the tools. The Paths transcripts row sends a missing top-level chat ID to search_chats and a missing child ID to list_agents.
  • wait_agent and depth (feat(coderd/x/chatd): add include_tool_calls to wait_agent #53, feat: store organization subagent limits and enforce max_depth behind fork-nested-subagents #45). "Chat transcripts" no longer says wait_agent returns only the final reply: with include_tool_calls, 1 to 20, it adds up to that many of the child's latest tool calls, oldest first. "Nested subagents" says an organization's max_depth subagent limit can lower the depth but not raise it.
  • Custom agent tool policy (feat(coderd): enforce custom agent tool policy on child chats #58). A new section says that the spawn stores the definition's tools, disallowed_tools, readonly and mcp fields with the child, and each turn of the child removes the tools they don't allow, with the Claude Code aliases, the mcp__<server>__<tool> match, exact server names for mcp, and how find_tools follows mcp. A child that loses spawn_agent, wait_agent or list_agents loses the orchestration guidance, and one that loses read_skill loses the skill index. It states feat(coderd): enforce custom agent tool policy on child chats #58's limits: readonly keeps execute, so it doesn't make a child read-only, and the policy isn't a sandbox. pstack's two agents set none of these fields.
  • AGENTS.md block. New lines map recent chats and a missing top-level chat ID to search_chats, and a missing child ID to list_agents, and the skip line now applies only without those tools. One line under Task maps a custom subagent_type to that type when spawn_agent lists it, else to general with the body of ~/.coder/agents/<name>.md.
  • Evidence. The header names b457b3f1bf. A new bullet cites feat(coderd): enforce custom agent tool policy on child chats #58's store, load, filter and prompt changes. feat(coderd): enforce custom agent tool policy on child chats #58 shifted the cited lines in fork_subagents.go by 2 and 15 and in turn_environment.go by 11 below its hook, and every cited range was rechecked line by line against 106a9355f6. In subagent_operations.go, feat(coderd): enforce custom agent tool policy on child chats #58 changed only the argument on the first line of the cited :471-476 call. New bullets cite the cascade, the agent directories, the definition parser, feat: resolve custom agent types in spawn_agent #51's spawn path and search_chats, and the transcript bullet's fork_tools.go range grows by the line feat(coderd/x/chatd): add the search_chats chat tool #52 added. feat: resolve custom agent types in spawn_agent #51 and feat: store organization subagent limits and enforce max_depth behind fork-nested-subagents #45 shifted the cited lines in fork_subagents.go (the subagentCanSpawn range now includes the organization depth lookup), feat: resolve custom agent types in spawn_agent #51 shifted subagent_operations.go by 2, and feat(coderd/x/chatd): add include_tool_calls to wait_agent #53 grew the fork_tools.go block by a line, so the references now point at the same code. subagent_catalog.go changed only outside its cited ranges (lines 185, 233 and 344), and no other cited file changed since f015332553.

Validation

  • markdown-table-formatter 1.6.1 and markdownlint-cli2 0.16.0 on the page: 0 errors. The diff has no semicolons, em dashes, en dashes, or spaced double hyphens.
  • Every claim about custom types is checked against fork_agent_definitions.go, every claim about chat search against fork_search_chats.go, and the wait_agent and depth claims against fork_wait_agent.go and fork_subagents.go, at b457b3f1bf, and the tool policy claims against fork_agent_tool_policy.go and feat(coderd): enforce custom agent tool policy on child chats #58's description. search_chats is in neither the plan-mode nor the explore allowlist in turn_environment.go.
  • pstack's two agents at c742dd61706f set no model and no base_type, so they parse to base type general on the parent's model.

Xum opened this PR on behalf of @ibetitsmike.

@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-09T18:15:09.496470Z 39d2c01 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: af9fff8d8a

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

Comment thread docs/fork/pstack-adapter.md Resolved
Comment thread docs/fork/pstack-adapter.md Resolved
Comment thread docs/fork/pstack-adapter.md Resolved
Comment thread docs/fork/pstack-adapter.md Resolved
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum acted for Mike on this comment.

@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: bcdb429cbd

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

Comment thread docs/fork/pstack-adapter.md Resolved
Comment thread docs/fork/pstack-adapter.md Resolved
Comment thread docs/fork/pstack-adapter.md Resolved
Comment thread docs/fork/pstack-adapter.md Resolved
Comment thread docs/fork/pstack-adapter.md Resolved
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum acted for Mike on this comment.

@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: f3dadbfb66

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

Comment thread docs/fork/pstack-adapter.md Resolved
Comment thread docs/fork/pstack-adapter.md Resolved
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum acted for Mike on this comment.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: addec16850

ℹ️ 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 acted for Mike on this comment.

@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: 7509db45d2

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

Comment thread docs/fork/pstack-adapter.md Resolved
Comment thread docs/fork/pstack-adapter.md Resolved
Comment thread docs/fork/pstack-adapter.md Resolved
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum acted for Mike on this comment.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 19fbfdc0c0

ℹ️ 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 acted for Mike on this comment.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 39d2c01b83

ℹ️ 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
ibetitsmike merged commit 68fbdea into main Nov 9, 2026
14 checks passed
@ibetitsmike
ibetitsmike deleted the mike/pstack-adapter-agent-definitions branch November 9, 2026 19:20
@ibetitsmike

Copy link
Copy Markdown
Owner Author

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

Merge evidence for head 39d2c01b83cc90d3ffef6bca1ffe2f6fe0979a82 (docs only, docs/fork/pstack-adapter.md):

  • fork-ci run 42671887191, attempt 4: all 7 jobs passed. Attempts 1 to 3 failed only because of the GitHub Actions outage, and no code changed.
  • Codex review receipt on 39d2c01b83 at 18:15:08Z: no major issues. 0 unresolved review threads.
  • Contains main b457b3f1bf (feat(coderd): enforce custom agent tool policy on child chats #58). The lead checked the new "Custom agent tool policy" section against coderd/x/chatd/fork_agent_tool_policy.go on main.

This was referenced Nov 9, 2026
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