Skip to content

🤖 feat: add sticky subagent workspaces#3246

Open
coadler wants to merge 1 commit intomainfrom
feat/sticky-subagents
Open

🤖 feat: add sticky subagent workspaces#3246
coadler wants to merge 1 commit intomainfrom
feat/sticky-subagents

Conversation

@coadler
Copy link
Copy Markdown
Collaborator

@coadler coadler commented May 6, 2026

Summary

Adds an explicit sticky option for spawned sub-agent tasks so a user-requested child workspace can remain inspectable after the sub-agent reports instead of being auto-deleted.

Background

Sub-agent workspaces normally clean themselves up after agent_report. Some user workflows need the resulting child workspace to stick around for inspection or follow-up, but that preservation should happen only when the user explicitly asks for it.

Implementation

  • Adds optional sticky input guidance to the task tool and documents that agents must not set it on their own.
  • Persists sticky sub-agents as taskSticky workspace metadata and surfaces the flag through task_list.
  • Skips automatic reported-task cleanup for sticky child workspaces, including archive-triggered cleanup.
  • Blocks non-force removal of parent workspaces while sticky completed descendants still exist.

Validation

  • bun test src/common/utils/tools/toolDefinitions.test.ts
  • bun test src/node/services/tools/task.test.ts src/node/services/tools/task_list.test.ts
  • bun test src/node/services/taskService.test.ts --test-name-pattern "sticky|preserve subagents until archive|create persists sticky"
  • bun test src/node/services/workspaceService.test.ts --test-name-pattern "sticky completed descendants|preserved completed descendants"
  • make static-check
  • make fmt
  • make fmt-check
  • make typecheck
  • make lint

Risks

Low-to-medium regression risk in task cleanup and workspace removal behavior. The change is gated by an explicit sticky flag and includes targeted coverage for non-sticky cleanup, sticky cleanup suppression, task tool plumbing, and parent removal guards.


Generated with mux • Model: openai:gpt-5.5 • Thinking: xhigh • Cost: $0.00

@coadler
Copy link
Copy Markdown
Collaborator Author

coadler commented May 6, 2026

@codex review

@mintlify
Copy link
Copy Markdown

mintlify Bot commented May 6, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Mux 🟢 Ready View Preview May 6, 2026, 9:57 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@coadler
Copy link
Copy Markdown
Collaborator Author

coadler commented May 6, 2026

@codex review

Please take another look now that the PR body formatting is fixed.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

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

Allow task tool callers to request sticky subagents that remain available after reporting instead of being auto-deleted. Persist the sticky flag on child task workspaces, surface it in task_list, and block non-force parent removal while sticky descendants exist.\n\nCo-authored-by: Mux <noreply@coder.com>
@coadler coadler force-pushed the feat/sticky-subagents branch from 9eff6d6 to 6b65e3f Compare May 7, 2026 16:43
@coadler
Copy link
Copy Markdown
Collaborator Author

coadler commented May 7, 2026

@codex review

Rebased onto latest main; please take another look.

@coadler
Copy link
Copy Markdown
Collaborator Author

coadler commented May 7, 2026

@codex review

Rebased on main; please take another look.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

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

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