Skip to content

feat(nodes): continue Claude catalog sessions on paired nodes via streaming CLI agent runs#105833

Merged
steipete merged 23 commits into
mainfrom
feat/node-cli-agent-runs
Jul 13, 2026
Merged

feat(nodes): continue Claude catalog sessions on paired nodes via streaming CLI agent runs#105833
steipete merged 23 commits into
mainfrom
feat/node-cli-agent-runs

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Claude Code catalog sessions on paired nodes were view-only: continueClaudeSession rejected any hostId other than gateway:local, so a session whose files live on another machine could be browsed but never continued. Closes #105529.

Why This Change Was Made

Continuing a Claude session must run the real claude CLI on the machine that owns the session files (its ~/.claude, its auth) — OpenClaw stays a frontend and never substitutes its own inference. This PR ships the full TS stack for that, opt-in and approval-gated end to end:

  • Streaming node invoke (additive transport): new node.invoke.progress events ({invokeId, nodeId, seq, chunk}) with strict seq ordering, bounded out-of-order buffering, idle-timeout reset on progress, hard-cap timeout, and node.invoke.cancel. Legacy single-result invokes stay byte-identical (cancel frames are gated to streaming invokes). Progress handlers are node-scoped and bind invokeId to the owning node's connection — no cross-node injection.
  • Node command agent.cli.claude.run.v1 (TS node host): advertised only when the node-local config nodeHost.agentRuns.claude.enabled is true AND the claude binary resolves on the node — the gateway can never force it on. Requests are validated against a strict Claude flag allowlist (bypassPermissions rejected in both arg forms), env passthrough is allowlisted, cwd must exist, and every run flows through the existing system.run exec-approval policy with the exact validated argv. Output is capped (200KB, 16KB chunks with backpressure), stderr tailed, process tree SIGKILLed on cancel/timeout, and the system prompt is materialized in a node-local 0600 temp file that is always cleaned up.
  • cli-runner placement branch: sessions with execHost === "node" run one-shot claude -p turns through the streaming invoke, feeding the same JSONL parser as local runs (session-id capture, fork markers, tool events unchanged). Warm stdio, gateway-loopback MCP, skills dirs, reseed-from-transcript, and attachments are cleanly disabled for node runs (rejected or omitted, double-enforced by the node-side allowlist); local runs are byte-identical.
  • Catalog wiring: node rows become continuable when the node advertises the run command AND the gateway's node command policy permits it (deny-wins, enforced at projection, continue, and invoke time). Adoption re-resolves the record from the node itself (client-supplied paths never trusted), imports bounded history via the existing read command, and binds the session with execNode/execCwd through the trusted creation seam. First-turn --fork-session semantics identical to local adoption.

Mac-app (Swift) nodes simply never advertise the command and remain view-only until the app ships it.

User Impact

With a headless node host opted in (nodeHost.agentRuns.claude.enabled: true + claude installed), Claude Code sessions on that machine appear in the session catalog and can be continued like native sessions: each turn runs on the node with the node's Claude auth and settings, streams output live, and respects the node's exec approval policy. Nothing changes for nodes that do not opt in; existing node/gateway deployments see zero wire-format changes.

Evidence

  • Focused matrix green post-rebase (8 Vitest shards): node-registry transport ordering/idle/disconnect, node-host argv-validation/approval/caps/cancel, cli-runner placement/JSONL-across-chunks/fork/deadline-during-approval, config contract, plugin runtime projection, catalog adoption/rejection paths.
  • Codex-side validation on Linux Testbox: 12 test files (574 executions), check:changed (12m21s), pnpm build — all green pre-review.
  • Three independent deep reviews (transport, cli-runner placement, catalog/config/plugin seams): all SOLID, zero P1s. The one P2 (hard-timeout previously emitted node.invoke.cancel for legacy invokes too) is fixed — cancel frames now gate on the streaming contract.
  • Per-commit autoreview (gpt-5.6-sol xhigh) surfaced five findings, all fixed with regression tests: buffered progress no longer drains after cancellation; duplicate buffered seq frames no longer reset the idle deadline; node runs now carry the gateway's native tool policy (--tools + MCP deny projected; --allowedTools auto-approval still never crosses the node boundary); fresh node CLI sessions reseed conversation history from the gateway-side transcript; and a truncated node stream that lost the terminal result line now fails the turn instead of passing as a clean exit.
  • SDK gates: plugin-sdk:api:check and plugin-sdk:surface:check green (surface budget +1 for resolveChildProcessInvocation, now public via the process-runtime wildcard — needed by the node host for Windows shim-correct spawns).
  • tsgo core + UI lanes green; oxlint/oxfmt/git diff --check clean.

