Repository navigation
Use run_in_background on spawn_subagent - #23
Conversation
Grok's spawn_subagent parameter is run_in_background, the same name upstream uses. Co-authored-by: Kaitian Xie <[email protected]>
caelaxie
left a comment
There was a problem hiding this comment.
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 --trustof this branch pinned to65e79516d2029e0203fa966b5023185a62a8f307grok plugin list(and validate) showing pstack loaded- the installed copies of
skills/arena/SKILL.mdL22 andskills/poteto-mode/SKILL.mdL95 grepped forrun_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.
| **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`. |
There was a problem hiding this comment.
matches upstream L95 for this token. needs the installed copy at head 65e7951 grepped in the proof comment.
|
Harness proof from grok 1.0.62 on head 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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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]>
|
Harness proof for head |
spawn_subagenttakesrun_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 totrue."skills/arena/SKILL.md:background: trueis nowrun_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