Skip to content

fix(skills): stop interrupted ClawHub searches - #187512

Closed
Alix-007 wants to merge 2 commits into
openclaw:mainfrom
Alix-007:fix/alix-skills-search-cancel-20261029
Closed

Alix-007 wants to merge 2 commits into
openclaw:mainfrom
Alix-007:fix/alix-skills-search-cancel-20261029

Conversation

@Alix-007

@Alix-007 Alix-007 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

openclaw skills search keeps waiting after the CLI accepts Ctrl-C or SIGTERM while ClawHub has not completed its response. It can print late search results, or the normal launcher can reach its forced-kill backstop.

User Impact

Interrupting a pending query or queryless Trending read closes its HTTP request and exits130/143 without late results or ordinary errors. Completed searches preserve their output. No configuration, protocol, schema, permissions or migration changes are required.

Why This Change Was Made

Pass the existing invocation signal through the shared search path to the current native request owner. Compose it with the existing request deadline and use the existing abortable retry wait. The CLI owns suppressing output after accepted cancellation. Other callers keep their current lifetime because the new signal is explicit and optional; the client adds no ambient cancellation or write replay.

Evidence

  • Scenario: Accepted interruption stops pending skills search native HTTP/body waits and prevents late results/errors; Ordinary query, queryless Trending and completed HTTP errors retain their output and one-request behavior.
  • Entry: node openclaw.mjs skills search cancel-fixture --json; node openclaw.mjs skills search --json; existing OPENCLAW_CLAWHUB_URL points at the synthetic loopback HTTP peer.; disputed owner ran unmocked: CLI search action, existing lifecycle query forwarding and native ClawHub request/body/retry owners; current repair changes only test synchronization/cleanup and exact test-line allocation, leaving production owners byte-identical to original behavior-proof head.
  • Same command on base 540091c and original behavior-proof head 09cb779; reused for production-identical current 6e3a20a: python3 cancel-search-proof.py "$CHECKOUT" "$PHASE" "$NODE" --output "$OUTPUT"
    • Before (base): RED eight interrupted reads fail prompt cancellation: no-respawn remains alive/open2.4s then emits late JSON; ordinary wrapper reaches SIGKILL. Six completed controls retain output.
    • After (original proof head, reused): GREEN preserved actual behavior proof at 09cb779:eight interrupted reads naturally130/143 withsocketclosedbeforeheldrelease andnolateoutput; six controls expectedoutput/status,each14caseoneGET/configunchanged. Currenthead changesonlyone testfile+exactallocation; no currenthead runtime replay is claimed.
  • Readback (subprocess,http,network-recorder,config-file): Actual preserved childstatus/stdout/stderr plus independentlyreceived requestpath/count/socketclosure and isolatedconfighash/buildidentity at 09cb779; finaltestonlypatch mechanically leavesallproduction/dependency/configinputbytesidentical. Controlledclockregression is supplementaltestevidence, not realbehaviorproof.
  • Proof harness: Unchanged real cancel-search-proof.py SHA256820b46fb7a92fc7fa74f85d9b6f476f3a250d5154f4736784d569b5ab914232c and14cases preserveoriginalexecutionhead 09cb779. Finaltestpatch changes neither collector norproduct; no original observation/buildidentity is relabeled as a newrun.
  • Control: Real CLI interrupted cases each1GET/0lateoutput/closedconnection, six completed valid/error controls each1GET and expectedresult/error; final changed native tests synchronize requestreceipt/secondbodyread and assert abort/socketclose/oneGET. Controlled503retry waits for actual7000mstimer scheduling, then aborts without advancing it:AbortError,onefetch,zerotimers; revertingonlyabortablesleep makesoutcomeundefined and correctlyfails.
  • Other callers checked: Complete shared query includes search and queryless Trending. Gateway/setup/recommendation callers omit optional signal and retain current lifecycle; native client never reads ambient CLI signal. Install/update/auth/archive write settlement unchanged.
  • Tests: Finalchangedclient17PASS1existingmacskip9.057s; focusedCLI5PASS7.501s onunchangedCLIbytes. Existingdeadline6+skills27PASS receipts reusedforunchangedinputs. Finaltargettesttypes18.490s,typedlint23.973s,format0.418s,ratchet1.939s,diff0.138s; normalhooksPASS. Exact153nettestLFgrant, unchangedsharedscalar. (measured cost: Finalclient9.057s wall,CLI7.501s reusedunchangedinput, types18.490s/lint23.973s/format0.418s/ratchet1.939s/diff0.138s. Mutation-only expectedRED7.495s:onlyabortablesleepremoved,undefinedoutcomeassertionbefore7000mstimerexpiry,thenprodSHArestored. No fullsuite/retry/timeout/assertionweakening; currenttestmax380lines, wholePRnet153testLF.)
  • Not tested: Live ClawHub service/authentication, actual plugin/skill installation, provider/model/channel use, native Windows/macOS, hosted CI and upgrades. Loopback response peer is synthetic; no real-account or persistence claim.

Current PR head 6e3a20afa4ebb6e7301f0d3e37a4919780c3ca64; BASE 540091c8bd8bfc537f5620221390057a801fd3a2. Behavior-proof execution head: 09cb7796e4f29b8b6b69adcbb8acf2b80b868a2a. The current update changes only deterministic test synchronization and its exact line allocation; every production/dependency/config input remains byte-identical. The original build and real fourteen-case evidence below are preserved with their actual SHA and date, reused under the documented test-only equivalence rule; no new-head runtime replay is claimed. Linux x64, Node26.12.1, OpenClaw2026.10.8, 2026-10-29 UTC. The original BASE and behavior-proof head09cb use the normal node --import ./scripts/tsx.mjs scripts/build-all.mts cliStartup build; that original proof-head build passes265.506s with matching build-info and inputsClean:true stamp. Public proof runs the actual parser/action, query/Trending owner, native fetch/body and root cleanup. Only the external HTTP peer is synthetic, selected through the existing OPENCLAW_CLAWHUB_URL. HOME/config/state are isolated and no credentials, provider or real account is used.

