fix(skills): parse system.which Record response in remote bin probe#28406
fix(skills): parse system.which Record response in remote bin probe#28406tony-shi wants to merge 1 commit into
Conversation
Greptile SummaryFixed a bug in Root cause: What changed:
Impact: Skills requiring remote binaries will now correctly show as "eligible" instead of "blocked" when the remote node has the required binaries. Confidence Score: 5/5
Last reviewed commit: 213aa8a |
|
Related: #29254 This PR addresses a parsing-layer bug in This change is complementary to the sandbox eligibility probing work in #29327 — it covers the non-sandbox remote node deployment path (Docker gateway + bare-metal Mac node via |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Summary
parseBinProbePayloadonly handlesstring[]andstdoutformats, butsystem.whichreturnsRecord<string, string>(keys = bin names, values = resolved paths).Array.isArray()returnsfalsefor objects → always returns empty[].hasBinary()resolves bins directly without the remote probe path.parseBinProbePayloadnow extractsObject.keys()from Record-typedbinsresponses. Exported the function for direct unit testing.system.runfallback path, existingstring[]handling, local bin detection, and all other skills logic.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Skills that were previously shown as "blocked" in Docker gateway + remote Mac node setups will now correctly show as "eligible" when the remote node has the required binaries.
Security Impact (required)
No)No)No)No)No)Repro + Verification
Environment
Steps
openclaw node run --host <gateway-ip> --port 18789.system.whichprobe with{ bins: { "git": "/usr/bin/git", ... } }.Expected
Skills that require remote bins (e.g.,
git) should show as "eligible".Actual
All remote-bin-dependent skills show as "blocked" because
parseBinProbePayloadreturned[].Evidence
Root cause trace:
parseBinProbePayloadline 211 doesArray.isArray(parsed.bins)which isfalseforRecord<string, string>objects → falls through tostdoutcheck (also fails) → returns[].After fix: 10/10 tests pass including 8 new tests covering all three response formats (string[], Record, stdout) and edge cases.
Human Verification (required)
system.whichreturns Record format; new unit tests validate all three parse paths.Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
system.runfallback will be used for nodes that don't supportsystem.which.src/infra/skills-remote.tsRisks and Mitigations
Object.keys()on unexpected payload shapes.typeof parsed.bins === "object"check; wrapped in try/catch; existingstring[]andstdoutpaths unchanged.🤖 AI-assisted (fully tested, code understood)