Commit Graph

320 Commits

Author SHA1 Message Date
Haitao Pan
2333c3e5fd feat(acp): durable per-session run registry — survive gateway WS loss (T7/T8/T9)
OpenClaw gateway turns are async: chat.send returns a runId fast, the app then
polls tasks.get. Previously every tasks.get re-asked the gateway, so a WS blip /
reconnect that lost the gateway's in-memory run state turned into not_found /
socket_closed — the already-finished result was lost and the client either
hard-failed or polled forever.

Make tasks.get resilient by leaning on the per-session store (s.sessions),
whose lifetime is independent of the bridge<->gateway WebSocket:

- T8: cache a gateway-confirmed terminal result (final client-facing shape, after
  download-URL decoration + inline-content stripping) into sess.lastResult and
  serve it on subsequent polls, so a later gateway not_found cannot lose it.
- T7: when the gateway can't confirm (unavailable / socket closed / not_found) but
  the run is still within budget, synthesize a running handle so the client keeps
  polling across a transient blip — run tracking decoupled from WS lifetime.
- T9: when the run is past its DeadlineAt and the gateway still can't confirm,
  return a deterministic `interrupted` terminal (OPENCLAW_RUN_DEADLINE_EXCEEDED).

Correctness guards:
- startOpenClawGatewayTask resets State/ProgressTerminal when a session is reused
  for a new turn, so a prior turn's terminal can't be mis-served for a new runId.
- cache lookups verify the cached runId matches the requested runId (defense in depth).

Design note: T7 is handled at the tasks.get layer (re-correlate by runId via the
durable session store) rather than rewiring gatewayruntime's pending map — lower
risk, equivalent effect. A killed in-flight request surfaces as a gateway error
that the new fallback absorbs. T9 only force-terminates when the gateway is
unconfirmed, never when it explicitly reports running (avoids killing legit long
runs; the client-side deadline T3 covers that case).

Tests: internal/acp/openclaw_run_registry_test.go (terminal detection, within-budget
keep-polling, past-deadline interrupt, cache hit/replay, cross-runId isolation,
no-session not_found). go vet + full acp package green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 18:52:41 +08:00
Haitao Pan
e22d0f1cbf ci: keep bridge packaging unblocked without production token 2026-06-26 18:47:37 +08:00
311db31e03
Merge pull request #9 from ai-workspace-lab/fix/gateway-turn-stability-day1
fix(acp): session.prepare falls back on numeric gateway unknown-method codes
2026-06-26 17:56:41 +08:00
Haitao Pan
c7b2f8ee3a fix(acp): treat numeric gateway codes as unknown-method so session.prepare falls back
A gateway that doesn't implement xworkmate.session.prepare returns an
"unknown method: xworkmate.session.prepare" error. isOpenClawUnknownMethodError
gated on a string code allowlist {"", INVALID_REQUEST, METHOD_NOT_FOUND}, but real
gateways send a numeric JSON-RPC code (e.g. -32002 / -32601) which shared.StringArg
stringifies to "-32002". The matcher then returned false, so the graceful fallback
(openClawFallbackSessionPreparePayload) never fired and every turn hard-failed with
"-32002: unknown method: xworkmate.session.prepare".

Match on the unambiguous message ("unknown method" + the method name) instead of the
stringified numeric code. Add a regression test covering numeric codes and guarding
against swallowing unrelated errors / other method names.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 11:04:08 +08:00
Haitao Pan
b8f4ed6102 fix(ci): key per-job SHA256SUMS by os and arch
The runtime-release matrix builds linux+darwin × amd64+arm64, but each job
wrote its checksum to SHA256SUMS-<arch> (arch only). The linux/<arch> and
darwin/<arch> jobs therefore emitted the same filename, which clobbered each
other under the publish job's `merge-multiple: true` download. The merged
SHA256SUMS ended up with only 2 of the 4 platforms, so consumers of the
missing tarballs (notably xworkmate-bridge-linux-arm64.tar.gz) failed with
"missing checksum" — breaking the console offline arm64 package build.