python3 cancel-search-proof.py "$CHECKOUT" "$PHASE" "$NODE" --output "$OUTPUT"

Collector SHA256820b46fb7a92fc7fa74f85d9b6f476f3a250d5154f4736784d569b5ab914232c is identical in both runs. Eight interruption scenarios cover query headers and queryless Trending partial JSON body, each SIGINT/SIGTERM and normal/no-respawn launches. BASE no-respawn is still alive/socket-open after2.4s and emits late JSON when the peer releases its response; normal launch reaches SIGKILL. HEAD naturally exits130/143, closes the socket before response release, emits zero stdout and only the root interruption notice. Six valid query/Trending/completed404 controls retain status and expected output. All14cases receive exactlyone GET and preserve the isolated config hash. This is real client behavior against a loopback service, not proof of live ClawHub availability.

The first durable review accepted the implementation and real behavior proof but correctly found that a fixed20ms test delay did not prove entry into the body-read or retry-backoff phase. This update removes that delay. The native header case waits for actual request receipt; the native body case transparently observes the actual reader's second read after the incomplete first chunk. Both retain real socket-closure and exactly-one-request assertions. The separate controlled503case waits until the actual7000ms backoff timer is scheduled, aborts without advancing it, and asserts AbortError,onefetch andzerotimers.

A targeted mutation removes only the optional abortable retry sleep; native AbortSignal.any and both preflight checks stay intact. The regression correctly fails because outcome is still undefined before the retry timer expires, not from a fixture timeout. The original production SHA is restored in finally and independently checked byte-for-byte. This is regression-test sensitivity evidence; the real user-entry proof remains the original native CLI peer record below.

Validation after this repair: full changed client17PASS/1existingmacOSskip,9.057s wall; unchangedfocusedCLI5PASS,7.501s. Existingdeadline6and skills27 receipts remain applicable to unchanged inputs (55passing/1existing skip total). Final testtypes18.490s,typedlint23.973s,format0.418s,exactline-ratchet1.939s,diff0.138s pass at frozen repair snapshot a8b958253c44deef539c0daa4a4014a4632752690fe2c7c16cae2084a98fb372. The test-onlydelta adds60netLF; wholePR tests+154/-1(net153), uniqueallocation153 and sharedscalarunchanged. Production+31/-5(net26),docs+2 and obsolete mock-debt shrink remain unchanged. No fullsuite, timeout/retry relaxation, ignored failure or weakened assertion.

Initial normal build and all14realcases actually ran on 09cb7796e4f29b8b6b69adcbb8acf2b80b868a2a. git diff --name-only 09cb7796e4f29b8b6b69adcbb8acf2b80b868a2a 6e3a20afa4ebb6e7301f0d3e37a4919780c3ca64 contains exactly the client test and its existing allocation; original production/docs/dependency/config/mockbaseline hashes are unchanged. Independent original fullsource review, new deterministic-testdelta review and normal commit hooks pass. Original proof/build metadata below retain 09cb7796e4f29b8b6b69adcbb8acf2b80b868a2a; this is disclosed reuse, not a claim that an old runtime output was rerun on the new commit. Hosted CI for the new test commit is pending. Cleanup in each runtime proof releases its own children/listener; no production service is changed. No screenshot/deployment is involved.

Actual BASE / original production-identical proof-head observations

Synthetic request/result bytes, process/socket states, counts and timings are retained. Local checkout/output paths are omitted. elapsedMs includes CLI startup and recorder teardown, not cancellation latency.

