Skip to content

refactor(node-host): share the command execution owner - #150434

Merged
steipete merged 1 commit into
mainfrom
codex/test-node-cwd-diagnostic-226
Sep 17, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-node-cwd-diagnostic-226

Conversation

@steipete

@steipete steipete commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Node-host command tests depend on a production global published only for tests and a separate bridge that reads it.

User Impact

No intended user-visible behavior changes. Existing command execution, launch-policy callbacks, cancellation, output bounds, stdin closure, and working-directory diagnostics are preserved.

Why This Change Was Made

Move command execution into a focused module used by the real invoke dispatcher and its tests. Keep the cwd diagnostic helper private and test its errors through command results. Remove the test-only Symbol publication, bridge, and registry entry, and shrink only the owning assertion-baseline row.

Production: net -6 lines. Tests and test support: net -26 lines.

The same seven-path cleanup is now composed on main b54d624 and saved as signed commit 6ff26a7. The signed mechanical rebase preserves its stable patch identity and all owned runtime/test afterimages; the assertion baseline retains the new main rows and shrinks only invoke.ts from 7 to 4.

Evidence

  • Before this mechanical refresh, the pristine 5d1389f baseline and applied candidate each passed all 149 cases across the same five complete suites, with native and recorder exits 0. Reported per-file case identities and order match.
  • All 33 normal local changed-check stages on that validated candidate completed with native gate exit 0. The original recorder exit 1 from a process-birth observation failure remains preserved. An additive independent qualification verified current source/dependency/index integrity and absence of the recorded PIDs and groups; it does not retroactively repair the historical monitoring gap or establish absence of unobserved descendants.
  • Independent applied source review found no actionable P0–P2 findings. The signed source save verified the sole parent, complete composed tree, six surviving afterimages, the bridge deletion, and clean checkout.

Historical evidence remains separate. On the older 226-based checkout, the pristine baseline had 148 passes and one shared-runner timeout; the same-order diagnostic passed 149 with a separate recorder failure and verified restoration. The fresh green pair does not establish a general timeout or performance fix.

The earlier hosted CI run 35168910744 failed on 05aa1b8 in four test jobs: skill-read byte accounting and missing-module imports in copied-repository fixtures, followed by the aggregate gate. Those failures and their diagnostic limits remain recorded. This refresh does not claim they are cured. Production changes remain confined to the command-execution owner extraction.

The subsequent c917 CI run35185062938 passed all 71 selected compact Node test jobs, but failed its test compiler on an unrelated Slack RawData overload error introduced on main. Source attribution identified the canonical fix in #149291 and its follow-up refinement #150678; this refresh includes both. No duplicate Slack repair is part of this PR. The retained 149-case proof applies to the unchanged cleanup; it is not presented as a new b54 test run. Fresh exact-head hosted CI remains required before landing.

Closes #150430.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Sep 17, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 4:04 AM ET / 08:04 UTC (Revision 3).

ClawSweeper review

What this changes

Moves node-host command execution into a module shared by the dispatcher and tests, removing the test-only global bridge while preserving command results and diagnostics.

Merge readiness

✅ Ready for maintainer review

This maintainer-requested cleanup remains useful because current main still publishes the test-only bridge. The reviewed extraction preserves execution behavior, and no actionable introduced defect was found.

Priority: P3
Reviewed head: 6ff26a70cdf7d40438da30bd93b710c6d81ca3a3

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving cleanup with retained contract coverage and no actionable introduced findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored internal extraction is exempt from contributor proof requirements and does not materially change authority; reported historical tests exercise command results and launch-policy rejection, without claiming a new exact-head runtime run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored internal extraction is exempt from contributor proof requirements and does not materially change authority; reported historical tests exercise command results and launch-policy rejection, without claiming a new exact-head runtime run.
Evidence reviewed 7 items Production cutover preserves behavior: The complete introduced patch moves the existing command implementation without changing its launch-policy callback, process-tree cancellation options, empty stdin, 200,000-byte output cap, or result mapping. The production dispatcher passes the imported function to handleSystemRunInvoke.
Current main still needs the cleanup: Fetched main retains the embedded runner and conditional global Symbol publication; its invoke.ts differs from the reviewed head by the intended extraction and bridge removal.
Latest release retains the bridge: The v2026.9.4 source still contains runCommand and the nodeHostInvokeTestApi publication. No shipped implementation of this cleanup was established.
Findings None None.
Security None None.

How this fits together

