Commit Graph

66965 Commits

Author SHA1 Message Date
Masato Hoshino
cbb920c7d9 fix(qqbot): channel status keeps reporting connected after the gateway websocket dies (#100127)
* fix(qqbot): publish disconnected channel status when the gateway closes or gives up

The QQBot channel only ever set connected: true (onReady/onResumed);
no close path updated the status, so a fatal close (bot banned or
offline, 4914/4915) or reconnect exhaustion left channels.status
claiming a live connection forever, and the channel-health monitor
never saw connected=false for a dead gateway.

Thread an onDisconnected callback from GatewayConnection.handleClose
(fatal and pre-reconnect branches) and the reconnect-exhaustion path
through the engine/bridge layers into channel.ts, which now records
connected: false and, for fatal closes, the close reason as lastError.
The running flag stays owned by the gateway lifecycle store, matching
the sibling channel convention.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(qqbot): import ChannelAccountSnapshot from the channel-contract subpath

The monolithic openclaw/plugin-sdk root entry is a legacy surface;
plugin-sdk contract guardrails and extension boundary checks require
focused subpath imports in bundled plugin sources.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(qqbot): ignore stale socket closes from superseded gateway connections

A server-driven RECONNECT / INVALID_SESSION tears the old socket down
and brings up a replacement; the old socket's close event can arrive
after the replacement is live. Reacting to it again would tear down the
new socket and regress the connected status, so the close handler now
ignores closes from sockets that are no longer current.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(qqbot): harden disconnect status recovery

* fix(qqbot): report opcode-driven reconnects

* fix(qqbot): keep fatal disconnect health visible

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-07-05 04:18:01 -07:00
Vincent Koc
57ca1b0254 fix(docker): materialize ai runtime package 2026-07-05 13:10:15 +02:00
Peter Steinberger
824d8af0d6 test(tooling): route e2e-shell-tempfiles through the temp-dir helper plan
17a1993f13 made test/scripts/e2e-shell-tempfiles.test.ts import the
temp-dir helper without updating the helper-routing expectation, so
checks-node-compact-small-whole-2 fails on every PR merge snapshot.
2026-07-05 04:05:05 -07:00
Vincent Koc
17a1993f13 fix(e2e): stop waiting for skipped skills prompt 2026-07-05 12:40:31 +02:00
Peter Steinberger
1403c64799 fix(protocol): regenerate Swift gateway models for approvalReviewerDeviceIds
The plugin-approvals schema gained approvalReviewerDeviceIds (#100251)
without refreshing the generated Swift model, so the bundled-protocol
drift gate fails on every PR. Mechanical pnpm protocol:gen:swift output.
2026-07-05 03:38:08 -07:00
Vincent Koc
8a8af77236 fix(plugin-sdk): refresh api baseline hash 2026-07-05 12:17:14 +02:00
Ben.Li
8df18050d5 fix(android): default manual TLS port to 18789 except Tailscale hosts (#99865)
* fix(android): default manual TLS port to 18789 except Tailscale hosts

Match iOS resolveManualPort so blank-port TLS manual connects use 443 only for .ts.net hosts and 18789 elsewhere; update Connect port hints accordingly.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(android): sync i18n and align manual port hints with resolver

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(android): unify blank manual gateway ports

* fix(android): normalize tailnet port hints

* refactor(android): drop legacy connection UI delta

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-05 03:17:08 -07:00
Peter Steinberger
3f493aa6d0 chore(android): add deterministic chat streaming replay test harness (#100200)
* test(android): add deterministic chat streaming replay harness (#100196)

* test(android): emit protocol-valid chat replay events
2026-07-05 03:16:55 -07:00
Peter Steinberger
5af24d16bf chore(ci): fail CI when gateway events go unhandled by the mobile apps (#100206)
* ci: guard gateway protocol event coverage for iOS/Android clients (#100198)

Adds scripts/check-protocol-event-coverage.mjs, which derives the
server->client event catalog from GATEWAY_EVENTS in
src/gateway/server-methods-list.ts, extracts the events each mobile app
handles from Swift/Kotlin dispatch sites, and fails on gateway events no
client handles unless allowlisted with a reason in
scripts/protocol-event-coverage.allowlist.json. Wired as
pnpm check:protocol-coverage in the CI guards shard.

* fix(ci): scope Kotlin event extraction to handle*Event dispatch functions (#100198)

Bare event == "..." literals in predicate helpers outside the dispatch
path (gatewayEventInvalidatesNodesDevices in NodeRuntime.kt, which has no
production caller) counted as Android coverage, silently masking that
node.pair.requested/resolved have no live handler. Kotlin extraction now
only reads when(event) labels and event comparisons inside fun
handle*Event(...) bodies; node.pair.* moved to the Android allowlist with
a truthful reason. Swift extraction stays tree-wide because consumption
there always reads .event off a received EventFrame.

* fix(android): remove dead node pairing event helper

* fix(ci): preserve protocol allowlist parse errors

* test(ci): align tooling import plan
2026-07-05 03:06:52 -07:00
Vincent Koc
29857e25aa fix(tui): keep skill approvals in the terminal (#100251)
* fix(tui): keep skill approvals in the terminal

* fix(tui): keep skill approvals in the terminal
2026-07-05 03:06:44 -07:00
Vincent Koc
10ca94ef1a fix(gateway): reuse startup channel manifests 2026-07-05 11:58:58 +02:00
Peter Steinberger
7137be38e8 docs(maint): raise PR close batch limit (#100253)
* docs(maint): raise PR close batch limit

* docs(maint): raise PR close batch limit
2026-07-05 02:57:18 -07:00
Peter Steinberger
49302fcb7d fix: DashScope and Moonshot endpoints misclassified as custom when the provider plugin is not installed (#100125)
Externalized provider plugins (qwen, moonshot, zai, deepseek, groq, cerebras, chutes) are excluded from dist packaging, so their manifest-declared endpoint classes were invisible to installed gateways and built source checkouts: DashScope/Moonshot-class base URLs classified as custom, breaking image prompt placement, streaming-usage and developer-role compat defaults, and deterministically failing image.test.ts / model-compat DashScope cases after pnpm build. The official external provider catalog now mirrors each plugin's providerEndpoints and provider attribution appends catalog metadata after installed/bundled manifests (first match wins; repo-bundled catalog only, hosted feeds never influence classification). Includes a catalog-manifest mirror contract test and a dist-simulation regression test.
2026-07-05 02:53:51 -07:00
Peter Steinberger
0720b322fe fix(ios): remove debug icon outer rim (#100259) 2026-07-05 02:50:07 -07:00
Peter Steinberger
78685aec46 fix(ui): center terminal new-session button (#100256) 2026-07-05 02:36:12 -07:00
LZY3538
e6ec74c254 fix(compaction): preserve Anthropic context usage (#99864) 2026-07-05 02:33:43 -07:00
Vincent Koc
5f2df24619 fix(qa): run gateway MCP producer from source checkout 2026-07-05 11:27:59 +02:00
Peter Steinberger
e7808dbe60 fix(ui): hide idle composer scrollbar (#100252) 2026-07-05 02:25:34 -07:00
github-actions[bot]
ad4809f677 chore(i18n): refresh native locales 2026-07-05 09:23:42 +00:00
Vincent Koc
c22270a917 fix(build): restore package artifact declarations (#100249)
* fix(build): restore package artifact declarations

* fix(build): stage plugin sdk strict smoke artifacts

* test(exec): accept resolved safe-bin paths

* test(qa): type missing delivery metadata regression

* fix(build): restore llm runtime tsdown root

* fix(build): drop removed llm runtime tsdown root
2026-07-05 02:22:11 -07:00
Masato Hoshino
153ee2abba fix(subagents): killed subagent runs stay running in the task list (#99806)
* fix(subagents): reconcile killed task outcomes

Co-authored-by: masatohoshino <g515hoshino@gmail.com>

* fix(subagents): retain reconciliation marker narrowing

* fix(subagents): honor generations in latest-run views

* test(subagents): align reconciliation fixtures

* fix(subagents): keep steer recovery best effort

* style(tasks): use type-only runtime contract import

* refactor(subagents): keep generation ordering leaf-only

* fix(subagents): sanitize persisted task owner ids

* fix(subagents): preserve failed replay lifecycle reason

* fix(agents): clear killed lifecycle timeout grace

* fix(tasks): preserve canonical subagent outcomes

* fix(agents): continue requester-wide cancellation

* fix(agents): fence yield revival races

* test(agents): mock detached task lookup

* fix: fence subagent cleanup deletion

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-05 02:17:10 -07:00
Peter Steinberger
9c5ea29e38 test: stabilize OpenClawKit async tests (#100243) 2026-07-05 02:12:06 -07:00
Peter Steinberger
d467ac56c3 fix(qa): retry a failed flow scenario once before failing the suite
Live-model flow lanes (QA Smoke CI) flake on model latency spikes: step
timeouts and agent.wait timeouts failed 8 consecutive smoke runs on unrelated
scenarios, including main's own push CI. A first failure now gets one bounded
rerun; a retried pass keeps the first attempt visible in details, and a retry
failure keeps the original diagnostics so deterministic regressions still fail.
2026-07-05 10:06:00 +01:00
Peter Steinberger
b6f4cf5ac4 docs: default agent validation to remote runners (#100220)
* docs: default agent validation to remote runners

* docs: isolate untrusted validation networking

* fix: harden untrusted Crabbox validation

* docs: refresh generated docs map
2026-07-05 02:01:51 -07:00
Peter Steinberger
e60c510560 feat(ios): distinguish debug app builds (#100222)
* feat(ios): distinguish debug app builds

* feat(ios): distinguish debug app builds

* feat(ios): emphasize debug app icons

* feat(ios): emphasize debug app icons
2026-07-05 02:01:26 -07:00
Peter Steinberger
3957ccba4e feat(crestodian): run CLI harnesses on the agent loop via a ring-zero MCP server (#100029)
CLI harnesses (claude-cli, gemini-cli) cannot enforce runtime toolsAllow, so
Crestodian previously fell back to the single-turn planner for them. The
openclaw-tools stdio MCP entry can now serve the ring-zero crestodian tool
(OPENCLAW_TOOLS_MCP_TOOLS=crestodian), and Crestodian CLI runs inject it as the
run's exclusive MCP surface: no loopback server, no plugin/user MCP servers,
with the server kept under the "openclaw" name so existing tool pre-approvals
apply. agent-turn routes configured or detected CLI-harness models through
runCliAgent with native session resume across turns, keeps embedded toolsAllow
enforcement for API-key models and the Codex app-server fallback, and still
degrades to the planner when no loop backend works.

The host-verified approval contract survives the process boundary: per-turn
arming and the pending exact-operation hash travel to the stdio server via the
generated MCP config env, and the host mirrors proposal transitions back from
harness tool events (denial registers the hash, mismatch voids it, execution
consumes it) so a generic yes can never authorize a different mutation. The
trust model (the CLI owns its native tools) is documented in
docs/cli/crestodian.md.
2026-07-05 01:59:07 -07:00
Vincent Koc
f8dd649485 docs(release): carry approval through publish (#100239) 2026-07-05 01:57:03 -07:00
Peter Steinberger
a555ad7598 fix(reply): prevent foreground delivery deadlock (#100205)
* fix(reply): prevent foreground delivery deadlock

* fix(reply): prevent foreground delivery deadlock
2026-07-05 01:56:41 -07:00
Peter Steinberger
86bf85fb35 fix(ui): publish mobile setup independently (#100179)
* fix(ui): publish mobile setup independently

* fix(ui): publish mobile setup independently
2026-07-05 01:54:58 -07:00
Chunyue Wang
e1eac7a79d fix(agents): strip system-event prefix from modelPrompt when before_prompt_build hooks add context (#95349)
* fix(agents): strip system-event prefix from modelPrompt when before_prompt_build hooks add context

* fix(agents): preserve prompt boundaries when stripping runtime context

* test(agents): assert nested prompt text in boundary regression

* fix(agents): anchor runtime context stripping to prompt boundaries

* fix(agents): prefer the active prompt boundary

* fix(agents): avoid rewriting prompts without hidden context

* fix(agents): make prompt stripping helper total

* test(agents): drop synthetic prompt boundary proof

* fix(agents): anchor prompt stripping to hook boundaries

* fix(agents): preserve normalized prompt boundaries

* fix(agents): carry prompt build boundaries

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-05 01:54:01 -07:00
Joey Frasier (Boothe)
7e0d530e07 fix(slack): reconcile ambiguous sends before replay (#97480)
* fix(slack): reconcile ambiguous sends exactly

Co-authored-by: Joey Frasier (Boothe) <joey.frasier@worksuite.com>

* test(infra): cover durable dispatch context

* fix(slack): keep reply policy internal

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-05 01:48:57 -07:00
Peter Steinberger
091d9564b6 fix(ui): hide duplicate terminal caret (#100240) 2026-07-05 01:48:43 -07:00
Peter Steinberger
8b229a938c fix(ui): simplify OpenAI speed choices (#100190) 2026-07-05 01:46:13 -07:00
Peter Steinberger
f3e3b6985b fix: land nine small correctness fixes (#100204)
* fix(memory-wiki): preserve dollar notes on reimport

Co-authored-by: 李兰 0668001394 <li.lan3@xydigit.com>

* fix(voice-call): handle spawn error during tunnel cleanup

Co-authored-by: 陈宪彪0668000387 <chen.xianbiao@xydigit.com>

* fix(media): reject invalid response byte limits

Co-authored-by: linhongkuan <linhk8@mail2.sysu.edu.cn>

* fix(infra): match listening ports exactly

Co-authored-by: 徐闻涵0668001344 <xu.wenhan1@xydigit.com>

* fix(exec): preserve UTF-16 boundaries when truncating output

Co-authored-by: liuhao1024 <sunsky.lau@gmail.com>

* fix(agents): reject surrogate HTML entities

Co-authored-by: mikasa0818 <0668001030@xydigit.com>

* fix(anthropic): guard Claude Fable 5 prefix boundaries

Co-authored-by: 黄剑雄0668001315 <huang.jianxiong@xydigit.com>

* fix(models): render context windows in decimal K

Co-authored-by: harjoth <harjoth.khara@gmail.com>

* fix(clickclack): preserve websocket rejection diagnostics

Co-authored-by: sunlit-deng <yang.jiajun1@xydigit.com>

* fix(exec): use canonical UTF-16 slicing helper

Co-authored-by: liuhao1024 <sunsky.lau@gmail.com>

* style(exec): sort UTF-16 helper imports

* style(exec): sort UTF-16 helper imports

* style(exec): sort UTF-16 helper imports

* style(infra): format response limit helper

* style(infra): format response limit helper

---------

Co-authored-by: 李兰 0668001394 <li.lan3@xydigit.com>
Co-authored-by: 陈宪彪0668000387 <chen.xianbiao@xydigit.com>
Co-authored-by: linhongkuan <linhk8@mail2.sysu.edu.cn>
Co-authored-by: 徐闻涵0668001344 <xu.wenhan1@xydigit.com>
Co-authored-by: liuhao1024 <sunsky.lau@gmail.com>
Co-authored-by: mikasa0818 <0668001030@xydigit.com>
Co-authored-by: 黄剑雄0668001315 <huang.jianxiong@xydigit.com>
Co-authored-by: harjoth <harjoth.khara@gmail.com>
Co-authored-by: sunlit-deng <yang.jiajun1@xydigit.com>
2026-07-05 01:44:56 -07:00
Vincent Koc
bb1e0ad724 fix(apps): refresh native i18n inventory 2026-07-05 10:32:46 +02:00
Vincent Koc
53bd4dde6c fix(ci): stabilize manual dispatch checkout 2026-07-05 10:22:26 +02:00
Peter Steinberger
4deb63c979 fix(crestodian): repair post-merge checks (#100223) 2026-07-05 01:17:58 -07:00
Peter Steinberger
05c9dccf35 feat(apps): match the mascot design to the openclaw.ai hero
Aligns the shared OpenClawMascotView with the website hero styling:
per-part bounding-box gradients (SVG objectBoundingBox semantics; the
claws were nearly flat-colored before), antenna stroke width 2, eye
glow r=2, float depth -8% of size, and a light-scheme palette from the
site theme variables. The float now offsets the whole canvas like the
site floats the hero container, so the antennae no longer clip at the
float peak.

macOS adopts the hero glow treatment: the About pane mascot gets the
coral silhouette drop-shadow with the teal hover glow and 1.1 hover
scale, and the onboarding hero replaces its hand-rolled breathing glow
circle with the same silhouette glow.
2026-07-05 01:13:26 -07:00
Peter Steinberger
07bf384a8b feat(crestodian): conversational agent-loop onboarding across CLI, web install, and macOS app (#99935)
* feat(crestodian): AI-first conversational onboarding with typed-op guardrails

Interactive `openclaw onboard` (and bare `openclaw` on a fresh install) now
opens the Crestodian conversation: detection-backed first-run proposal
(Claude Code/Codex logins, API keys), persona AI turns for every free-form
message (configless local-runtime fallback, 60s deadline, deterministic
degradation), approval-gated typed operations, chat-hosted channel setup
(`connect <channel>`), config get/schema read ops with secret redaction, and
a post-write validation hook that feeds schema errors back for a self-fix
turn. Adds the additive gateway `crestodian.chat` method so app clients run
the same conversation. Classic wizard stays behind --classic/explicit flags;
non-interactive automation unchanged; `--modern` becomes a deprecated alias
for `openclaw crestodian`.

* feat(macos): Crestodian chat onboarding and importance-ordered permissions

Replace the gateway step-wizard page with a Crestodian chat over the new
crestodian.chat method (works before any model auth exists), sort the
permissions page by importance with no scrolling, drop the redundant manual
refresh, and bump the onboarding version.

* feat(crestodian): run the custodian on the real agent loop with a ring-zero tool

Crestodian conversations now execute through the same embedded agent runner
as regular agents: a persistent agent session with a single construction-gated
`crestodian` tool wrapping the typed operations (read actions free; mutations
require approved=true asserted from explicit user consent, audited, with
post-write config validation fed back into the loop). The engine prefers the
loop (configured models or the Codex app-server fallback) and degrades to the
single-turn planner, then to deterministic commands. Setup approval seeds the
crestodian exec approval so local model harnesses can run; the configless
Codex backend config now enables exec and direct tool loading (it was
dead-on-arrival behind tools.exec.mode=deny and the tool-search index).

* test(crestodian): type the engine mock signatures for the core test lane

* fix(crestodian): map the advertised create_agent tool action

* fix(crestodian): host-verified approval arming and a macOS setup completion gate

Review findings: the model-supplied approved flag alone could authorize
ring-zero mutations (prompt injection / model error), and removing the macOS
wizard gate let users Next past the Crestodian page with nothing configured.
Mutating tool actions now also require host-verified consent (the engine arms
approval only when the user's actual message is an explicit yes), and local
macOS onboarding blocks advancing until setup authored the config, using the
same signal the old step wizard checked.

* fix(crestodian): bind approval to the exact proposed operation and gate dot navigation

A generic yes no longer authorizes arbitrary mutations: denied mutating tool
calls register a canonical operation fingerprint (host-owned, per session),
and an armed turn executes only the identical call, once. The denial message
is arming-aware so the approved turn self-heals in one roundtrip, and the
agent protocol pre-registers proposals. macOS onboarding page dots now honor
the same setup-completion gate as the Next button.

* fix(crestodian): redact sensitive wizard answers, skip logged-out CLIs, gate programmatic advance

Sensitive channel-wizard answers (tokens, passwords) are redacted from the
AI-visible conversation history; setup and the onboarding welcome never pick
or advertise a definitively logged-out CLI as the model; and macOS
handleNext() honors the page gates for programmatic callers (chat handoff)
just like the Next button.

* fix(crestodian): align the onboarding welcome's configured predicate with the app gate

A valid config carrying only a default model (partial/hand-written) now still
gets the first-run proposal instead of the ready guide, so the macOS setup
gate can always be satisfied from the conversation.

* fix(crestodian): armed turns can never mint their own executable proposal

An approval-mismatched call inside an armed turn no longer re-registers and
invites a retry (which let the model swap the approved operation for another
in the same turn); it voids the approval entirely and requires a fresh yes.
Proposals register only in unarmed turns, which the agent protocol already
does when proposing.

* fix(onboard): route any explicit setup flag to the classic wizard

* fix(ci): satisfy new lint rules, tool-display guard, and generated artifacts for crestodian

* chore(i18n): refresh native inventory after permissions copy wrap

* fix(crestodian): harden conversational onboarding

* docs(crestodian): document conversational onboarding

* test(crestodian): type embedded runner mock

* fix(crestodian): close onboarding security gaps

* chore: retrigger ci
2026-07-05 01:02:53 -07:00
Peter Steinberger
c64a306f90 fix(macos): preserve PATH for SSH helpers (#100214) 2026-07-05 00:45:08 -07:00
Vincent Koc
51255f66eb test(e2e): follow quickstart hook defaults 2026-07-05 09:36:55 +02:00
Dan Hayman
f4908e60fd fix(discord): fall back to text when voice delivery fails (#89962)
* fix(discord): fall back to text when voice delivery fails

* fix(discord): preserve reply target on voice fallback

* fix(discord): suppress duplicate delivered TTS fallback

* refactor(discord): bound voice fallback handling

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-05 03:19:53 -04:00
Ayaan Zaidi
cfdc2b3ff9 fix(cron): keep default toolsAllow marker when edits echo an unchanged list 2026-07-05 00:18:12 -07:00
Peter Steinberger
e72a2c825d fix(ui): simplify selectable tool error rows (#100199)
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-05 00:08:21 -07:00
Sanjay Santhanam
6cc534bbad fix(discord): reuse stored sessionId across voice (stt-tts) turns (#97746)
* fix(discord): reuse stored sessionId across voice (stt-tts) turns

Discord voice turns previously called agentCommandFromIngress without a
sessionId, so the core session resolver minted a fresh UUID per turn.
Because the codex app-server thread is bound beside the per-session
file, every voice turn produced a new codex thread, a brand-new
rollout-*.jsonl, and lost all prior context.

The fix reads the persisted session entry for the route's sessionKey
(the same supervisor entry already used for the route) and threads that
sessionId into agentCommandFromIngress, mirroring how voice-call's
response-generator and the gateway 'voice.transcript' dispatcher already
keep voice conversations stable.

Adds extensions/discord/src/voice/ingress.test.ts covering both
directions: reuses the stored id when present, and lets core mint a
fresh one when the store is empty.

Fixes #97688

* fix(discord): preserve voice session after rollover

* refactor(discord): keep voice session ownership in core

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-05 03:00:08 -04:00
Peter Steinberger
009b00f7ba fix(acp-core): keep fallback error redaction (#100191)
* fix(acp-core): keep fallback error redaction

Co-authored-by: linhongkuan <linhk8@mail2.sysu.edu.cn>

* fix(acp-core): keep fallback error redaction

---------

Co-authored-by: linhongkuan <linhk8@mail2.sysu.edu.cn>
2026-07-05 02:54:42 -04:00
xingzhou
c2ea5a2d65 test(tui): lock dunder markdown rendering (#95211)
* test(tui): lock dunder markdown rendering

Co-authored-by: 张贵萍0668001030 <zhang.guiping@xydigit.com>

* test(tui): lock dunder markdown rendering

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-05 02:50:42 -04:00
Vincent Koc
97935832ab test(qa): keep bundle MCP policy proof packaged 2026-07-05 08:44:52 +02:00
github-actions[bot]
8be1d366a1 chore(i18n): refresh native locales 2026-07-05 06:42:53 +00:00
huangjianxiong
783c0aec50 fix(google-meet): bound JSON response body reads to prevent OOM (#98850)
* fix(google-meet): bound JSON response body reads to prevent OOM

Replace raw response.json() with readProviderJsonResponse (16 MiB cap)
across meet.ts, calendar.ts, and oauth.ts to prevent unbounded memory
allocation from oversized HTTP response bodies.

Also extract duplicated hasConfig check in createGoogleMeetSpace.

Test: loopback HTTP server test with 4 MiB oversized body + valid body.

* fix(test): prove readProviderJsonResponse bounds the 200 success path

Replace loopback server with synthetic Response objects. The oversized
test now returns HTTP 200 with a 17 MiB body — readProviderJsonResponse
rejects it at its 16 MiB cap, proving the bounded read fires on the
success path (not just the already-bounded 500 error path the old test
exercised).

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

* fix(test): add real HTTP transport integration tests for bounded JSON reads

- Add two vitest integration tests that start a real local TCP server,
  fetch through native HTTP transport, and verify readProviderJsonResponse
  correctly rejects oversized responses and passes normal ones.
- Existing synthetic-boundary tests unchanged.

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

* fix(test): wrap server.listen in promise executor to satisfy oxlint no-promise-executor-return

* fix(google-meet): add real SSRF-guard transport integration tests for bounded JSON reads

Adds two new integration tests that route meet.googleapis.com requests
through a local TCP server via spyOnGoogleMeetFetch, exercising the
actual fetchGoogleMeetSpace function end-to-end through the SSRF guard
mock. This addresses ClawSweeper review feedback requesting real
transport-level proof of the bounded read contract.

* fix(google-meet): preserve original fetch reference in spyOnGoogleMeetFetch to avoid recursion

The mockImplementation replaced globalThis.fetch, so calling fetch() inside
the mock called the mock itself. Capture globalThis.fetch before spying and
use the saved reference inside the implementation to avoid infinite recursion.

* fix(google-meet): add console.log debug output to loopback proof tests

Add structured console.log evidence markers to the four real HTTP
transport integration tests so that reviewers can see the bounded-read
contract working through actual TCP connections. Format matches the
established pattern from Alix-007's approved bound-read PRs.

* Revert "fix(google-meet): add console.log debug output to loopback proof tests"

This reverts commit e64c26d17e867f3b18ca0ad3a5d95af9d9809efc.

* fix(google-meet): tighten response body limits

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-05 02:34:08 -04:00