{
  "base": "540091c8bd8bfc537f5620221390057a801fd3a2",
  "head": "09cb7796e4f29b8b6b69adcbb8acf2b80b868a2a",
  "baseBuild": {
    "version": "2026.10.8",
    "commit": "540091c8bd8bfc537f5620221390057a801fd3a2",
    "builtAt": "2026-10-29T06:59:16.673Z",
    "buildId": "2026.10.8-540091c8bd8b-2026-10-29T06-59-16.673Z"
  },
  "headBuild": {
    "version": "2026.10.8",
    "commit": "09cb7796e4f29b8b6b69adcbb8acf2b80b868a2a",
    "builtAt": "2026-10-29T08:20:55.567Z",
    "buildId": "2026.10.8-09cb7796e4f2-2026-10-29T08-20-55.567Z"
  },
  "collectorSha256": "820b46fb7a92fc7fa74f85d9b6f476f3a250d5154f4736784d569b5ab914232c",
  "cases": [
    {
      "command": [
        "node",
        "openclaw.mjs",
        "skills",
        "search",
        "cancel-fixture",
        "--json"
      ],
      "mode": "valid",
      "noRespawn": true,
      "signal": null,
      "trending": false,
      "base": {
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": 0,
        "stdout": "{\n  \"results\": [\n    {\n      \"score\": 0.9,\n      \"slug\": \"cancel-fixture\",\n      \"displayName\": \"Cancellation Fixture\",\n      \"summary\": \"Synthetic loopback result\",\n      \"ownerHandle\": \"fixture-owner\",\n      \"version\": \"1.0.0\",\n      \"registry\": \"<loopback>\",\n      \"installRef\": \"@fixture-owner/cancel-fixture\"\n    }\n  ]\n}\n",
        "stderr": "",
        "elapsedMs": 2356,
        "configUnchanged": true
      },
      "head": {
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": 0,
        "stdout": "{\n  \"results\": [\n    {\n      \"score\": 0.9,\n      \"slug\": \"cancel-fixture\",\n      \"displayName\": \"Cancellation Fixture\",\n      \"summary\": \"Synthetic loopback result\",\n      \"ownerHandle\": \"fixture-owner\",\n      \"version\": \"1.0.0\",\n      \"registry\": \"<loopback>\",\n      \"installRef\": \"@fixture-owner/cancel-fixture\"\n    }\n  ]\n}\n",
        "stderr": "",
        "elapsedMs": 2520,
        "configUnchanged": true
      }
    },
    {
      "command": [
        "node",
        "openclaw.mjs",
        "skills",
        "search",
        "--json"
      ],
      "mode": "valid",
      "noRespawn": true,
      "signal": null,
      "trending": true,
      "base": {
        "paths": [
          "/api/v1/trending?kind=skills&limit=20"
        ],
        "status": 0,
        "stdout": "{\n  \"results\": [\n    {\n      \"score\": 0,\n      \"slug\": \"cancel-fixture\",\n      \"displayName\": \"Cancellation Fixture\",\n      \"summary\": \"Synthetic loopback result\",\n      \"ownerHandle\": \"fixture-owner\",\n      \"updatedAt\": 1,\n      \"registry\": \"<loopback>\",\n      \"installRef\": \"@fixture-owner/cancel-fixture\"\n    }\n  ]\n}\n",
        "stderr": "",
        "elapsedMs": 2344,
        "configUnchanged": true
      },
      "head": {
        "paths": [
          "/api/v1/trending?kind=skills&limit=20"
        ],
        "status": 0,
        "stdout": "{\n  \"results\": [\n    {\n      \"score\": 0,\n      \"slug\": \"cancel-fixture\",\n      \"displayName\": \"Cancellation Fixture\",\n      \"summary\": \"Synthetic loopback result\",\n      \"ownerHandle\": \"fixture-owner\",\n      \"updatedAt\": 1,\n      \"registry\": \"<loopback>\",\n      \"installRef\": \"@fixture-owner/cancel-fixture\"\n    }\n  ]\n}\n",
        "stderr": "",
        "elapsedMs": 2454,
        "configUnchanged": true
      }
    },
    {
      "command": [
        "node",
        "openclaw.mjs",
        "skills",
        "search",
        "cancel-fixture",
        "--json"
      ],
      "mode": "not_found",
      "noRespawn": true,
      "signal": null,
      "trending": false,
      "base": {
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"ClawHub /api/v1/search failed (404): Synthetic fixture not found\"\n  }\n}\n",
        "stderr": "[openclaw] The CLI command failed.\n[openclaw] For help, run `openclaw doctor`.\n",
        "elapsedMs": 2482,
        "configUnchanged": true
      },
      "head": {
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"ClawHub /api/v1/search failed (404): Synthetic fixture not found\"\n  }\n}\n",
        "stderr": "[openclaw] The CLI command failed.\n[openclaw] For help, run `openclaw doctor`.\n",
        "elapsedMs": 2712,
        "configUnchanged": true
      }
    },
    {
      "command": [
        "node",
        "openclaw.mjs",
        "skills",
        "search",
        "cancel-fixture",
        "--json"
      ],
      "mode": "headers_wait",
      "noRespawn": true,
      "signal": "SIGINT",
      "trending": false,
      "base": {
        "statusAfterObservation": null,
        "socketClosedBeforeRelease": false,
        "releaseAfterSignalMs": 2402,
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": 130,
        "stdout": "{\n  \"results\": [\n    {\n      \"score\": 0.9,\n      \"slug\": \"cancel-fixture\",\n      \"displayName\": \"Cancellation Fixture\",\n      \"summary\": \"Synthetic loopback result\",\n      \"ownerHandle\": \"fixture-owner\",\n      \"version\": \"1.0.0\",\n      \"registry\": \"<loopback>\",\n      \"installRef\": \"@fixture-owner/cancel-fixture\"\n    }\n  ]\n}\n",
        "stderr": "Command interrupted by SIGINT. Waiting for cleanup before exiting.\n",
        "elapsedMs": 5029,
        "configUnchanged": true
      },
      "head": {
        "statusAfterObservation": 130,
        "socketClosedBeforeRelease": true,
        "releaseAfterSignalMs": 2405,
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": 130,
        "stdout": "",
        "stderr": "Command interrupted by SIGINT. Waiting for cleanup before exiting.\n",
        "elapsedMs": 4845,
        "configUnchanged": true
      }
    },
    {
      "command": [
        "node",
        "openclaw.mjs",
        "skills",
        "search",
        "cancel-fixture",
        "--json"
      ],
      "mode": "headers_wait",
      "noRespawn": true,
      "signal": "SIGTERM",
      "trending": false,
      "base": {
        "statusAfterObservation": null,
        "socketClosedBeforeRelease": false,
        "releaseAfterSignalMs": 2401,
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": 143,
        "stdout": "{\n  \"results\": [\n    {\n      \"score\": 0.9,\n      \"slug\": \"cancel-fixture\",\n      \"displayName\": \"Cancellation Fixture\",\n      \"summary\": \"Synthetic loopback result\",\n      \"ownerHandle\": \"fixture-owner\",\n      \"version\": \"1.0.0\",\n      \"registry\": \"<loopback>\",\n      \"installRef\": \"@fixture-owner/cancel-fixture\"\n    }\n  ]\n}\n",
        "stderr": "Command interrupted by SIGTERM. Waiting for cleanup before exiting.\n",
        "elapsedMs": 4837,
        "configUnchanged": true
      },
      "head": {
        "statusAfterObservation": 143,
        "socketClosedBeforeRelease": true,
        "releaseAfterSignalMs": 2405,
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": 143,
        "stdout": "",
        "stderr": "Command interrupted by SIGTERM. Waiting for cleanup before exiting.\n",
        "elapsedMs": 4893,
        "configUnchanged": true
      }
    },
    {
      "command": [
        "node",
        "openclaw.mjs",
        "skills",
        "search",
        "--json"
      ],
      "mode": "body_wait",
      "noRespawn": true,
      "signal": "SIGINT",
      "trending": true,
      "base": {
        "statusAfterObservation": null,
        "socketClosedBeforeRelease": false,
        "releaseAfterSignalMs": 2401,
        "paths": [
          "/api/v1/trending?kind=skills&limit=20"
        ],
        "status": 130,
        "stdout": "{\n  \"results\": [\n    {\n      \"score\": 0,\n      \"slug\": \"cancel-fixture\",\n      \"displayName\": \"Cancellation Fixture\",\n      \"summary\": \"Synthetic loopback result\",\n      \"ownerHandle\": \"fixture-owner\",\n      \"updatedAt\": 1,\n      \"registry\": \"<loopback>\",\n      \"installRef\": \"@fixture-owner/cancel-fixture\"\n    }\n  ]\n}\n",
        "stderr": "Command interrupted by SIGINT. Waiting for cleanup before exiting.\n",
        "elapsedMs": 5127,
        "configUnchanged": true
      },
      "head": {
        "statusAfterObservation": 130,
        "socketClosedBeforeRelease": true,
        "releaseAfterSignalMs": 2403,
        "paths": [
          "/api/v1/trending?kind=skills&limit=20"
        ],
        "status": 130,
        "stdout": "",
        "stderr": "Command interrupted by SIGINT. Waiting for cleanup before exiting.\n",
        "elapsedMs": 5378,
        "configUnchanged": true
      }
    },
    {
      "command": [
        "node",
        "openclaw.mjs",
        "skills",
        "search",
        "--json"
      ],
      "mode": "body_wait",
      "noRespawn": true,
      "signal": "SIGTERM",
      "trending": true,
      "base": {
        "statusAfterObservation": null,
        "socketClosedBeforeRelease": false,
        "releaseAfterSignalMs": 2407,
        "paths": [
          "/api/v1/trending?kind=skills&limit=20"
        ],
        "status": 143,
        "stdout": "{\n  \"results\": [\n    {\n      \"score\": 0,\n      \"slug\": \"cancel-fixture\",\n      \"displayName\": \"Cancellation Fixture\",\n      \"summary\": \"Synthetic loopback result\",\n      \"ownerHandle\": \"fixture-owner\",\n      \"updatedAt\": 1,\n      \"registry\": \"<loopback>\",\n      \"installRef\": \"@fixture-owner/cancel-fixture\"\n    }\n  ]\n}\n",
        "stderr": "Command interrupted by SIGTERM. Waiting for cleanup before exiting.\n",
        "elapsedMs": 4951,
        "configUnchanged": true
      },
      "head": {
        "statusAfterObservation": 143,
        "socketClosedBeforeRelease": true,
        "releaseAfterSignalMs": 2408,
        "paths": [
          "/api/v1/trending?kind=skills&limit=20"
        ],
        "status": 143,
        "stdout": "",
        "stderr": "Command interrupted by SIGTERM. Waiting for cleanup before exiting.\n",
        "elapsedMs": 5368,
        "configUnchanged": true
      }
    },
    {
      "command": [
        "node",
        "openclaw.mjs",
        "skills",
        "search",
        "cancel-fixture",
        "--json"
      ],
      "mode": "valid",
      "noRespawn": false,
      "signal": null,
      "trending": false,
      "base": {
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": 0,
        "stdout": "{\n  \"results\": [\n    {\n      \"score\": 0.9,\n      \"slug\": \"cancel-fixture\",\n      \"displayName\": \"Cancellation Fixture\",\n      \"summary\": \"Synthetic loopback result\",\n      \"ownerHandle\": \"fixture-owner\",\n      \"version\": \"1.0.0\",\n      \"registry\": \"<loopback>\",\n      \"installRef\": \"@fixture-owner/cancel-fixture\"\n    }\n  ]\n}\n",
        "stderr": "",
        "elapsedMs": 2831,
        "configUnchanged": true
      },
      "head": {
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": 0,
        "stdout": "{\n  \"results\": [\n    {\n      \"score\": 0.9,\n      \"slug\": \"cancel-fixture\",\n      \"displayName\": \"Cancellation Fixture\",\n      \"summary\": \"Synthetic loopback result\",\n      \"ownerHandle\": \"fixture-owner\",\n      \"version\": \"1.0.0\",\n      \"registry\": \"<loopback>\",\n      \"installRef\": \"@fixture-owner/cancel-fixture\"\n    }\n  ]\n}\n",
        "stderr": "",
        "elapsedMs": 3296,
        "configUnchanged": true
      }
    },
    {
      "command": [
        "node",
        "openclaw.mjs",
        "skills",
        "search",
        "--json"
      ],
      "mode": "valid",
      "noRespawn": false,
      "signal": null,
      "trending": true,
      "base": {
        "paths": [
          "/api/v1/trending?kind=skills&limit=20"
        ],
        "status": 0,
        "stdout": "{\n  \"results\": [\n    {\n      \"score\": 0,\n      \"slug\": \"cancel-fixture\",\n      \"displayName\": \"Cancellation Fixture\",\n      \"summary\": \"Synthetic loopback result\",\n      \"ownerHandle\": \"fixture-owner\",\n      \"updatedAt\": 1,\n      \"registry\": \"<loopback>\",\n      \"installRef\": \"@fixture-owner/cancel-fixture\"\n    }\n  ]\n}\n",
        "stderr": "",
        "elapsedMs": 2658,
        "configUnchanged": true
      },
      "head": {
        "paths": [
          "/api/v1/trending?kind=skills&limit=20"
        ],
        "status": 0,
        "stdout": "{\n  \"results\": [\n    {\n      \"score\": 0,\n      \"slug\": \"cancel-fixture\",\n      \"displayName\": \"Cancellation Fixture\",\n      \"summary\": \"Synthetic loopback result\",\n      \"ownerHandle\": \"fixture-owner\",\n      \"updatedAt\": 1,\n      \"registry\": \"<loopback>\",\n      \"installRef\": \"@fixture-owner/cancel-fixture\"\n    }\n  ]\n}\n",
        "stderr": "",
        "elapsedMs": 3229,
        "configUnchanged": true
      }
    },
    {
      "command": [
        "node",
        "openclaw.mjs",
        "skills",
        "search",
        "cancel-fixture",
        "--json"
      ],
      "mode": "not_found",
      "noRespawn": false,
      "signal": null,
      "trending": false,
      "base": {
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"ClawHub /api/v1/search failed (404): Synthetic fixture not found\"\n  }\n}\n",
        "stderr": "[openclaw] The CLI command failed.\n[openclaw] For help, run `openclaw doctor`.\n",
        "elapsedMs": 2742,
        "configUnchanged": true
      },
      "head": {
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"ClawHub /api/v1/search failed (404): Synthetic fixture not found\"\n  }\n}\n",
        "stderr": "[openclaw] The CLI command failed.\n[openclaw] For help, run `openclaw doctor`.\n",
        "elapsedMs": 3033,
        "configUnchanged": true
      }
    },
    {
      "command": [
        "node",
        "openclaw.mjs",
        "skills",
        "search",
        "cancel-fixture",
        "--json"
      ],
      "mode": "headers_wait",
      "noRespawn": false,
      "signal": "SIGINT",
      "trending": false,
      "base": {
        "statusAfterObservation": -9,
        "socketClosedBeforeRelease": true,
        "releaseAfterSignalMs": 2408,
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": -9,
        "stdout": "",
        "stderr": "Command interrupted by SIGINT. Waiting for cleanup before exiting.\n",
        "elapsedMs": 4780,
        "configUnchanged": true
      },
      "head": {
        "statusAfterObservation": 130,
        "socketClosedBeforeRelease": true,
        "releaseAfterSignalMs": 2409,
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": 130,
        "stdout": "",
        "stderr": "Command interrupted by SIGINT. Waiting for cleanup before exiting.\n",
        "elapsedMs": 5314,
        "configUnchanged": true
      }
    },
    {
      "command": [
        "node",
        "openclaw.mjs",
        "skills",
        "search",
        "cancel-fixture",
        "--json"
      ],
      "mode": "headers_wait",
      "noRespawn": false,
      "signal": "SIGTERM",
      "trending": false,
      "base": {
        "statusAfterObservation": -9,
        "socketClosedBeforeRelease": true,
        "releaseAfterSignalMs": 2401,
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": -9,
        "stdout": "",
        "stderr": "Command interrupted by SIGTERM. Waiting for cleanup before exiting.\n",
        "elapsedMs": 4824,
        "configUnchanged": true
      },
      "head": {
        "statusAfterObservation": 143,
        "socketClosedBeforeRelease": true,
        "releaseAfterSignalMs": 2401,
        "paths": [
          "/api/v1/search?q=cancel-fixture"
        ],
        "status": 143,
        "stdout": "",
        "stderr": "Command interrupted by SIGTERM. Waiting for cleanup before exiting.\n",
        "elapsedMs": 5311,
        "configUnchanged": true
      }
    },
    {
      "command": [
        "node",
        "openclaw.mjs",
        "skills",
        "search",
        "--json"
      ],
      "mode": "body_wait",
      "noRespawn": false,
      "signal": "SIGINT",
      "trending": true,
      "base": {
        "statusAfterObservation": -9,
        "socketClosedBeforeRelease": true,
        "releaseAfterSignalMs": 2401,
        "paths": [
          "/api/v1/trending?kind=skills&limit=20"
        ],
        "status": -9,
        "stdout": "",
        "stderr": "Command interrupted by SIGINT. Waiting for cleanup before exiting.\n",
        "elapsedMs": 4938,
        "configUnchanged": true
      },
      "head": {
        "statusAfterObservation": 130,
        "socketClosedBeforeRelease": true,
        "releaseAfterSignalMs": 2405,
        "paths": [
          "/api/v1/trending?kind=skills&limit=20"
        ],
        "status": 130,
        "stdout": "",
        "stderr": "Command interrupted by SIGINT. Waiting for cleanup before exiting.\n",
        "elapsedMs": 5508,
        "configUnchanged": true
      }
    },
    {
      "command": [
        "node",
        "openclaw.mjs",
        "skills",
        "search",
        "--json"
      ],
      "mode": "body_wait",
      "noRespawn": false,
      "signal": "SIGTERM",
      "trending": true,
      "base": {
        "statusAfterObservation": -9,
        "socketClosedBeforeRelease": true,
        "releaseAfterSignalMs": 2404,
        "paths": [
          "/api/v1/trending?kind=skills&limit=20"
        ],
        "status": -9,
        "stdout": "",
        "stderr": "Command interrupted by SIGTERM. Waiting for cleanup before exiting.\n",
        "elapsedMs": 4959,
        "configUnchanged": true
      },
      "head": {
        "statusAfterObservation": 143,
        "socketClosedBeforeRelease": true,
        "releaseAfterSignalMs": 2404,
        "paths": [
          "/api/v1/trending?kind=skills&limit=20"
        ],
        "status": 143,
        "stdout": "",
        "stderr": "Command interrupted by SIGTERM. Waiting for cleanup before exiting.\n",
        "elapsedMs": 5326,
        "configUnchanged": true
      }
    }
  ]
}
Complete frozen collector