Known follow-ups (deliberate v1 scope, in the tracking issue): Mac-app Swift command, warm stdio on nodes, gateway-loopback MCP over node transport, Codex app-server on nodes, approval-request withdrawal when a run aborts mid-wait, FailoverError classification for node disconnects.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling extensions: anthropic plugin: file-transfer size: XL maintainer Maintainer-authored PR labels Jul 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ec156f205

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

Comment on lines +357 to +359
const child = spawn(invocation.command, invocation.args, {
cwd: params.cwd,
env: params.env,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Return a result when node Claude spawn throws

If the catalog-reported cwd is replaced with a regular file after decodeClaudeCliNodeRunParams validates it (or another spawn option throws synchronously), spawn(...) throws before the error/close handlers are attached. That rejection bubbles to handleInvoke's top-level logger without sending node.invoke.result, so the gateway-side streaming invoke sits until its hard timeout instead of failing the turn immediately; wrap this spawn in the same try/catch style used by system.run and resolve a failed RunResult.

Useful? React with 👍 / 👎.

@clawsweeper

clawsweeper Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 13, 2026, 9:50 AM ET / 13:50 UTC.

Summary
The PR adds opt-in streaming continuation of Claude catalog sessions on paired headless nodes across gateway transport, node execution, CLI placement, catalog adoption, configuration, documentation, and protocol clients.

PR surface: Source +2025, Tests +1469, Docs +62, Generated 0, Other +30. Total +3586 across 68 files.

Reproducibility: not applicable. this is a new paired-node execution capability rather than a current-main bug with a failing reproduction path. The existing view-only behavior is the documented starting limitation.

Review metrics: 2 noteworthy metrics.

  • Configuration surface: 1 option added, 0 defaults changed, 0 options removed. The new nodeHost.agentRuns.claude.enabled switch controls a security-sensitive remote execution capability and needs fresh-install and upgrade proof.
  • Protocol surface: 2 additive streaming controls. node.invoke.progress and node.invoke.cancel introduce cross-version gateway/node behavior whose mixed-version and disconnect semantics matter before merge.

Stored data model
Persistent data-model change detected: durable storage schema: src/node-host/worker-support.ts, serialized state: extensions/anthropic/session-catalog-transcript.ts, serialized state: extensions/anthropic/session-catalog.test.ts, serialized state: extensions/anthropic/session-catalog.ts, serialized state: src/agents/cli-runner.spawn.test.ts, serialized state: src/gateway/node-registry.test.ts, and 7 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #105529
Summary: The open feature issue is the canonical request, this PR is its candidate implementation, and the merged UI PR is adjacent work that depends on this capability rather than replacing it.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦪 silver shellfish
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Resolve the three review findings and refresh the branch against current main.
  • [P1] Add redacted real paired-node proof for successful, denied, cancelled, timed-out, disconnected, and cleanup paths.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR provides extensive tests and CI claims but no inspected after-fix run on a real paired node; add redacted terminal output, logs, or a recording covering advertisement, policy allow and deny, approval and denial, streaming, cancellation, timeout, cleanup, and successful continuation. Updating the PR body should trigger a fresh ClawSweeper review; otherwise ask a maintainer to comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] A write-scoped operator can currently reach creation of a session bound to a paired node, bypassing the admin scope used by the established node-bound session creation path.
  • [P1] The plugin runtime advertises the private Claude runner as generically invocable even though generic node.invoke rejects it, creating a misleading and potentially compatibility-sensitive plugin API contract.
  • [P2] Skipping Claude backend preparation can change compaction behavior on long continued sessions, while cancellation, timeout, disconnect, and approval-withdrawal behavior still lacks real paired-node proof.
  • [P1] The PR currently reports a dirty merge state, so its exact integration result against current main requires a refreshed review after conflict resolution.

Maintainer options:

  1. Repair the runner boundary before merge (recommended)
    Remove the private runner from generic invocability, enforce operator.admin for node-bound adoption, preserve safe prepared environment, resolve conflicts, and add real paired-node proof.
  2. Explicitly sponsor the broader contract
    A maintainer may accept a public streaming node-run API only after defining its authorization, compatibility, documentation, and upgrade guarantees.
  3. Pause the feature branch
    Close or narrow the PR if the repository is not ready to own a generic remote agent-run and authorization surface.

Next step before merge

  • [P1] A maintainer must choose the permanent runner API and authorization boundary; afterward the contributor must resolve the concrete defects, conflicts, and real-proof gap.

Maintainer decision needed

  • Question: Should paired-node Claude continuation use a private admin-gated catalog runner, or become a supported generic plugin/node invocation contract?
  • Rationale: The choice defines a new remote execution and plugin API boundary, including which operator scope may create node-bound sessions; repository policy and existing contracts do not safely resolve that product and authorization decision automatically.
  • Likely owner: steipete — The current session-catalog and paired-node continuation design appears to be led by their recent merged and proposed work in this area.
  • Options:
    • Private admin-gated runner (recommended): Keep the Claude runner out of generic invocableCommands, require operator.admin for node-bound catalog adoption, and expose only the dedicated continuation seam.
    • Public generic runner contract: Explicitly approve and document a generic plugin API for streaming agent runs, with consistent invocation, authorization, compatibility tests, and upgrade semantics.
    • Pause paired-node continuation: Retain paired-node catalog rows as view-only until a smaller reusable agent-run protocol and security model are designed.

Security
Needs attention: The remote execution design has concrete authorization and API-boundary issues that must be resolved before merge.

Review findings

  • [P1] Keep the private Claude runner out of generic invocability — src/gateway/server-plugins-node-runtime.ts:28-34
  • [P1] Require admin scope before creating node-bound catalog sessions — extensions/anthropic/session-catalog.ts:855
  • [P2] Preserve safe Claude preparation environment for node runs — src/agents/cli-runner/prepare.ts:545
Review details

Best possible solution:

Keep the Claude node runner behind a dedicated non-generic seam, require operator.admin for adopting node-bound sessions, preserve only explicitly safe backend-prepared environment, resolve the current conflicts, and demonstrate the complete flow on a real paired node before merge.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a new paired-node execution capability rather than a current-main bug with a failing reproduction path. The existing view-only behavior is the documented starting limitation.

Is this the best way to solve the issue?

No, not yet. The dedicated paired-node execution direction is plausible, but the current generic invocability claim, write-versus-admin authorization mismatch, and skipped backend preparation make this implementation unsafe as the permanent contract.

Full review comments:

  • [P1] Keep the private Claude runner out of generic invocability — src/gateway/server-plugins-node-runtime.ts:28-34
    invocableCommands includes agent.cli.claude.run.v1 when policy permits it, but this runtime's generic nodes.invoke path explicitly rejects that command. Exclude it from the generic list or provide one approved public invocation contract; otherwise plugins receive a capability they cannot call.
    Confidence: 0.98
  • [P1] Require admin scope before creating node-bound catalog sessions — extensions/anthropic/session-catalog.ts:855
    The write-scoped catalog continuation path creates a session carrying execNode, while direct session creation requires operator.admin for the same node-bound execution capability. Gate paired-node continuation at the admin boundary before creating the session.
    Confidence: 0.98
  • [P2] Preserve safe Claude preparation environment for node runs — src/agents/cli-runner/prepare.ts:545
    Late discovery on the already-reviewed head: skipping prepareExecution drops backend-derived settings such as the configured Claude compaction window. Run preparation for node placement and forward only the explicitly safe environment subset accepted by the node command.
    Confidence: 0.91
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a965d28e0409.

Label changes

Label changes:

  • add P1: The PR introduces a remote execution authorization mismatch and contradictory plugin invocation contract that should block merge until resolved.
  • remove P2: Current review triage priority is P1, so this older priority label is no longer current.

Label justifications:

  • P1: The PR introduces a remote execution authorization mismatch and contradictory plugin invocation contract that should block merge until resolved.
  • merge-risk: 🚨 compatibility: The PR adds configuration, protocol, session-placement, and plugin runtime surfaces whose upgrade and mixed-version behavior is not yet proven end to end.
  • merge-risk: 🚨 security-boundary: A write-scoped catalog continuation can create node-bound execution state despite the established admin requirement for that capability.
  • merge-risk: 🚨 availability: Streaming runs, cancellation, timeouts, disconnect cleanup, and approval withdrawal can stall or misclassify active turns without real paired-node validation.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides extensive tests and CI claims but no inspected after-fix run on a real paired node; add redacted terminal output, logs, or a recording covering advertisement, policy allow and deny, approval and denial, streaming, cancellation, timeout, cleanup, and successful continuation. Updating the PR body should trigger a fresh ClawSweeper review; otherwise ask a maintainer to comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +2025, Tests +1469, Docs +62, Generated 0, Other +30. Total +3586 across 68 files.

View PR surface stats
Area Files Added Removed Net
Source 50 2661 636 +2025
Tests 12 1471 2 +1469
Docs 2 78 16 +62
Config 0 0 0 0
Generated 1 2 2 0
Other 3 32 2 +30
Total 68 4244 658 +3586

Security concerns:

  • [high] Node-bound session creation lacks the established admin gate — extensions/anthropic/session-catalog.ts:855
    Catalog continuation is write-scoped but can persist execNode, enabling future CLI turns on a paired host through a path weaker than direct node-bound session creation.
    Confidence: 0.98
  • [medium] Private runner leaks into a contradictory generic API surface — src/gateway/server-plugins-node-runtime.ts:28
    The plugin runtime advertises the Claude runner as invocable although generic invocation rejects it, making enforcement dependent on callers understanding an undocumented exception.
    Confidence: 0.96

What I checked:

  • Prior blockers remain on the current head: The latest completed ClawSweeper cycle reviewed the same head SHA and identified unresolved P1 findings for generic plugin invocability and admin authorization of node-bound session creation. (34646a990b30)
  • Generic invocability contract disagrees with dispatch: The plugin node projection includes policy-allowed commands in invocableCommands, while nodeInvokePolicy explicitly rejects agent.cli.claude.run.v1 from generic node.invoke; plugins therefore receive an invocability claim that the paired API cannot honor. (src/gateway/server-plugins-node-runtime.ts:28, 34646a990b30)
  • Node-bound creation crosses the established admin boundary: Catalog continuation remains an operator.write method but can create a session carrying execNode, whereas direct node-bound session creation requires operator.admin; the catalog path needs the same authorization boundary. (extensions/anthropic/session-catalog.ts:855, 34646a990b30)
  • Node placement skips backend preparation: The node-placement branch skips the Claude backend prepareExecution hook, so safe backend-derived environment such as the configured context-budget compaction window is not preserved for the remote CLI run. (src/agents/cli-runner/prepare.ts:545, 34646a990b30)
  • Real behavior proof is absent: The PR body reports extensive tests, checks, and reviews, but provides no inspectable after-fix run on an actual paired node demonstrating advertisement, authorization, approval and denial, streaming, cancellation, timeout, cleanup, and successful continuation. (34646a990b30)
  • Canonical feature issue remains open: The linked issue is the canonical product request and this PR is its candidate implementation; it should remain open until the PR is either landed or replaced.

Likely related people:

  • steipete: Authored the canonical paired-node proposal and the merged adjacent catalog UI work that established the current continuation flow and explicitly depends on this node-run capability. (role: session-catalog feature owner and recent area contributor; confidence: high; commits: c2521d7c4769; files: extensions/anthropic/session-catalog.ts, src/agents/cli-runner/prepare.ts, src/gateway/server-plugins-node-runtime.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-13T02:22:58.776Z sha 7a0429d :: needs real behavior proof before merge. :: [P2] Catch spawn failures and complete the node invocation
  • reviewed 2026-07-13T03:07:23.808Z sha 2e3cbe2 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-13T03:19:11.386Z sha 038dbf6 :: needs real behavior proof before merge. :: [P1] Keep the spawn helper out of the public Plugin SDK
  • reviewed 2026-07-13T04:35:07.606Z sha a00f104 :: needs real behavior proof before merge. :: [P1] Keep the spawn helper out of the public Plugin SDK
  • reviewed 2026-07-13T06:40:12.767Z sha 0cc911f :: needs real behavior proof before merge. :: [P1] Keep the spawn resolver out of the public Plugin SDK | [P1] Make denied node approvals terminal
  • reviewed 2026-07-13T08:31:20.626Z sha a5d7620 :: needs real behavior proof before merge. :: [P1] Approve the exact spawned Claude argv | [P1] Keep the spawn resolver out of the public Plugin SDK
  • reviewed 2026-07-13T12:08:45.261Z sha 4c6541d :: needs real behavior proof before merge. :: [P1] Do not advertise a command the plugin API always rejects
  • reviewed 2026-07-13T13:35:51.182Z sha 34646a9 :: needs real behavior proof before merge. :: [P1] Keep the private Claude runner out of generic invocability | [P1] Require admin scope before creating a node-bound session

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 13, 2026
@steipete
steipete force-pushed the feat/node-cli-agent-runs branch from 7a0429d to 2e3cbe2 Compare July 13, 2026 02:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e3cbe2852

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

Comment on lines +2124 to +2129
if (
nodeRunTruncated &&
result.exitCode === 0 &&
!result.timedOut &&
!streamingParser?.getOutput()
) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Reject truncated node streams without terminal results

When a node Claude run streams enough assistant text to hit the node-side cap and then loses the terminal result line (for example because the final result line is too large to re-inject), streamingParser.getOutput() can still return partial assistant text from earlier deltas, so this guard does not fire. The turn is then accepted as a clean exit with truncated content and no terminal result/session/usage proof; this needs to check whether a terminal result was actually observed or re-injected, not just whether any partial output parsed.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 13, 2026
@steipete
steipete force-pushed the feat/node-cli-agent-runs branch from 2e3cbe2 to 038dbf6 Compare July 13, 2026 03:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 038dbf6562

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

});
});
child.stderr.on("data", (raw: Buffer) => {
retain(raw);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Keep stderr out of the stdout stream cap

When the node-side Claude process writes a large stderr burst before or during stdout, this call consumes the shared outputBytes budget used by retain(). Once that 200KB budget is exhausted, later stdout chunks are dropped or reduced to heartbeats, so a valid Claude JSONL response can arrive without the assistant deltas even though stderr is already tailed separately in stderrTail; track stderr tail bytes independently from the stdout progress cap.

Useful? React with 👍 / 👎.

@steipete steipete closed this Jul 13, 2026
@steipete steipete reopened this Jul 13, 2026
@steipete
steipete marked this pull request as draft July 13, 2026 03:58
@steipete
steipete marked this pull request as ready for review July 13, 2026 03:58
@steipete
steipete force-pushed the feat/node-cli-agent-runs branch from 038dbf6 to 81b401d Compare July 13, 2026 04:07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 81b401d14c

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

Comment on lines 1444 to +1445
...(record.cwd ? { spawnedCwd: record.cwd } : {}),
...(nodeId ? { execNode: nodeId, ...(record.cwd ? { execCwd: record.cwd } : {}) } : {}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Keep node cwd out of gateway spawnedCwd

When hostId is a paired node, record.cwd is the node-local project path. This node binding still leaves that same value in spawnedCwd from the previous line, but gateway callers such as resolveSessionRuntimeCwd and resolveIngressWorkspaceOverrideForSessionRun treat spawnedCwd as a local gateway workspace; adopting a node session whose cwd does not exist (or points elsewhere) on the gateway can break reset/bootstrap/file/diff flows or run them against the wrong local path. Store node paths only in execCwd for node-bound sessions (as sessions.create does) and avoid setting spawnedCwd for this branch.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the feat/node-cli-agent-runs branch from 81b401d to a00f104 Compare July 13, 2026 04:24
@clawsweeper clawsweeper Bot removed the rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. label Jul 13, 2026
steipete added 21 commits July 13, 2026 07:09
@steipete
steipete force-pushed the feat/node-cli-agent-runs branch from 34646a9 to 8c9fb66 Compare July 13, 2026 14:16
@steipete
steipete merged commit f167089 into main Jul 13, 2026
223 checks passed
@steipete
steipete deleted the feat/node-cli-agent-runs branch July 13, 2026 14:39
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

wm0018 pushed a commit to wm0018/openclaw that referenced this pull request Jul 14, 2026
…eaming CLI agent runs (openclaw#105833)

* feat(gateway): stream node.invoke progress with idle timeouts and cancel

* feat(node-host): opt-in approval-gated claude cli agent run command

* feat(agents): run node-placed claude-cli turns through streaming node invoke

* feat(anthropic): continue claude catalog sessions on advertising nodes

* docs(nodes): document paired-node claude agent runs and continuation

* chore(plugin-sdk): admit spawn-invocation helper into surface budget

* fix(nodes): harden streaming invoke and node run policy from review findings

* test(node-host): prove multi-token tool-policy argv fails closed

* fix(nodes): allowlist cancel event for apps and break node-host type cycle

* chore(protocol): regenerate Swift gateway models for node invoke progress

* chore(node-host): drop test-only export surface flagged by deadcode ratchet

* style(node-host): merge invoke-types imports

* refactor(nodes): split node agent run modules to satisfy the LOC ratchet

* chore(protocol): regenerate android gateway models and sync export baseline

* chore(plugin-sdk): admit spawn-invocation helper and inherited deprecated drift into surface budget

* chore(plugin-sdk): tolerate inherited agent-core deprecated export

* fix(anthropic): drop node param parser orphaned by upstream catalog split

* ci: sync unused-export baseline with healed main

* test(agents): adopt renamed cli backend prepare helper

* style(node-host): format claude run spawn invocation

* ci: retrigger checks

* chore(plugin-sdk): pin surface budgets to healed-base counts

* fix(protocol): restore untyped lazy validators after upstream style change
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 14, 2026
…eaming CLI agent runs (openclaw#105833)

* feat(gateway): stream node.invoke progress with idle timeouts and cancel

* feat(node-host): opt-in approval-gated claude cli agent run command

* feat(agents): run node-placed claude-cli turns through streaming node invoke

* feat(anthropic): continue claude catalog sessions on advertising nodes

* docs(nodes): document paired-node claude agent runs and continuation

* chore(plugin-sdk): admit spawn-invocation helper into surface budget

* fix(nodes): harden streaming invoke and node run policy from review findings

* test(node-host): prove multi-token tool-policy argv fails closed

* fix(nodes): allowlist cancel event for apps and break node-host type cycle

* chore(protocol): regenerate Swift gateway models for node invoke progress

* chore(node-host): drop test-only export surface flagged by deadcode ratchet

* style(node-host): merge invoke-types imports

* refactor(nodes): split node agent run modules to satisfy the LOC ratchet

* chore(protocol): regenerate android gateway models and sync export baseline

* chore(plugin-sdk): admit spawn-invocation helper and inherited deprecated drift into surface budget

* chore(plugin-sdk): tolerate inherited agent-core deprecated export

* fix(anthropic): drop node param parser orphaned by upstream catalog split

* ci: sync unused-export baseline with healed main

* test(agents): adopt renamed cli backend prepare helper

* style(node-host): format claude run spawn invocation

* ci: retrigger checks

* chore(plugin-sdk): pin surface budgets to healed-base counts

* fix(protocol): restore untyped lazy validators after upstream style change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: android App: android app: web-ui App: web-ui docs Improvements or additions to documentation extensions: anthropic gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. plugin: file-transfer rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: continue Claude catalog sessions on paired nodes (node-side CLI agent runs)

1 participant