Skip to content

feat(openclaw): pin nix-openclaw fork carrying the sessions_spawn headless patch (#2257) - #5056

Open
dezren39 wants to merge 2 commits into
mainfrom
queue/8042-2257-sessions-spawn-headless
Open

dezren39 wants to merge 2 commits into
mainfrom
queue/8042-2257-sessions-spawn-headless

Conversation

@dezren39

@dezren39 dezren39 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Wiring for #2257 (queue task 8042), following the task 7861 triage's recommended mechanism (option 2: fork pin). Not merge-ready yet — the host rebuild and live proof are still owed; this PR is the reviewable wiring half.

What landed where

  • Fork: developing-today/nix-openclaw @ da8a763 carries nix/patches/allow-sessions-spawn-headless.patch in the gateway build — one hunk on upstream src/agents/openclaw-tools.ts (pinned 2026.10.7) dropping the embedded exclusion from the createSessionsSpawnTool gate, applied by gateway-postpatch.sh with --fuzz=0 + a grep assertion, gated on sourceInfo.applySessionsSpawnHeadlessPatch (set for the pinned source). An upstream bump that moves the gate fails the build loudly instead of silently shipping an unpatched gateway.
  • This PR: the nix-openclaw flake input points at the fork; flake.lock updated (4b261b08 → da8a7633).

Verified

  • The patch applies with --fuzz=0 against the exact pinned 2026.10.7 openclaw-tools.ts (gate at line 593).
  • nixosConfigurations.amd evaluates with the fork pin (toplevel drv instantiated cleanly).

Still owed before merge (task 8042 is parked on this)

  1. Rebuild the laptop host config from this branch and restart the gateway.
  2. Mechanism proof on the rebuilt config: a headless/CLI turn spawns agentId="opencode" → acp_sessions row in OpenClaw state + new OpenCode session_v2 row; select:sessions_spawn no longer answers "No deferred tool matched".
  3. The agentId="opencode-acp" half of the proof waits on Follow-up (#2229): ACP-runtime agent entry for OpenClaw→OpenCode dispatch (opencode-acp) #2256 / draft PR Wire OpenClaw ACP adapters to Nix runtime plugin #3275 settling, per the triage ordering.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…257)

The fork (developing-today/nix-openclaw @da8a763) carries allow-sessions-spawn-headless.patch in the gateway build: sessions_spawn offered in embedded (headless/CLI) turns, which upstream gates off and no config key can reach (task 7861 triage, option 2). Patch applies with --fuzz=0 plus a grep assertion in gateway-postpatch.sh, so an upstream bump that moves the gate fails the build loudly.

Verified: patch applies cleanly to the exact pinned 2026.10.7 source; nixosConfigurations.amd evaluates with the fork pin (toplevel drv instantiated). NOT yet done: host rebuild + live proof (CLI turn spawning agentId=opencode; the opencode-acp half waits on #2256/PR #3275 settling) -- this PR stays unmerged until the proof is recorded on #2257.
@dezren39
dezren39 requested a review from a team as a code owner November 3, 2026 17:52
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-03T17:53:00.771001Z
We couldn’t complete this review. Comment @codex review to try again.
065dcd9 PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4a188a0c-72f1-4eaa-bcbf-d0743d30cbe0
Commits

Reviewing files that changed from the base of the PR and between 14ccb2e and d7e9830.

Files ignored due to path filters: 1
  • flake.lock is excluded by !**/*.lock
Files selected for processing: 1
  • flake.nix
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@dezren39

dezren39 commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

🤖 Agent note · parked

  • Agent: queue worker (repo-worker-code), lane code-d
  • Session / ID: task 8042
  • Found via: queue claim (resume from awaiting_ci checkpoint)
  • Task: PR feat(openclaw): pin nix-openclaw fork carrying the sessions_spawn headless patch (#2257) #5056 does NOT deliver the patch on the path the host actually builds — verified defect, task 8042 parked on fixing the fork packaging selection.
  • Evidence (fresh, laptop, 2026-11-03):
    • Built the fork's openclaw-gateway (developing-today/nix-openclaw @ da8a763): result /nix/store/9ax15k4d6w6d028r1kcmis1b1wpz93fa-openclaw-gateway-2026.10.7; its dist openclaw-tools-QaFYBVQi.mjs:16699 still reads !embedded || options?.allowGatewaySubagentBinding === true ? createSessionsSpawnTool({…}) — the gate the patch was supposed to drop.
    • Evaluating nixosConfigurations.amd from PR feat(openclaw): pin nix-openclaw fork carrying the sessions_spawn headless patch (#2257) #5056's branch resolves the gateway service to that exact store path (wrapper → openclaw-2026.10.7 → 9ax15k4d…-openclaw-gateway-2026.10.7), so a host rebuild + gateway restart would still ship the unpatched gate.
    • Root cause: the gateway derivation (drv 3xz1j8i661y9c45dv7lwrwz7rv7xlss7) builds with openclaw-gateway-npm-install.sh and its env has NO PATCH_SESSIONS_SPAWN_HEADLESS (only OPENCLAW_PATCH_NPM_DIST_SCRIPT). In the fork, nix/packages/openclaw-gateway.nix sets useNpmPackage = gatewaySrc == null && sourceInfo ? gatewayNpmDepsHash && bundledAcpx != null — the prebuilt npm tarball path never runs gateway-postpatch.sh, so allow-sessions-spawn-headless.patch is dead code on this path.
  • Resume condition: fix the fork packaging so the host-resolved gateway is built from source with the patch applied (or the npm dist is patched equivalently): the resuming worker verifies the resolved gateway drv carries PATCH_SESSIONS_SPAWN_HEADLESS and the built dist no longer contains the !embedded || gate, updates the pin in PR feat(openclaw): pin nix-openclaw fork carrying the sessions_spawn headless patch (#2257) #5056 if the fork rev moves, then does the host rebuild + gateway restart + live spawn proof already recorded on PR feat(openclaw): pin nix-openclaw fork carrying the sessions_spawn headless patch (#2257) #5056.
  • Expectation: effort class m; done = patched gateway verified in the built dist, host rebuilt, live proof recorded, PR feat(openclaw): pin nix-openclaw fork carrying the sessions_spawn headless patch (#2257) #5056 merged.

@dezren39

dezren39 commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

🤖 Agent note · parked

What changed this shift (all verified fresh):

  • Root defect confirmed: nix/packages/openclaw-gateway.nix in the fork selected the prebuilt npm package whenever gatewayNpmDepsHash was set, so gateway-postpatch.sh never ran and the sessions_spawn patch never applied.
  • Fork developing-today/nix-openclaw pushed: ac752ae (carried source patches force the source build, never the npm path), fd3fb39 (pin the source build's pnpmDepsHash = sha256-XlBV+o+/TodBc2OGJck+H1Al/coOYgm84TFTtd4l4u8=, derived from the fixed-output mismatch), b4f1c9d (pin OPENCLAW_NIX_TSDOWN_MAX_OLD_SPACE_MB=8192 — tsdown refuses to build in the Nix sandbox without an explicit heap).
  • Gateway source build now succeeds: /nix/store/4lf9znhin4mbwj0al4lm1nb3a4m6i0fb-openclaw-gateway-unstable-157d8c2b. Its dist calls createSessionsSpawnTool unconditionally; the deployed npm dist still has the !embedded || options?.allowGatewaySubagentBinding === true ? gate — the patch lands.
  • PR feat(openclaw): pin nix-openclaw fork carrying the sessions_spawn headless patch (#2257) #5056 updated: flake.lock nix-openclaw pin bumped to fork b4f1c9d (commit d7e983032); nixosConfigurations.amd evaluates cleanly with the pin.

This branch has not been deployed

No deployments
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