Save outside either clean checkout, build each normally and run the command above using supported Node and Python3. Phase changes expected assertions only; cleanup applies only to fixture processes and peer.

#!/usr/bin/env python3
"""Run the built public skills-search CLI against fixed native HTTP I/O."""

import argparse
import hashlib
import http.server
import json
import pathlib
import signal
import socket
import subprocess
import tempfile
import threading
import time


def check(condition, message):
    if not condition:
        raise AssertionError(message)


def run_case(checkout, node, phase, mode, no_respawn, signal_name=None, trending=False):
    ready = threading.Event()
    release = threading.Event()
    state = {"paths": [], "closedBeforeRelease": False}
    row = {
        "score": 0.9,
        "slug": "cancel-fixture",
        "displayName": "Cancellation Fixture",
        "summary": "Synthetic loopback result",
        "source": "clawhub",
        "ownerHandle": "fixture-owner",
        "version": "1.0.0",
    }
    if trending:
        wire_row = dict(row)
        wire_row["publisher"] = {"handle": "fixture-owner"}
        wire_row["metrics"] = {"updatedAt": 1}
        body = json.dumps({"items": [wire_row]}, separators=(",", ":")).encode()
    else:
        body = json.dumps({"results": [row]}, separators=(",", ":")).encode()
    if mode == "not_found":
        body = b"Synthetic fixture not found"

    class Handler(http.server.BaseHTTPRequestHandler):
        protocol_version = "HTTP/1.1"

        def log_message(self, *args):
            pass

        def do_GET(self):
            state["paths"].append(self.path)
            state["socket"] = self.connection
            try:
                if mode == "headers_wait":
                    ready.set()
                    release.wait(20)
                self.send_response(404 if mode == "not_found" else 200)
                self.send_header("Content-Type", "application/json")
                self.send_header("Content-Length", str(len(body)))
                self.send_header("Connection", "close")
                self.end_headers()
                if mode == "body_wait":
                    prefix_length = 12
                    self.wfile.write(body[:prefix_length])
                    self.wfile.flush()
                    ready.set()
                    release.wait(20)
                    self.wfile.write(body[prefix_length:])
                else:
                    self.wfile.write(body)
            except (BrokenPipeError, ConnectionResetError, OSError):
                pass

    server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), Handler)
    server.daemon_threads = True
    thread = threading.Thread(target=server.serve_forever, daemon=True)
    thread.start()
    record = {
        "mode": mode,
        "noRespawn": no_respawn,
        "signal": signal_name,
        "trending": trending,
    }
    try:
        with tempfile.TemporaryDirectory(prefix="cancel-search-proof-", dir=checkout.parent) as tmp:
            root = pathlib.Path(tmp)
            home = root / "home"
            home.mkdir()
            store = root / "state"
            store.mkdir()
            config = root / "config.json"
            config.write_text("{}\n")
            config_before = hashlib.sha256(config.read_bytes()).hexdigest()
            env = {
                "PATH": str(node.parent) + ":/usr/bin:/bin",
                "HOME": str(home),
                "OPENCLAW_STATE_DIR": str(store),
                "OPENCLAW_CONFIG_PATH": str(config),
                "NO_COLOR": "1",
                "OPENCLAW_CLAWHUB_URL": f"http://127.0.0.1:{server.server_port}",
                "CLAWHUB_CONFIG_PATH": str(root / "absent-signin.json"),
            }
            if no_respawn:
                env["OPENCLAW_NO_RESPAWN"] = "1"
            argv = [str(node), str(checkout / "openclaw.mjs"), "skills", "search"]
            if not trending:
                argv.append("cancel-fixture")
            argv.append("--json")
            record["command"] = ["node", "openclaw.mjs", *argv[2:]]
            started = time.monotonic()
            child = subprocess.Popen(
                argv,
                cwd=checkout,
                env=env,
                stdin=subprocess.DEVNULL,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
            )
            try:
                if signal_name:
                    check(ready.wait(15), f"HTTP fixture not reached: {record}")
                    signalled = time.monotonic()
                    child.send_signal(getattr(signal, signal_name))
                    deadline = signalled + 2.4
                    while time.monotonic() < deadline:
                        sock = state.get("socket")
                        if sock and not state["closedBeforeRelease"]:
                            try:
                                peek = sock.recv(1, socket.MSG_PEEK | socket.MSG_DONTWAIT)
                                state["closedBeforeRelease"] = peek == b""
                            except BlockingIOError:
                                pass
                            except OSError:
                                state["closedBeforeRelease"] = True
                        time.sleep(0.01)
                    record["statusAfterObservation"] = child.poll()
                    record["socketClosedBeforeRelease"] = state["closedBeforeRelease"]
                    record["releaseAfterSignalMs"] = round((time.monotonic() - signalled) * 1000)
                    release.set()
                out, err = child.communicate(timeout=15)
            finally:
                release.set()
                if child.poll() is None:
                    child.kill()
                    child.communicate()
            stdout = out.decode(errors="replace")
            stderr = err.decode(errors="replace")
            stdout = stdout.replace(str(root), "<fixture>")
            stdout = stdout.replace(f"http://127.0.0.1:{server.server_port}", "<loopback>")
            stderr = stderr.replace(str(root), "<fixture>")
            record.update(
                paths=state["paths"],
                status=child.returncode,
                stdout=stdout,
                stderr=stderr,
                elapsedMs=round((time.monotonic() - started) * 1000),
                configUnchanged=hashlib.sha256(config.read_bytes()).hexdigest() == config_before,
            )
            check(record["configUnchanged"], "Fixture config changed")
            check(len(state["paths"]) == 1, f"Expected one read: {record}")
            expected_path = "/api/v1/trending?kind=skills&limit=20" if trending else "/api/v1/search?q=cancel-fixture"
            check(state["paths"][0] == expected_path, f"Wrong public request: {record}")
            if signal_name:
                check(f"Command interrupted by {signal_name}. Waiting for cleanup before exiting." in stderr, "Root did not accept interruption")
                expected_status = 130 if signal_name == "SIGINT" else 143
                if phase == "base":
                    if no_respawn:
                        check(record["statusAfterObservation"] is None, f"Baseline did not remain pending: {record}")
                        check(not record["socketClosedBeforeRelease"], "Baseline HTTP request closed early")
                        check(child.returncode == expected_status, f"Wrong baseline signal status: {record}")
                        check(json.loads(stdout)["results"][0]["slug"] == "cancel-fixture", "Baseline did not emit the late success")
                    else:
                        check(record["statusAfterObservation"] == -9, f"Expected existing wrapper force-kill: {record}")
                        check(stdout == "", f"Wrapper emitted a success: {record}")
                else:
                    check(record["statusAfterObservation"] == expected_status, f"CLI did not exit with signal status while HTTP remained held: {record}")
                    check(record["socketClosedBeforeRelease"], f"Cancelled HTTP socket stayed open: {record}")
                    check(stdout == "", f"Cancelled CLI emitted stdout: {record}")
                    check(stderr.strip() == f"Command interrupted by {signal_name}. Waiting for cleanup before exiting.", f"Unexpected cancellation diagnostic: {record}")
            elif mode == "not_found":
                check(child.returncode == 1, f"404 control did not fail: {record}")
                check("ClawHub /api/v1/search failed (404): Synthetic fixture not found" in stdout + stderr, f"404 diagnostic changed: {record}")
                check("Command interrupted" not in stderr, "404 was treated as cancellation")
            else:
                check(child.returncode == 0, f"Valid control failed: {record}")
                result = json.loads(stdout)["results"]
                check(len(result) == 1 and result[0]["installRef"] == "@fixture-owner/cancel-fixture", f"Wrong accepted result: {record}")
                check(stderr == "", f"Valid control diagnostic: {record}")
            return record
    finally:
        release.set()
        server.shutdown()
        server.server_close()


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("checkout", type=pathlib.Path)
    parser.add_argument("phase", choices=["base", "head"])
    parser.add_argument("node", type=pathlib.Path)
    parser.add_argument("--output", type=pathlib.Path, required=True)
    args = parser.parse_args()
    checkout = args.checkout.resolve()
    built = json.loads((checkout / "dist/build-info.json").read_text())
    head = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=checkout, text=True).strip()
    check(built["commit"] == head, "Built metadata does not match checkout HEAD")
    records = []
    for no_respawn in [True, False]:
        for mode, trending in [("valid", False), ("valid", True), ("not_found", False)]:
            record = run_case(checkout, args.node, args.phase, mode, no_respawn, trending=trending)
            records.append(record)
            print(json.dumps(record), flush=True)
        for mode in ["headers_wait", "body_wait"]:
            for signal_name in ["SIGINT", "SIGTERM"]:
                record = run_case(checkout, args.node, args.phase, mode, no_respawn, signal_name, trending=mode == "body_wait")
                records.append(record)
                print(json.dumps(record), flush=True)
    receipt = {
        "phase": args.phase,
        "head": head,
        "buildInfo": built,
        "collectorSha256": hashlib.sha256(pathlib.Path(__file__).read_bytes()).hexdigest(),
        "records": records,
    }
    args.output.write_text(json.dumps(receipt, indent=2) + "\n")
    print(json.dumps({"phase": args.phase, "head": head, "cases": len(records), "collectorSha256": receipt["collectorSha256"], "output": str(args.output)}), flush=True)