The node host receives command requests from the Gateway, checks local execution policy, and runs approved commands through the shared process runner. It returns bounded output, exit status, and execution errors.

flowchart TD
 A[Gateway command request] --> B[Node dispatcher]
 B --> C[Local execution policy]
 C --> D[Shared node command owner]
 E[Command contract tests] --> D
 D --> F[Process runner]
 F --> G[Bounded output and status]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -6, Tests -26, Other 0. Total -32 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 86 92 -6
Tests 4 27 53 -26
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 7 114 146 -32

Review metrics

Metric Value Why it matters
Production versus test footprint Production −6 lines; tests and test support −26 lines The extraction removes test-only indirection without growing production code.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #150430
Summary: This PR implements the explicitly linked node execution bridge cleanup; the issue remains open until the implementation lands.

Members:

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

Technical review

Best possible solution:

Keep one production-used node command adapter with private diagnostics and retain behavioral tests at its execution boundary.

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

Not applicable: this is a source-verified cleanup of test-only indirection, rather than a reported runtime defect.

Is this the best way to solve the issue?

Yes. Sharing the production adapter removes the global bridge while retaining the existing process runner and execution-policy boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a09a0461bc08.

Labels

Label justifications:

  • P3: This is internal ownership cleanup with no intended user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored internal extraction is exempt from contributor proof requirements and does not materially change authority; reported historical tests exercise command results and launch-policy rejection, without claiming a new exact-head runtime run.

Evidence

What I checked:

  • Production cutover preserves behavior: The complete introduced patch moves the existing command implementation without changing its launch-policy callback, process-tree cancellation options, empty stdin, 200,000-byte output cap, or result mapping. The production dispatcher passes the imported function to handleSystemRunInvoke. (src/node-host/invoke-run-command.ts:40, 6ff26a70cdf7)
  • Current main still needs the cleanup: Fetched main retains the embedded runner and conditional global Symbol publication; its invoke.ts differs from the reviewed head by the intended extraction and bridge removal. (src/node-host/invoke.ts:1122, a09a0461bc08)
  • Latest release retains the bridge: The v2026.9.4 source still contains runCommand and the nodeHostInvokeTestApi publication. No shipped implementation of this cleanup was established. (src/node-host/invoke.ts:1127, 3a9d69db306c)
  • Existing launch-policy coverage remains: The retained integration cases revoke policy at authorization commit or the launch callback and check denial versus actual command output. Only their import and invocation target change; cwd diagnostics now run through command results instead of a private-helper bridge. (src/node-host/invoke-system-run.test.ts:1706, 6ff26a70cdf7)
  • Canonical maintainer-requested work: Remove the Node execution test-only global bridge #150430 remains open and explicitly requests this focused extraction, private cwd diagnostics, bridge removal, and preservation of execution contracts. This PR is its implementation candidate.
  • Relevant merged history: Current-main history identifies steipete in the earlier test-seam privatization and launch-policy work. GitHub commit metadata independently maps the launch-policy commit to that login. This is routing evidence, not a claim of causal responsibility. (src/node-host/invoke.run-command.test.ts, 70fe5d707523)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-17T01:07:35.665Z sha 05aa1b8 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T05:23:20.689Z sha c9173df :: needs maintainer review before merge. :: none

Move runCommand into the production-used execution module and remove the
VITEST-only Symbol publication, test bridge, and publication registry entry.
Keep cwd diagnostics private and exercise them through command results.

Preserve launch-policy callbacks, cancellation, output bounds, and stdin
closure. Retain the original lifecycle timeout and diagnostic evidence;
this extraction does not claim a timeout or performance fix.
@steipete
steipete force-pushed the codex/test-node-cwd-diagnostic-226 branch from c9173df to 6ff26a7 Compare September 17, 2026 07:56
@steipete steipete self-assigned this Sep 17, 2026
@steipete
steipete merged commit 146e7c8 into main Sep 17, 2026
169 of 171 checks passed
@steipete
steipete deleted the codex/test-node-cwd-diagnostic-226 branch September 17, 2026 08:56
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
Move runCommand into the production-used execution module and remove the
VITEST-only Symbol publication, test bridge, and publication registry entry.
Keep cwd diagnostics private and exercise them through command results.

Preserve launch-policy callbacks, cancellation, output bounds, and stdin
closure. Retain the original lifecycle timeout and diagnostic evidence;
this extraction does not claim a timeout or performance fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the Node execution test-only global bridge

1 participant