Name the per-job file SHA256SUMS-<os>-<arch> so all four are unique and the
merged SHA256SUMS lists every published tarball.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 17:26:05 +08:00
Haitao Pan
9a8dd2dfe1 ci: add darwin build matrix for macos offline deployment 2026-06-19 19:06:50 +08:00
Haitao Pan
6a405a00e5 fix: stabilize gateway device token reissue 2026-06-18 14:48:03 +08:00
Haitao Pan
28a7eb3343 fix: add session prepare fallback 2026-06-18 10:01:19 +08:00
Haitao Pan
40fc458072 feat(bridge): implement unified bridge entrypoints and routing 2026-06-17 21:03:08 +08:00
Haitao Pan
861816738b feat(acp): support expectedFileCountByExtension constraint and dynamic chat timeout
- Add ExpectedFileCounts field to openClawArtifactContract to support per-extension file count validation
- Add normalizeOpenClawArtifactExtCountMap and openClawPositiveInt helpers
- Propagate expectedFileCountByExtension from contract/metadata/xworkmateArtifactConstraints
- Replace hard-coded 2min chat timeout with openClawAgentWaitTimeout for dynamic timeouts
- Add test coverage for normalize result and web contract
2026-06-17 16:57:31 +08:00
e6ffdf3177
Merge pull request #8 from ai-workspace-lab/release/v1.1.4
Release/v1.1.4
2026-06-15 22:03:40 +08:00
Haitao Pan
d70722f815 ci: publish bridge runtime releases 2026-06-15 21:58:50 +08:00
Haitao Pan
a19456d8a8 fix(desktop): time out ICE gathering 2026-06-13 07:10:28 +08:00
Haitao Pan
01c2c2ed31 fix(acp): prefer materialized inline attachment paths 2026-06-12 16:58:36 +08:00
Haitao Pan
e4966473c4 fix openclaw image attachment chat payload 2026-06-12 15:29:32 +08:00
Haitao Pan
58bbf890e0 Merge release/v1.1.4 cleanup 2026-06-12 14:50:10 +08:00
Haitao Pan
217e2665ff chore: remove unused legacy bridge helpers 2026-06-12 14:49:51 +08:00
Haitao Pan
a94488ffe5 Merge release/v1.1.4 deploy workflow fix 2026-06-12 14:38:54 +08:00
Haitao Pan
e2f005537d fix(ci): install ansible posix collection for deploy 2026-06-12 14:38:50 +08:00
Haitao Pan
a72122c731 Merge release/v1.1.4 CI fix 2026-06-12 14:29:32 +08:00
Haitao Pan
bb7fbbf91c fix(acp): remove ineffectual success assignment 2026-06-12 14:29:06 +08:00
Haitao Pan
6f819a5db7 Merge origin/main into main 2026-06-12 14:09:07 +08:00
Haitao Pan
6fe87e8341 Merge release/v1.1.4 task flow fixes 2026-06-12 14:08:55 +08:00
Haitao Pan
dcbd8fadcc fix(acp): adjudicate OpenClaw artifact evidence 2026-06-12 14:08:16 +08:00
5b718b8b8a
Merge pull request #7 from ai-workspace-lab/release/v1.1.4
Release/v1.1.4
2026-06-09 15:59:53 +08:00
Haitao Pan
3dd2359ca3 fix: accept low-latency desktop move channel 2026-06-09 15:55:39 +08:00
Haitao Pan
7277dd516f fix: accept low-latency desktop move channel 2026-06-09 15:55:19 +08:00
Haitao Pan
2b55f41865 docs: add remote desktop input latency runbook 2026-06-09 10:52:23 +08:00
Haitao Pan
4859396051 docs: add remote desktop input latency runbook 2026-06-09 10:52:17 +08:00
Haitao Pan
7135cfc415 fix: recover desktop input injector without deadlock 2026-06-09 10:47:15 +08:00
Haitao Pan
807d49f22d fix: recover desktop input injector without deadlock 2026-06-09 10:46:58 +08:00
Haitao Pan
a7f1773602 docs: document remote desktop session contention 2026-06-08 21:47:42 +08:00
Haitao Pan
05ac76daae docs: document remote desktop session contention 2026-06-08 21:09:23 +08:00
Haitao Pan
8fc9a614f2 Stabilize OpenClaw artifact finality 2026-06-08 10:49:07 +08:00
Haitao Pan
169ec72783 docs: add WebRTC desktop white screen runbook 2026-06-07 23:02:11 +08:00
Haitao Pan
0a0d04f3a7 fix: normalize desktop capture dimensions 2026-06-07 22:30:12 +08:00
Haitao Pan
0f096a588d fix: stabilize desktop WebRTC H264 stream 2026-06-07 22:25:42 +08:00
Haitao Pan
72bc3c0319 fix: delay desktop capture until WebRTC is ready 2026-06-07 21:57:53 +08:00
Haitao Pan
cccd72686b fix: recover bridge tokens during native deploy 2026-06-07 07:04:38 +08:00
Haitao Pan
e0dc9d5256 fix: pass openclaw session key when reading artifacts 2026-06-06 23:17:40 +08:00
Haitao Pan
a5207472cf fix: decorate fallback openclaw artifact downloads 2026-06-06 23:08:39 +08:00
Haitao Pan
919addfd11 fix(ci): accept OpenClaw session without native task record 2026-06-06 19:23:55 +08:00
Haitao Pan
6db48ee738 fix(ci): require bridge auth token before deploy 2026-06-06 19:11:13 +08:00
Haitao Pan
49637e87ea fix: keep OpenClaw artifact tasks running until export 2026-06-06 18:23:05 +08:00
Haitao Pan
c19631fd9c fix: deploy bridge native service as ubuntu user 2026-06-06 14:30:26 +08:00
Haitao Pan
772f47a5fe fix(ci): support base64 ssh deploy key 2026-06-06 14:21:59 +08:00
Haitao Pan
f125b1f603 fix: skip deploy on push 2026-06-06 13:42:23 +08:00
Haitao Pan
0b3ff0c94e fix: merge workflow env blocks 2026-06-06 13:36:05 +08:00
Haitao Pan
a5717fd7b9 ci: source deploy secrets from vault 2026-06-06 13:33:44 +08:00
Haitao Pan
9de1e70687 fix openclaw artifact workspace resolution 2026-06-06 12:17:27 +08:00