if __name__ == "__main__":
    main()

@clawsweeper

clawsweeper Bot commented Oct 29, 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 docs Improvements or additions to documentation cli CLI command changes size: S labels Oct 29, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 29, 2026
@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Propagate CLI cancellation through ClawHub searches and suppress results or errors after interruption.

Example: Press Ctrl-C while openclaw skills search cancel-fixture --json awaits response headers.

  • Before: The request remains open and can print late JSON, or the launcher force-kills the process.
  • After: The request closes, the process exits with status 130, and no search results appear.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, useful repair with shipped-entry-point evidence, preserved existing contracts, and the prior regression-test finding resolved.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Inspected full CLI subprocess output and native HTTP observations at execution head 09cb779: query/header and Trending/body interruptions exit 130/143 with closed sockets and no late output under normal and no-respawn launches; six completed controls preserve output. Current head changes only tests and their allocation, verified locally. Evidence covers Linux and a synthetic loopback peer, with no live-service claim.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An accepted interruption can leave skills search waiting or allow late results to appear.
Reason: Restoring cancellation has clear user value and requires no new configuration, default, public plugin API, or persisted-state change.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current cancellation bug and resolves the earlier test-synchronization finding. No actionable findings remain; current-head CI is still running.

Priority: P2
Reviewed head: 6e3a20afa4ebb6e7301f0d3e37a4919780c3ca64

