GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Follow-up (#2229): expose sessions_spawn to headless/CLI OpenClaw sessions (packaging patch) · Issue #2257 · developing-today/code

Follow-up (#2229): expose sessions_spawn to headless/CLI OpenClaw sessions (packaging patch) #2257

New issue
Copy link
New issue
Copy link
Closed
Closed
Follow-up (#2229): expose sessions_spawn to headless/CLI OpenClaw sessions (packaging patch)#2257
Copy link
Assignees
dezren39
Labels
epic/opencode-platformReprioritization program epic (2026-11-12)kind/featureNew feature or capability requestmeta/follow-upFollow-up spun out of earlier workpriority/highImportant and time-sensitivesource/creatorFiled by the new-issue-creator jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Oct 29, 2026
Issue body actions

Follow-up to #2229 (method 2 of 3). Method 3 — the opencode-route provider front — shipped as the priority build (PR #2250, live-proven). This method was descoped by Drew on 2026-10-29 to a follow-up: sometime soon / when an OpenClaw-origin workload needs to spawn subagents from headless/CLI sessions.

What it adds

sessions_spawn exposed to headless/CLI OpenClaw sessions, so a CLI-driven agent turn can spawn subagents — including ACP-runtime targets such as the opencode-acp entry (the method-1 follow-up), whose live proof depends on this surface.

Determination (already made, 2026-10-29 — this is a packaging patch, not config)

  • In the pinned OpenClaw 2026.10.7 dist, createSessionsSpawnTool is gated by !embedded || options?.allowGatewaySubagentBinding === true (chunk openclaw-tools-QaFYBVQi.mjs). isEmbeddedMode() is a process-local flag set only by EmbeddedTuiBackend.start(), and openclaw agent CLI turns run through that embedded backend even when gateway-attached. allowGatewaySubagentBinding: true is passed only by gateway/channel-side runners. No config key or tool profile feeds either flag — the tool sits in the "sessions" group with profiles ["coding","messaging"]; profile is not the blocker.
  • Empirically absent on every surface tried: CLI via the live gateway, CLI --local, and a server-side chat.send turn (the agent reported sessions_spawn is not in its loadable tool set; the deferred-tool layer answers select:sessions_spawn with "No deferred tool matched").
  • Route: nix-openclaw's instance options expose gatewayPath + gatewayPnpmDepsHash; when gatewayPath is set, the module builds the gateway from that source. So: commit a .patch against the pinned upstream source flipping the gate condition, wire gatewayPath to a patched-source derivation in the fleet config, and document plainly that it is a source patch carried by the packaging, not an upstream config option.

Proof when built

Patch a copied dist tree first for a fast mechanism proof (spawn with agentId="opencode" and agentId="opencode-acp" → check acp_sessions in the OpenClaw state plus a new row in OpenCode session_v2), then land the durable source patch.

Activity

Next
  1. developing-today commented on Oct 29, 2026

    @developing-today
    developing-todayBot
    on Oct 29, 2026 – with developing.today
    Contributor
    More actions

    CODE-1120

  2. github-actions
    assigned
    dezren39
    on Oct 29, 2026
  3. dezren39 commented on Oct 30, 2026

    @dezren39
    dezren39
    on Oct 30, 2026
    MemberAuthor
    More actions

    Drew's directive (2026-10-29 21:44 CDT, main chat): "I want the other options built and functional." This issue (headless/CLI sessions_spawn exposure) is one of those options — build it and prove it functional alongside #2256. Scope note (Drew, 21:45 CDT): sessions_spawn is explicit task dispatch, so OpenCode running the task is correct there; the routing-only principle applies to the opencode-route model door (see the new follow-up issue), not to dispatch paths.

  4. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    Triage @ current main (2026-11-03) — still live, fix path re-confirmed

    Verdict: the gap is real on the pinned package and on upstream main. Nothing has shipped since the 2026-10-29 determination; this issue is a scoped, buildable packaging task, not a config task.

    Evidence (fresh at this triage)

    • Pinned dist still gates the tool. Installed gateway openclaw-2026.10.7:
      /nix/store/f2crizywkx7d7k8831xmnhjx4kcm2ki4-openclaw-gateway-2026.10.7/lib/node_modules/openclaw/dist/openclaw-tools-QaFYBVQi.mjs:16699
      still reads !embedded || options?.allowGatewaySubagentBinding === true ? createSessionsSpawnTool({…}) : null.
    • Upstream main still gates it the same way. src/agents/openclaw-tools.ts:646-647 (raw main, fetched 2026-11-03) carries the identical condition.
    • Still no config key feeds it. allowGatewaySubagentBinding is an internal option param (src/plugins/tools.ts:89,111, src/agents/runtime-plugins.ts:61,86,188), not a config keyspace entry. A settings/profile workaround does not exist — as the issue body already concluded.
    • Version bump does not fix it. npm openclaw latest is 2026.10.10; pinned nix package is 2026.10.7; upstream main is unchanged, so a plain bump buys nothing.
    • The packaging escape hatch is still the only one. nix-openclaw pin 4b261b08c173467dc41db7b43d8265529c435055 (2026-10-30) is the repo HEAD today; gatewayPath + gatewayPnpmDepsHash remain the only source override (nix/modules/home-manager/openclaw/options-instance.nix:61-71).
    • No competing work. No open PR/branch claims Follow-up (#2229): expose sessions_spawn to headless/CLI OpenClaw sessions (packaging patch) #2257 (searched issues, PRs, branches). The only adjacent open work is draft PR Wire OpenClaw ACP adapters to Nix runtime plugin #3275 (ACP adapter wiring, Nix-package the Claude/Codex ACP adapters — repoint OpenClaw acpx off tmp/plugin-captures #1711) — it touches adapters, not this gate; do not fold this into it.

    One design decision blocks implementation

    gatewayPath is typed nullOr str, documented "dev only", and consumed as builtins.path { path = inst.gatewayPath; } (instance.nix:60-63) — it must be a real filesystem path at evaluation time. A pkgs.applyPatches-derived store path is therefore IFD-fragile: it only exists after it is realized, so home-manager switch would fail on a cold store and succeed on a warm one. Options, in order of cleanliness:

    1. Upstream nix-openclaw: add a gatewayPatches (or gatewaySrc) option to the instance module — then this repo carries only a .patch file. Needs a PR to openclaw/nix-openclaw + a pin bump. Cleanest, slowest.
    2. Follow-able fork pin: point the nix-openclaw flake input at a developing-today fork carrying the patch + option, owned by us, maintained with the fork-sync discipline. No upstream dependency. Recommended for this week.
    3. Pre-realized store path: build the patched source first, then point gatewayPath at its store path. Works, but makes the rebuild order-dependent and rejects one-command rebuilds. Not recommended.

    Recommendation: (2) now, (1) as upstream follow-through. This is a packaging-mechanism call inside the worker's remit, so it is not escalated; the follow-up build task below carries the decision.

    Implementation scope when built

    1. patches/openclaw/sessions-spawn-headless.patch — one hunk on src/agents/openclaw-openclaw-tools.ts at the !embedded || gate (exact hunk context: openclaw-tools.ts:646). Simplest faithful change for this fleet: drop the embedded exclusion at build time, keeping options?.allowGatewaySubagentBinding intact. Patch header must state it is carried by packaging, not an upstream config, and name the upstream lines it targets.
    2. Packaging wiring per option (2) above: fork pin in flake.nix/flake.lock + programs.openclaw.instance.gatewayPath/gatewayPnpmDepsHash in home/openclaw/default.nix (currently neither is set).
    3. Proof (mechanism-first, per the issue body): patched tree → CLI turn spawning agentId="opencode" and agentId="opencode-acp" → acp_sessions rows in OpenClaw state + new rows in OpenCode session_v2; also confirm select:sessions_spawn no longer answers "No deferred tool matched" and the tool appears in the CLI turn's loadable set (/tools).

    Ordering, blockers, risks

    • Ordering: proof for agentId="opencode-acp" depends on Follow-up (#2229): ACP-runtime agent entry for OpenClaw→OpenCode dispatch (opencode-acp) #2256 (ACP entry). feat(openclaw): opencode-acp ACP-runtime agent (#2229 mechanism 1) #2237 merged the entry; Follow-up (#2229): ACP-runtime agent entry for OpenClaw→OpenCode dispatch (opencode-acp) #2256 is still open and Wire OpenClaw ACP adapters to Nix runtime plugin #3275 (draft) is actively changing ACP adapter wiring — land the opencode proof first, then publish the opencode-acp half once Follow-up (#2229): ACP-runtime agent entry for OpenClaw→OpenCode dispatch (opencode-acp) #2256/Wire OpenClaw ACP adapters to Nix runtime plugin #3275 settle.
    • Blocker: decision (1)/(2)/(3) above. No fix PR starts before it is chosen; (1) additionally blocks on an upstream PR merge.
    • Maintenance risk: the patch targets internal source, so every openclaw bump breaks it (2026.10.10 already exists). Carry a version assertion next to the patch (fail loudly on drift) rather than silently building an unpatched tree.
    • Not a config defect: do not attempt an openclaw.json/tool-profile workaround; the flag cannot be reached from config.
  5. dezren39
    added
    kind/featureNew feature or capability request
    priority/highImportant and time-sensitive
    meta/follow-upFollow-up spun out of earlier work
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    status/needs-triageNot yet triaged; needs a first look
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 3, 2026
  6. developing-today commented on Nov 3, 2026

    @developing-today
    developing-todayBot
    on Nov 3, 2026 – with developing.today
    Contributor
    More actions

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 30 (priority/none). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

  7. dezren39
    added
    queue/claimedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 3, 2026
  8. 158 remaining items

    Load more actions
  9. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 15, 2026
  10. dezren39
    added 3 commits that reference this issue on Nov 15, 2026

    feat(openclaw): pin nix-openclaw to the developing-today fork (code#2…

    ae04eb4

    feat(openclaw): pin nix-openclaw to the developing-today fork (code#2…

    43f2974

    feat(openclaw): pin nix-openclaw to the developing-today fork (code#2…

    5359612
  11. dezren39 commented on Nov 15, 2026

    @dezren39
    dezren39
    on Nov 15, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done — live proof recorded, PR #5056 merging

    • Agent: repo-worker-code (Muse lane code-c)
    • Session / ID: task 8042
    • Host deployment (this shift): PR feat(openclaw): pin nix-openclaw fork carrying the sessions_spawn headless patch (#2257) #5056 branch rebased on current main (final head dfba981 on main ea122b5), amd toplevel built clean (/nix/store/29szfcgygdndgb6269a8cxyj9238h0qm-nixos-system-amd-26.11.20261102.f9887a8), host switched (system generation 554 → 555), openclaw-gateway restarted 2026-11-14 23:11 CST onto the fork-built gateway (/nix/store/6qzzf57p3vwkmc2wkzsxg0qjrh66w6bg-openclaw-gateway-unstable-157d8c2b, dist verified: createSessionsSpawnTool is in the tool list unconditionally — the !embedded gate is gone).
    • Proof 1 — tool present in an embedded/CLI turn (the exact path the gate blocked): openclaw agent --local turn called sessions_spawn and received a policy answer (agentId is not allowed for sessions_spawn (allowed: main) for the subagent runtime). Before the patch the tool was absent from this turn's loadable set entirely ("No deferred tool matched").
    • Proof 2 — full dispatch, agentId=opencode: gateway turn → sessions_spawn with runtime: "acp", agentId: "opencode" returned status: "accepted", childSessionKey: "agent:main:acp:d6db94ac-1da2-47bd-b221-9125695ba4cd", runId: "281f5105-290f-4384-a34b-f0f89a07c634". Resulting acp_sessions row in OpenClaw state: session_id d7cd029a-5a5c-48a9-8fe4-48b474025acf, backend acpx, agent opencode. The spawned OpenCode serve session was created and its turn ran; the child turn itself ended AcpRuntimeError [ACP_TURN_FAILED]: serve session error: Free usage limit reached — a provider quota wall in the spawned session's model route, not a mechanism failure (the dispatch chain OpenClaw → acpx → OpenCode serve completed end to end).
    • opencode-acp half: superseded by Drew's 2026-11-05 adjudication on Follow-up (#2229): ACP-runtime agent entry for OpenClaw→OpenCode dispatch (opencode-acp) #2256 (the opencode-acp standing agent entry will not be restored; embedded is the standing runtime; a bounded ACP capability proof is tracked separately). No config change made for it here.
    • Blockers removed en route (both pre-existing on main, both fixed in their own PRs): mcpx buildcheck: TestVersionHasOneSourceOfTruth still requires the Containerfile retired by #5771 — mcpx (and the amd toplevel) no longer builds on main #10420 (mcpx buildcheck still required the Containerfile retired by Containers: Nix-build audit — mcpx Containerfile, duplicate lab-ops Dockerfile, amd-crd definition-or-waiver #5771 — fixed by PR fix(mcpx): buildcheck version guard follows the Containerfile retirement (#10420) #10421) and pkgs/id buildcheck: command-list guard fails on main — publish/unpublish/publications (added by #2147 slice 3b) missing from cli/mod.rs doc list and README table; amd toplevel does not build #10424 (pkgs/id command-list guard missing publish/unpublish/publications from id(serve): dynamic publish/unpublish — bind and unbind programs and pages to ports, interfaces, and paths at runtime #2147 — fixed by PR fix(id): list publish/unpublish/publications in cli doc list and README (#10424) #10426). The earlier zig blocker pkgs/id: build.zig fails on zig 0.16 (OptimizeMode.small) — blocks nixos-rebuild switch #10313 was already fixed on main.
  12. dezren39
    added a commit that references this issue on Nov 15, 2026

    Merge pull request #5056 from developing-today/queue/8042-2257-sessio…

    fc585f3
  13. dezren39 commented on Nov 15, 2026

    @dezren39
    dezren39
    on Nov 15, 2026
    MemberAuthor
    More actions

    Closed via PR #5056 (merged fc585f3) with live proof recorded in the agent note above (comment 6889906175): host switched to the fork-built gateway (generation 555), sessions_spawn present in embedded/CLI turns and dispatched agentId=opencode over ACP (acp_sessions row d7cd029a-5a5c-48a9-8fe4-48b474025acf). The opencode-acp half is superseded by Drew's 2026-11-05 adjudication on #2256.

  14. dezren39
    closed this as completedon Nov 15, 2026
  15. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 15, 2026
  16. developing-today
    added
    status:done
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

epic/opencode-platformReprioritization program epic (2026-11-12)kind/featureNew feature or capability requestmeta/follow-upFollow-up spun out of earlier workpriority/highImportant and time-sensitivesource/creatorFiled by the new-issue-creator jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.