Repository navigation
fix(linux-canvas): report degraded socket monitoring - #109502
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 3:30 AM ET / 07:30 UTC. ClawSweeper reviewWhat this changesThe PR adds Linux Canvas operator warnings for synchronous and asynchronous socket-directory watcher failures while retaining the existing polling-based availability fallback. Merge readinessThis PR remains necessary: current Priority: P2 Review scores
Verification
How this fits togetherThe bundled Linux Canvas plugin exposes node-host Canvas commands whose availability depends on a local Unix socket. Filesystem watching gives prompt change notifications, while flowchart LR
A[Linux Canvas socket directory] --> B[Filesystem watcher]
B --> C{Watcher failure?}
C -- No --> D[Availability change callback]
C -- Yes --> E[Operator warning]
E --> F[One-second liveness polling]
F --> G[Canvas command availability]
D --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +10, Tests +36. Total +46 across 2 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge this focused owner-boundary repair after the current-head hosted gates complete, retaining the one-second polling reconciliation as the sole availability fallback. Do we have a high-confidence way to reproduce the issue? Yes. A missing socket parent makes Is this the best way to solve the issue? Yes. Logging at the watcher owner is the narrowest maintainable repair because the caller already owns the polling fallback and shutdown lifecycle; adding retries or diagnostics there would duplicate recovery policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against edfeec49e7a7. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
Maintainer verification for contributor-authored head
|
65e9414 to
e9526ed
Compare
|
Merged via squash.
|
* origin/main: (41 commits) test(ci): update memory helper routing expectation (#117295) fix(canvas): emit successful control results in JSON mode (#117297) fix(imessage): settle native inbound reply delivery (#117282) fix(agents): reject invalid UTF-8 LSP responses (#117271) fix(line): centralize card and template message alt text (#117280) fix(release): validate candidates before Docker publication (#117252) fix(media): validate provider-owned generated media downloads (#117281) fix(feishu): restore custom HTTPS API domains (#117278) fix(models): reuse prepared plugin metadata (#117131) fix(agents): stop fallback after delivered-but-failed attempts (#114628) fix(memory): reuse targeted session corpus snapshot (#117247) fix(matrix): reconcile durable sends after response loss test(release): repair full validation regressions (#116931) fix(linux-canvas): report socket watcher fallback (#109502) fix(codex): preserve authoritative turn completion (#117185) fix(canvas): preserve widgets across derived-name collisions (#117132) fix(channels): config validation rejects documented channels.<id>.configWrites on 13 channels (#117206) fix(msteams): prevent duplicate final replies (#116398) fix(doctor): session SQLite restore installs an empty session index over the valid archive (#117221) fix(plugins): preserve workspace plugins across CLI and control UI (#117265) ...
* origin/main: (41 commits) test(ci): update memory helper routing expectation (openclaw#117295) fix(canvas): emit successful control results in JSON mode (openclaw#117297) fix(imessage): settle native inbound reply delivery (openclaw#117282) fix(agents): reject invalid UTF-8 LSP responses (openclaw#117271) fix(line): centralize card and template message alt text (openclaw#117280) fix(release): validate candidates before Docker publication (openclaw#117252) fix(media): validate provider-owned generated media downloads (openclaw#117281) fix(feishu): restore custom HTTPS API domains (openclaw#117278) fix(models): reuse prepared plugin metadata (openclaw#117131) fix(agents): stop fallback after delivered-but-failed attempts (openclaw#114628) fix(memory): reuse targeted session corpus snapshot (openclaw#117247) fix(matrix): reconcile durable sends after response loss test(release): repair full validation regressions (openclaw#116931) fix(linux-canvas): report socket watcher fallback (openclaw#109502) fix(codex): preserve authoritative turn completion (openclaw#117185) fix(canvas): preserve widgets across derived-name collisions (openclaw#117132) fix(channels): config validation rejects documented channels.<id>.configWrites on 13 channels (openclaw#117206) fix(msteams): prevent duplicate final replies (openclaw#116398) fix(doctor): session SQLite restore installs an empty session index over the valid archive (openclaw#117221) fix(plugins): preserve workspace plugins across CLI and control UI (openclaw#117265) ...
What Problem This Solves
Fixes an issue where operators running the Linux Canvas node host received no diagnostic when the desktop socket directory could not be watched. Canvas availability continued through periodic polling, but the loss of immediate filesystem notifications was completely silent.
Why This Change Was Made
The Linux Canvas plugin now reports both synchronous
fs.watch()setup failures and asynchronous watcher failures through the public plugin SDK logger, while preserving the existing one-second/proc/net/unixpolling fallback and cleanup behavior. This is limited to diagnostics for the existing degraded mode; it does not change Canvas availability policy, IPC behavior, configuration, or protocol shapes.User Impact
Linux operators can now see when Canvas socket monitoring has degraded to polling and diagnose missing directories, file-descriptor pressure, permission failures, or watcher backend failures without losing the existing fallback behavior.
Evidence
Real-machine before / premise / after / negative control
Environment: Linux x86_64, Node v24.18.0. The same exported production function was run on a real Linux filesystem from a detached latest-main worktree and the fixed worktree. A deliberately absent socket parent directory makes the operating system return a real
ENOENTfromfs.watch(); no filesystem API was mocked or replaced.node --import tsx --input-type=module -e 'import os from "node:os"; import path from "node:path"; import { watchLinuxCanvasSocket } from "./extensions/linux-canvas/src/socket-path.ts"; const socketPath = path.join(os.tmpdir(), `openclaw-missing-watch-${process.pid}`, "canvas.sock"); console.log(`PROOF socket_parent_exists=false path=${socketPath}`); const stop = watchLinuxCanvasSocket(socketPath, () => console.log("unexpected-change")); stop(); console.log("PROOF returned_cleanup_without_throw=true");'Negative control / before (
upstream/mainat510cf463300e596204738b7b1a62f56520306696):The real
fs.watch()failure is swallowed without any diagnostic. The cleanup contract still returns and does not throw.Premise: Node documents that
fs.watch()may throw when its underlying watcher is unavailable and that anFSWatcheris no longer usable after it emitserror: https://nodejs.org/api/fs.html#fswatchfilename-options-listener. The production caller already starts a one-second/proc/net/unixreconciliation timer afterwatchLinuxCanvasSocket()returns, so reporting the degraded state preserves the existing recovery owner instead of adding a second watcher or retry loop.After (
65e9414eb60516f5995a9c6bd9c085d2a1bf8018):The same real failure is now observable and explicitly names the active polling fallback, while the production function keeps its non-throwing cleanup behavior. The regression test separately drives the asynchronous
FSWatcher.errorcontract and verifies that it is reported too.Focused validation:
Full build and full typecheck were not run locally; fork GitHub Actions are expected to cover the wider repository gates. The Linux desktop Canvas UI was not exercised because this is a non-visual node-host diagnostic change; the affected production watcher path itself was exercised on a real Linux filesystem.
AI-assisted: Yes. I reviewed the complete watcher caller and cleanup path, the polling fallback, sibling watcher error handling, the public plugin SDK logger implementation, adjacent tests, Node's watcher contract, and the real-machine evidence.