Before merge

None.

Findings

None.

Agent review details

How this fits together

The skills CLI passes queries or queryless Trending requests through the shared skills lifecycle to the native ClawHub HTTP client, then renders returned results.

flowchart TD
  A[CLI invocation scope] --> B[Skills search command]
  B --> C[Shared skills search]
  C --> D[ClawHub HTTP client]
  D --> E[Native fetch and response body]
  D --> F[Abortable retry wait]
  E --> G[CLI result rendering]
Loading

Technical review

Best possible solution:

Use this focused signal propagation through existing owners, with cancellation handled before requests, during waits, and before CLI output.

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

Current-main source leaves the invocation signal disconnected from search and fetch; supplied before/after CLI traces demonstrate the failure and repair against a held native HTTP response, without a reviewer-run reproduction.

Is this the best way to solve the issue?

The patch is the smallest complete repair: it connects existing lifetime and transport owners, preserves deadlines and read-only retry policy, and leaves callers that omit the signal unchanged.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Current main still lacks cancellation propagation: Current main invokes search without the invocation signal, and its native request uses only the deadline controller. (src/cli/skills-search-cli.ts:28, 2ce885030396)
  • Focused production repair: The introduced patch forwards an optional signal, combines cancellation with the existing deadline, uses the existing abortable sleep, and suppresses output after accepted cancellation. (src/infra/clawhub-client.ts:254, 6e3a20afa4eb)
  • Earlier finding resolved: The revised tests replace the fixed delay with request receipt, the native reader's second read, and scheduling of the seven-second retry timer; the contributor also records a targeted abortable-sleep mutation failing its assertion. (src/infra/clawhub-client.test.ts:292, 6e3a20afa4eb)
  • Supplied shipped-entry-point proof: The full PR body contains real CLI subprocess and native HTTP observations for eight SIGINT/SIGTERM interruptions and six completed controls on Linux with Node 26.12.1. Interrupted requests close and exit 130/143 without late output; completed query, Trending, and HTTP-error behavior remains intact. (09cb7796e4f2)
  • Runtime proof remains applicable: Comparison with the recorded execution head verifies that only the client test and its test-line allocation changed; production and dependency inputs remain identical. (6e3a20afa4eb)
  • Existing timeout and retry intent preserved: Merged fix(clawhub): bound streaming metadata and error responses #109092 keeps metadata deadlines active through body consumption, and fix(clawhub): retry transient package reads #105388 limits replay to idempotent reads; this patch preserves both contracts. (src/infra/clawhub-client.ts:265, f2539206906a)

