Commit Graph

63060 Commits

Author SHA1 Message Date
huangjianxiong 8abd5d4071 fix(tlon): bound error response body reads to prevent OOM (#98496)
* fix(tlon): bound error response body reads to prevent OOM

Replace bare response.text() on non-ok paths with readResponseTextLimited
capped at 16 KiB so a hostile or misconfigured Urbit ship cannot force the
gateway to buffer an arbitrary-size error body into process memory.

Affected paths:
- pokeUrbitChannel (channel-ops.ts)
- channel.runtime.ts poke path
- sendSubscription (sse-client.ts)

* fix(tlon): fix lint issues in error-body-boundary test

- Remove unused beforeEach import
- Wrap if/else bodies in braces (curly)
- Use block body for Promise executors (no-promise-executor-return)

* fix(types): resolve pre-existing TS test type errors

- Fix TS2493 tuple type errors in server-cron-notifications and
  server-cron tests by adding explicit type annotations on mock.calls
- Fix TS2322 in anthropic.test.ts by adding as const to resource
  content block type

* chore: trigger CI
2026-07-01 06:57:21 -07:00
lizeyu 733de866eb fix(update-check): bound npm registry JSON response read to prevent OOM (#98508)
* fix(update-check): bound npm registry JSON response read to prevent OOM

- Replace unbounded res.json() with readProviderJsonResponse capped at 16 MiB
- Update test mock to use real Response instead of bare object
- Verified against live npm registry: openclaw update status --json returns latestVersion: 2026.6.11

* fix(update-check): add 4 boundary tests for bounded npm registry read

- Tests: oversized response >16 MiB, near-boundary success
- Tests: malformed JSON, non-200 status code
- All pass with the readProviderJsonResponse bounded reader

* chore: add real behavior proof script for bounded JSON reader

Adds a standalone proof script that starts a local HTTP server and
drives the bounded reader against it with real HTTP requests, showing:
- Normal responses (~1 MB) parse correctly
- Oversized responses (>20 MB) are rejected with a descriptive error
- Malformed JSON is caught
- RSS does not spike on oversized responses

Ref. https://github.com/openclaw/openclaw/pull/98508

* chore: remove PR-specific proof script before merge

The proof script was accepted by ClawSweeper (proof: sufficient,
rating: diamond lobster), but it duplicates repository logic and
fails the scripts lint lane. Removing it per review feedback.

The real behavior proof remains in the PR body.

Ref. https://github.com/openclaw/openclaw/pull/98508
2026-07-01 06:56:06 -07:00
JC bd5bf4820a fix(cli): retry logs.tail after journal fallback in logs follow (#88159)
* fix(cli): retry logs.tail after journal fallback in logs follow

Rebase #88159 onto current main and keep systemd journal fallback temporary in follow mode. Preserve the journal cursor across repeated fallback outages, but retry logs.tail on the next loop so recovered Gateway RPC returns to normal log output.

This refresh also replaces the stale red checks-node-core-fast result from the old head with a current-head CI run.

* Keep log source metadata explicit

* ci: retrigger checks for PR #88159

* docs: clarify logs follow JSON source transitions

* fix(cli): keep journal logs responsive during recovery

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-07-01 06:55:11 -07:00
Wynne668 b6ad30625d fix(status): bound systemd service probes so status cannot hang on a wedged systemctl (#84698) (#94149)
* fix(status): bound systemd service probes so status cannot hang on a wedged systemctl (#84698)

* test(daemon): assert readRuntime receives the threaded status timeout opts (#84698)

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 06:52:14 -07:00
Wynne668 cb1e822f7a fix(cron): preserve provider/model on isolated-run timeout row (#95943)
* fix(cron): preserve provider/model on isolated-run timeout row

* fix(cron): carry provider/model/session into timer-built timeout rows

The reporter's blank cron_run_logs row (cron: job execution timed out
(last phase: ...)) comes from the wall-clock/cancel outcome built in
executeJobCoreWithTimeout, not the inner run catch the prior commit
patched (that catch result loses the Promise.race). Carry the
already-resolved attribution from watchdog-visible execution state into
the timer-built timeout and post-runner cancel outcomes so the persisted
row keeps provider/model/session. Pre-runner setup timeouts stay blank.

Refs #95873

* fix(cron): attribute timeout-disabled isolated-run operator-cancel rows

The timeoutSeconds:0 branch in executeJobCoreWithTimeout has no watchdog,
so it returned createOperatorCancellationOutcome() with no execution data
and never wired the execution callbacks. An operator-cancelled isolated run
with timeouts disabled still wrote a blank provider/model/session row.
Track the resolved identity locally from the same onExecutionStarted/
onExecutionPhase callbacks and carry it into the cancel outcome, matching
the timed branch. Adds a focused regression with negative control (#95873).

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 06:48:46 -07:00
Mason Huang 634a02e9e6 feat(autoreview): support cursor-agent engine (#97348)
Summary:
- The PR adds `cursor-agent` as an opt-in autoreview engine, updates the helper docs, runner dispatch, stream filtering, report parsing, and harness allowlists.
- PR surface: Docs +1, Other +99. Total +100 across 4 files.
- Reproducibility: not applicable. this is a feature PR, not a reported bug. The relevant check is source review plus maintainer validation of the external engine path.

Automerge notes:
- No ClawSweeper repair was needed after automerge opt-in.

Validation:
- ClawSweeper review passed for head 807659492b.
- Required merge gates passed before the squash merge.

Prepared head SHA: 807659492b
Review: https://github.com/openclaw/openclaw/pull/97348#issuecomment-4824183439

Co-authored-by: Mason Huang <masonxhuang@tencent.com>
Approved-by: hxy91819
2026-07-01 13:48:12 +00:00
dwc1997 f936c6b495 test(shared): add unit tests for human-readable list formatting
Squashed from PR #98605 after updating branch with current main and passing CI.
2026-07-01 06:42:54 -07:00
Masato Hoshino 5ada3acb5a feat(doctor): warn about in-flight cron jobs
Squashed from PR #98620 after updating branch with current main and passing CI.
2026-07-01 06:41:37 -07:00
Vincent Koc be2c4c65ab fix(i18n): invalidate native artifacts on glossary changes 2026-07-01 06:16:30 -07:00
Vincent Koc 1611e04fd9 fix(ci): keep locale refresh matrices alive 2026-07-01 06:16:30 -07:00
Vincent Koc 2611ebeb2e test(ci): route shared temp-dir dependents 2026-07-01 06:16:30 -07:00
Vincent Koc 18e33d44d4 test(i18n): use shared temp directory helper 2026-07-01 06:16:30 -07:00
Vincent Koc b881a978fb fix(ci): refresh native locales for glossary changes 2026-07-01 06:16:30 -07:00
Vincent Koc 51f5164bf4 fix(i18n): preserve native printf placeholders 2026-07-01 06:16:30 -07:00
Vincent Koc 70ef7ee2c8 fix(i18n): name Swedish in translation prompts 2026-07-01 06:16:30 -07:00
Vincent Koc 8bc40fc8de fix(i18n): validate native refresh inputs 2026-07-01 06:16:30 -07:00
Vincent Koc a0ab8a7475 fix(i18n): allow locale placeholder reordering 2026-07-01 06:16:30 -07:00
Vincent Koc 3029006364 test(ci): guard native locale refresh retries 2026-07-01 06:16:30 -07:00
Vincent Koc 096cc881c0 test(i18n): prove native refresh creation and no-op 2026-07-01 06:16:30 -07:00
Vincent Koc 40e0b3a597 fix(i18n): guard native refresh inputs 2026-07-01 06:16:30 -07:00
Vincent Koc 4fe3d46ae7 fix(i18n): cover all native source roots 2026-07-01 06:16:30 -07:00
Vincent Koc 281e164069 fix(i18n): validate Kotlin and Swift placeholders 2026-07-01 06:16:30 -07:00
Vincent Koc 90c46f48b6 fix(ci): restrict native locale refresh dispatch 2026-07-01 06:16:30 -07:00
Vincent Koc a7d5fe6343 fix(i18n): validate native translation structure 2026-07-01 06:16:30 -07:00
Vincent Koc ae272d2284 docs(i18n): clarify native artifact ownership 2026-07-01 06:16:30 -07:00
Vincent Koc 10d463d5ad fix(ci): commit first native locale artifacts 2026-07-01 06:16:30 -07:00
Vincent Koc f588a49a36 feat(i18n): refresh every native locale 2026-07-01 06:16:30 -07:00
Vincent Koc 8d18dacaa9 feat(i18n): refresh native locale artifacts 2026-07-01 06:16:30 -07:00
amittell 7b5d86e89a fix(subagent): preserve steered task text on restart redispatch
Squashed from PR #77539 after maintainer CI repair.
2026-07-01 06:14:00 -07:00
Peter Steinberger e7c689f410 fix: restore tooling CI after transcript test addition (#98610)
* test: update transcript helper routing expectation

* test: update transcript helper routing expectation

---------

Co-authored-by: Peter Steinberger <58493+steipete@users.noreply.github.com>
2026-07-01 14:04:00 +01:00
Vincent Koc 5e4d71686a fix(apple): preserve localized static labels 2026-07-01 05:19:12 -07:00
Vincent Koc d3e6d1fd6c fix(macos): compile packaged localizations 2026-07-01 05:19:12 -07:00
Vincent Koc be381c27a1 fix(macos): package localized app resources 2026-07-01 05:19:12 -07:00
Vincent Koc a53b6823c6 test(apple): enforce phased catalog coverage 2026-07-01 05:19:12 -07:00
Vincent Koc fe18aa38db feat(apple): complete core locale coverage 2026-07-01 05:19:12 -07:00
Vincent Koc 301d0d5551 style(apple): format localized share extension 2026-07-01 05:19:12 -07:00
Vincent Koc 9cfbd1b65c feat(apple): localize native app surfaces 2026-07-01 05:19:12 -07:00
Vincent Koc 02046b665f feat(apple): add Russian and Hindi app catalogs 2026-07-01 05:19:12 -07:00
Sanjay Santhanam 4dcd95d1bc fix(cli): show exit code when plugin npm install returns empty output (#98497)
* fix(cli): show exit code when npm install returns empty output

installPackageDir previously produced 'npm install failed:' with an empty
suffix when npm exited non-zero without writing to stdout or stderr. Users
running 'openclaw plugins install @openclaw/acpx' saw only that empty line
followed by the misleading hook-pack fallback error, leaving nothing
actionable in the output.

Add a small helper that keeps npm's own output when it exists but falls
back to reporting the exit code, signal, and termination reason when both
streams are empty. Regression tests cover the empty-output exit case and
the signal-terminated case; the existing stderr surfacing test still
passes unchanged.

Refs #98484

* fix(cli): narrow npm install failure diagnostics

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-07-01 05:04:27 -07:00
wangmiao0668000666 94cb14b97e fix(transcripts): close stream on parse failure 2026-07-01 04:52:13 -07:00
Sahibzada 90e31be388 fix(memory-core): skip qmd zero-hit search sync 2026-07-01 04:50:59 -07:00
lsr911 badbae77df fix(slack): guard relay frame parsing
* fix(slack): guard relay WebSocket frame JSON.parse against malformed input

Slack Socket Mode relay receives WebSocket frames from external
infrastructure. parseRelayFrame() used bare JSON.parse() which would
throw raw SyntaxError on malformed frames, potentially crashing the
relay connection.

Wrap JSON.parse in try/catch and throw SlackRelayMalformedFrameError
with the original SyntaxError as cause, so callers can distinguish
transport errors from parse errors.

D4 dimension — all competitors have zero coverage.

Signed-off-by: lsr911 <liao.shirong@xydigit.com>

* fix(slack): repair relay frame guard tests

---------

Signed-off-by: lsr911 <liao.shirong@xydigit.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-07-01 04:50:08 -07:00
Peter Steinberger 60d55a1725 fix: restore main lint after timer repairs
Preserve the Tailscale timeout cleanup from #98134 and the Feishu TDZ fix from #98137 while satisfying the repository lint rules.

Credit: @zhangLei99586 authored both underlying fixes.

Co-authored-by: Peter Steinberger <58493+steipete@users.noreply.github.com>
Co-authored-by: zhangLei99586 <zhang.lei162@xydigit.com>
2026-07-01 04:43:24 -07:00
lizeyu 1b0b8c294a fix(reload): cancel deferred channel reload on restart
Fixes #79487
2026-07-01 04:35:16 -07:00
Moeed Ahmed c99add65a2 fix(reply): honor suppressToolErrors for progress
5.22 already drops the tool-error WARNING text via payloads.ts, but the
error tool-result payload was still delivered as channel progress unless
sourceReplyDeliveryMode was message_tool_only. Operators who opt into
messages.suppressToolErrors expect no tool-error noise in chat at all.
Add a config-gated early-return in the onToolResult dispatch path so the
visible progress delivery is dropped too, matching the warning-text policy.
No-op unless messages.suppressToolErrors is true. Folds the mac-mini deploy
hotfix into the tracked branch.

(cherry picked from commit a973410e6d3ddbbaa4c3fb308ad4247274a9633a)

Co-authored-by: amittell <mittell@me.com>
2026-07-01 04:15:23 -07:00
VectorPeak 1cf6ff3bdc fix(browser): decode CDP URL credentials 2026-07-01 04:14:20 -07:00
Wynne668 06b841fa58 fix(sms): strip internal tool traces from replies 2026-07-01 04:12:55 -07:00
zhangLei99586 3241936526 fix: clear Tailscale probe timeout
The checkBinary helper used Promise.race with a setTimeout-based timeout
but never cleared the timer when runExec completed first. Wrap the race
in a try/finally that clears the timer handle to avoid a dangling timer.
2026-07-01 04:08:39 -07:00
zhangLei99586 8b14321c11 fix(feishu): hoist abortable delay timer binding
The finish() closure referenced timer which was declared with const after
finish was defined. If finish(false) ran via the abort signal check at
line 99 or via the abort event listener before the const timer assignment,
accessing timer in the temporal dead zone would throw a ReferenceError.

Hoist timer as a let binding above finish so it is safely undefined when
finish fires early, and the  guard in finish handles it.
2026-07-01 04:06:33 -07:00
Alix-007 76038c3a62 fix(matrix): bound raw transport response reads
* fix(matrix): bound raw transport response reads to prevent OOM

* test(matrix): add real node:http server proof for bound transport

Two new integration-style tests drive performMatrixRequest against a real
node:http server (no stubRuntimeFetch mock) using real undici + SSRF
dispatcher and ssrfPolicy.allowPrivateNetwork:

- over-cap: server declares Content-Length > MATRIX_SDK_RESPONSE_MAX_BYTES
  with maxBytes omitted → rejects MatrixMediaSizeLimitError (68 ms wall)
- under-cap: server returns small payload with maxBytes omitted → Buffer
  returned correctly (12 ms wall)

Addresses ClawSweeper feedback: previous proof showed only Vitest mock
output; these tests exercise the real Matrix runtime fetch path end-to-end.

* test(matrix): satisfy lint for transport proof

* fix(matrix): preserve encrypted media download limits

* test(matrix): add streaming OOM guard proof via real node:http server without Content-Length

Drive readResponseWithLimit directly by omitting Content-Length so that
enforceDeclaredResponseSize is a no-op and the streaming byte cap is the
sole enforcement path. A 20 MiB chunked server response with a 16 MiB
cap confirms the stream is canceled before full buffering (chunksWritten
< TOTAL_CHUNKS). A second case verifies under-cap payloads pass through.

* test(matrix): fix lint errors in real HTTP server proof (curly)

* test(matrix): add under-cap proof to real HTTP server test
2026-07-01 04:02:13 -07:00