Skip to content

Use run_in_background on spawn_subagent - #23

Merged
caelaxie merged 2 commits into
mainfrom
cursor/run-in-background-spawn-87ed
Oct 21, 2026
Merged

caelaxie merged 2 commits into
mainfrom
cursor/run-in-background-spawn-87ed

Conversation

@caelaxie

Copy link
Copy Markdown
Contributor

spawn_subagent takes run_in_background, the same parameter upstream names. The grok 1.0.62 user guide (~/.grok/docs/user-guide/16-subagents.md) lists it as "Run in the background and return a subagent ID. Defaults to true."

  • skills/arena/SKILL.md: background: true is now run_in_background: true.
  • skills/poteto-mode/SKILL.md: the same replacement on the spawn defaults line. The rest of that line is unchanged.

Closes #12

Open in Web Open in Cursor 

Grok's spawn_subagent parameter is run_in_background, the same name upstream uses.

Co-authored-by: Kaitian Xie <[email protected]>

@caelaxie caelaxie left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

verdict: changes requested (proof only).

content passes. both lines are exactly #12's smallest fix and match upstream 88d4751 verbatim (run_in_background: true), rest of the poteto-mode line untouched, Closes #12 present, not a draft.

missing: harness proof. no ci runs on this repo and the body has none. post a pr comment from grok 1.0.62 on the exact head 65e7951:

  • grok plugin install --trust of this branch pinned to 65e79516d2029e0203fa966b5023185a62a8f307
  • grok plugin list (and validate) showing pstack loaded
  • the installed copies of skills/arena/SKILL.md L22 and skills/poteto-mode/SKILL.md L95 grepped for run_in_background: true

if a live model turn is blocked by cli auth, install+list+installed-copy grep at this head is enough for a text-only change. i'll merge once that lands.

Comment thread skills/poteto-mode/SKILL.md Outdated
**Use `subagent_type: "pstack:poteto-agent"` for any subagent you spawn inside a playbook step** (code-writing delegates, ad-hoc helpers). The chat that receives `/poteto-mode` runs the playbook and is the only chat that may call `spawn_subagent`. A child cannot spawn. Never spawn a `poteto-agent` to run the playbook itself. Routed workflow skills (`how`, `why`, `interrogate`, `reflect`, `swarm`) omit `subagent_type`, or set the type they name. Respect what the skill prescribes, don't override to `poteto-agent`.

**Defaults for every `spawn_subagent` call.** `background: true`. There is no readonly flag. When a child must not edit files, say so in the prompt. MCP stays available through `search_tool` and `use_tool`. Pass file pointers, not inlined context. Pass `model` only when the tool schema includes it. Otherwise omit `model` so the child inherits the parent. If it rejects a slug, use the closest slug from `grok models` and say so. Do not invent an effort suffix. Defaults are `grok-4.7-build-fast` for code and `grok-4.7` for prose and judgment. Code delegates tier by difficulty. The hardest changes (cross-cutting design, gnarly concurrency, subtle algorithms) go to your strongest judgment model (`grok-4.7`), whether the task needs judgment on vague intent or is a precisely specified sequence of steps to execute to the letter. Trivial mechanical edits go to your fast code model. Per-role lines in `~/.grok/rules/pstack-models.md` (written by `/setup-pstack`) override these defaults and the model choices in the routed skills (`how`, `why`, `arena`, `swarm`, `architect`, `interrogate`, `reflect`). A role with no line keeps its default, and a role line of `inherit-parent` or `auto` runs that role on the parent chat model (omit `model`). Each code playbook's configured model comes from its line (`feature, refactoring`, `bug-fix`, `perf-issue`, or `hillclimb`), and the hardest changes read `hardest tasks`. Prose and judgment read `judgment and prose`. When `spawn_subagent` has no `model` argument, omit `model` for this session so every role inherits the parent, and apply step 1 of **setup-pstack** so the next session can pass `model`.
**Defaults for every `spawn_subagent` call.** `run_in_background: true`. There is no readonly flag. When a child must not edit files, say so in the prompt. MCP stays available through `search_tool` and `use_tool`. Pass file pointers, not inlined context. Pass `model` only when the tool schema includes it. Otherwise omit `model` so the child inherits the parent. If it rejects a slug, use the closest slug from `grok models` and say so. Do not invent an effort suffix. Defaults are `grok-4.7-build-fast` for code and `grok-4.7` for prose and judgment. Code delegates tier by difficulty. The hardest changes (cross-cutting design, gnarly concurrency, subtle algorithms) go to your strongest judgment model (`grok-4.7`), whether the task needs judgment on vague intent or is a precisely specified sequence of steps to execute to the letter. Trivial mechanical edits go to your fast code model. Per-role lines in `~/.grok/rules/pstack-models.md` (written by `/setup-pstack`) override these defaults and the model choices in the routed skills (`how`, `why`, `arena`, `swarm`, `architect`, `interrogate`, `reflect`). A role with no line keeps its default, and a role line of `inherit-parent` or `auto` runs that role on the parent chat model (omit `model`). Each code playbook's configured model comes from its line (`feature, refactoring`, `bug-fix`, `perf-issue`, or `hillclimb`), and the hardest changes read `hardest tasks`. Prose and judgment read `judgment and prose`. When `spawn_subagent` has no `model` argument, omit `model` for this session so every role inherits the parent, and apply step 1 of **setup-pstack** so the next session can pass `model`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