Likely related people:

  • Peter Steinberger: Raw commit c928f7a adds src/cli/skills-search-cli.ts:27 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c928f7abbf79; files: src/cli/skills-search-cli.ts)
  • pick-cat: Raw commit f253920 adds src/infra/clawhub-client.ts:250 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f2539206906a; files: src/infra/clawhub-client.ts)
  • Dallin Romney: Raw commit d8bb6e4 adds src/infra/clawhub-client.ts:229 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: d8bb6e452350; files: src/infra/clawhub-client.ts)

PR surface

Source +26, Tests +153, Docs +2, Other +1. Total +182 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 31 5 +26
Tests 2 154 1 +153
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 2 2 1 +1
Total 8 189 7 +182

Review metrics

Metric Value Why it matters
Production versus regression-test growth Production +31/-5 lines; tests +154/-1 lines Growth covers distinct native header/body cancellation, retry-backoff interruption, and CLI late-output suppression without adding production scaffolding.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Interrupted skills searches can remain pending or emit late results, with limited scope to an explicit CLI workflow.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-29T08:58:53.489Z sha 09cb779 :: needs changes before merge. :: [P3] Synchronize cancellation with the wait under test

Reviewed October 29, 2026, 5:45 AM ET / 09:45 UTC (Revision 2).

@Alix-007

Copy link
Copy Markdown
Contributor Author

Thanks for catching the phase-synchronization gap. Replaced the fixed delay with explicit native body-read and retry-timer barriers, and verified that reverting only the abortable retry sleep makes the new regression fail. Production is unchanged; the body now clearly identifies the original runtime-proof SHA and test-only reuse. Focused tests, types and lint pass.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 29, 2026
@obviyus

obviyus commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Combined this shared read-cancellation repair into the earlier #187504 at 989919049688569aff256a2bf952ac8e89720dc1. Both original contributor commits and your synchronization follow-up 6e3a20a are retained in its ancestry. The combined change preserves accepted mutation receipts and keeps the test-line delta at zero. Built-CLI comparisons cover SIGINT/SIGTERM, native header/body/backoff waits, normal results/errors and mutation controls; the backoff proof also rejects a variant with only abortable sleep removed. Evidence: #187504 (comment). Leaving this PR open; no separate branch push or merge was performed here.

obviyus added a commit that referenced this pull request Oct 29, 2026
fix(cli): stop accepted CLI reads on Ctrl-C and SIGTERM

Four CLI commands that read from the Gateway over RPC or HTTP after the request was accepted didn't pass the command's interrupt signal to their read adapters. After SIGINT or SIGTERM they stayed pending and printed late results. The RPC and HTTP read adapters now take the existing invocation signal, so the reads stop and the command exits with 130 or 143 and nothing late. Mutations that were already accepted keep their existing lifetime and settlement. This includes the fix from #187512.

Evidence: built CLI against synthetic peers, 19 cases per ref. On main, all four reads stayed pending after SIGINT or SIGTERM and printed late results (twice); with this change they exited 130 or 143 before release with empty stdout (twice). Normal results and errors, and accepted event and heartbeat receipts, behave the same on both refs. Details: #187504 (comment).

Thanks @Alix-007.

Co-authored-by: Ayaan Zaidi <[email protected]>
@obviyus

obviyus commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Alix-007. Your commits from this PR landed in #187504 (241614b), so I'm closing this one as included.

@obviyus obviyus closed this Oct 29, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

Thanks @obviyus — understood, this is included in #187504. Appreciate you keeping the original commits and the test follow-up.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 30, 2026
…aw#187504)

fix(cli): stop accepted CLI reads on Ctrl-C and SIGTERM

Four CLI commands that read from the Gateway over RPC or HTTP after the request was accepted didn't pass the command's interrupt signal to their read adapters. After SIGINT or SIGTERM they stayed pending and printed late results. The RPC and HTTP read adapters now take the existing invocation signal, so the reads stop and the command exits with 130 or 143 and nothing late. Mutations that were already accepted keep their existing lifetime and settlement. This includes the fix from openclaw#187512.

Evidence: built CLI against synthetic peers, 19 cases per ref. On main, all four reads stayed pending after SIGINT or SIGTERM and printed late results (twice); with this change they exited 130 or 143 before release with empty stdout (twice). Normal results and errors, and accepted event and heartbeat receipts, behave the same on both refs. Details: openclaw#187504 (comment).

Thanks @Alix-007.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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.

2 participants