matches upstream L95 for this token. needs the installed copy at head 65e7951 grepped in the proof comment.

@cursor

cursor Bot commented Oct 21, 2026

Copy link
Copy Markdown

Harness proof from grok 1.0.62 on head 65e79516d2029e0203fa966b5023185a62a8f307. No code change. Checked out that sha, fresh HOME.

$ git rev-parse HEAD
65e79516d2029e0203fa966b5023185a62a8f307

$ grok --version
grok 1.0.62 (1474f9cbdd91)

$ grok plugin validate .
Plugin manifest is valid.
  name: pstack
  version: 0.15.29
  description: if you want to go fast, go deep first. pstack helps you write less, but higher quality code. rigorous agent workflows you can parallelize with confidence.
  components: 1 skill dir(s), 0 command dir(s), 1 agent dir(s)

$ grok plugin install https://github.com/pstack-ports/grok-pstack@65e79516d2029e0203fa966b5023185a62a8f307 --trust
Installed 1 plugin(s) from https://github.com/pstack-ports/grok-pstack@65e79516d2029e0203fa966b5023185a62a8f307: pstack

$ grok plugin list --json
[
  {
    "status": "installed",
    "name": "pstack",
    "repo_key": "grok-pstack-619a4a2c",
    "version": "0.15.29",
    "path": "/tmp/grok-pr23-z7n4e8zr/.grok/installed-plugins/grok-pstack-619a4a2c",
    "source": "https://github.com/pstack-ports/grok-pstack",
    "marketplace": null
  }
]

$ grep -n 'run_in_background: true' \
    "$PLUGIN/skills/arena/SKILL.md" \
    "$PLUGIN/skills/poteto-mode/SKILL.md"
/tmp/grok-pr23-z7n4e8zr/.grok/installed-plugins/grok-pstack-619a4a2c/skills/arena/SKILL.md:22:Spawn all N subagents in one message with `run_in_background: true`, each with the task, the path to the shared grounding, its own output path, and instructions to produce the artifact and a short rationale naming the alternatives it considered and what it rejected.
/tmp/grok-pr23-z7n4e8zr/.grok/installed-plugins/grok-pstack-619a4a2c/skills/poteto-mode/SKILL.md:95:**Defaults for every `spawn_subagent` call.** `run_in_background: true`. There is no readonly flag. When a child must not edit files, say so in the prompt. MCP stays available through `search_tool` and `use_tool`. Pass file pointers, not inlined context. Pass `model` only when the tool schema includes it. Otherwise omit `model` so the child inherits the parent. If it rejects a slug, use the closest slug from `grok models` and say so. Do not invent an effort suffix. Defaults are `grok-4.7-build-fast` for code and `grok-4.7` for prose and judgment. Code delegates tier by difficulty. The hardest changes (cross-cutting design, gnarly concurrency, subtle algorithms) go to your strongest judgment model (`grok-4.7`), whether the task needs judgment on vague intent or is a precisely specified sequence of steps to execute to the letter. Trivial mechanical edits go to your fast code model. Per-role lines in `~/.grok/rules/pstack-models.md` (written by `/setup-pstack`) override these defaults and the model choices in the routed skills (`how`, `why`, `arena`, `swarm`, `architect`, `interrogate`, `reflect`). A role with no line keeps its default, and a role line of `inherit-parent` or `auto` runs that role on the parent chat model (omit `model`). Each code playbook's configured model comes from its line (`feature, refactoring`, `bug-fix`, `perf-issue`, or `hillclimb`), and the hardest changes read `hardest tasks`. Prose and judgment read `judgment and prose`. When `spawn_subagent` has no `model` argument, omit `model` for this session so every role inherits the parent, and apply step 1 of **setup-pstack** so the next session can pass `model`.

Arena is line 22. poteto-mode is line 95. CI on this sha: https://github.com/pstack-ports/grok-pstack/actions/runs/39532362529 (Validate plugin, success).

@caelaxie caelaxie left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

verdict: passes (comment review, same account). proof on head 65e7951: grok 1.0.62 validate + install --trust + list, installed arena L22 and poteto-mode L95 carry run_in_background: true. validate plugin ci green. squash-merging.

@caelaxie caelaxie left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

verdict: changes requested (rebase only).

content and proof still pass, but the branch now conflicts with main (likely skills/poteto-mode/SKILL.md, touched by the #24 budget-ladder merge e76b7fa). rebase onto main, keep only the background: true -> run_in_background: true swap in arena L22 and the poteto-mode spawn-defaults line, leave the rest of main's line as is. then repost grok 1.0.62 validate + install --trust pinned to the new head + list + installed grep, and i'll merge.

The poteto-mode defaults line keeps the merged budget-ladder wording and names the spawn flag run_in_background.

Co-authored-by: Kaitian Xie <[email protected]>
@cursor

cursor Bot commented Oct 21, 2026

Copy link
Copy Markdown

Harness proof for head be05fc59732e4a95b063f19f5785bf5a1754e5b0 on cursor/run-in-background-spawn-87ed. Checked out at that sha. Fresh HOME=/tmp/proof-23/home. Installed skills/arena/SKILL.md and skills/poteto-mode/SKILL.md match this checkout byte for byte.

$ grok --version
grok 1.0.62 (1474f9cbdd91)

$ git rev-parse HEAD
be05fc59732e4a95b063f19f5785bf5a1754e5b0

$ grok plugin validate .
Plugin manifest is valid.
  name: pstack
  version: 0.15.29
  description: if you want to go fast, go deep first. pstack helps you write less, but higher quality code. rigorous agent workflows you can parallelize with confidence.
  components: 1 skill dir(s), 0 command dir(s), 1 agent dir(s)

$ grok plugin install https://github.com/pstack-ports/grok-pstack@cursor/run-in-background-spawn-87ed --trust
Installed 1 plugin(s) from https://github.com/pstack-ports/grok-pstack@cursor/run-in-background-spawn-87ed: pstack

$ grok plugin list --json
[
  {
    "status": "installed",
    "name": "pstack",
    "repo_key": "grok-pstack-619a4a2c",
    "version": "0.15.29",
    "path": "/tmp/proof-23/home/.grok/installed-plugins/grok-pstack-619a4a2c",
    "source": "https://github.com/pstack-ports/grok-pstack",
    "marketplace": null
  }
]

$ grep -n run_in_background -r /tmp/proof-23/home/.grok/installed-plugins/grok-pstack-619a4a2c
skills/arena/SKILL.md:22:Spawn all N subagents in one message with `run_in_background: true`, each with the task, the path to the shared grounding, its own output path, and instructions to produce the artifact and a short rationale naming the alternatives it considered and what it rejected.
skills/poteto-mode/SKILL.md:95:**Defaults for every `spawn_subagent` call.** `run_in_background: true`. There is no readonly flag. When a child must not edit files, say so in the prompt. MCP stays available through `search_tool` and `use_tool`. Pass file pointers, not inlined context. Pass `model` only when the tool schema includes it. Otherwise omit `model` so the child inherits the parent. If it rejects a slug, use the closest slug from `grok models` and say so. Defaults are `grok-4.6` at `xhigh` for code and for prose and judgment. Code delegates tier by difficulty. The hardest changes (cross-cutting design, gnarly concurrency, subtle algorithms) go to your strongest judgment model (`grok-4.6` at `xhigh`), whether the task needs judgment on vague intent or is a precisely specified sequence of steps to execute to the letter. Trivial mechanical edits go to your fast code model. Per-role lines in `~/.grok/rules/pstack-models.md` (written by `/setup-pstack`) override these defaults and the model choices in the routed skills (`how`, `why`, `arena`, `swarm`, `architect`, `interrogate`, `reflect`). A role with no line keeps its default, and a role line of `inherit-parent` or `auto` runs that role on the parent chat model (omit `model`). Each code playbook's configured model comes from its line (`feature, refactoring`, `bug-fix`, `perf-issue`, or `hillclimb`), and the hardest changes read `hardest tasks`. Prose and judgment read `judgment and prose`. When `spawn_subagent` has no `model` argument, omit `model` for this session so every role inherits the parent, and apply step 1 of **setup-pstack** so the next session can pass `model`.

@caelaxie caelaxie left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

pass at be05fc5. main...head is only the background → run_in_background swap in arena and poteto-mode, #24's ladder wording intact, 0 behind main. proof (install --trust, list, validate) and ci green at this head. closes #12. squash-merging.

@caelaxie
caelaxie merged commit 406e063 into main Oct 21, 2026
1 check passed
@caelaxie
caelaxie deleted the cursor/run-in-background-spawn-87ed branch October 21, 2026 03:21
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.

audit: spawns use background: true instead of run_in_background: true

2 participants