Skip to content

fix(macos): stop cancelled Voice Wake timers - #116189

Merged
vincentkoc merged 1 commit into
mainfrom
perf-macos-runtime-profile-v15
Jul 30, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
perf-macos-runtime-profile-v15

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where cancelling or replacing Voice Wake work could leave delayed tasks running. Those stale tasks could later restart the recognizer or keep capture-monitor loops alive after the active Voice Wake operation had moved on.

Why This Change Was Made

Voice Wake delays now preserve task cancellation instead of swallowing it. Trigger-pause, pre-detect silence, capture monitoring, and recognizer restart all exit before performing stale runtime work when their task is cancelled.

User Impact

Voice Wake no longer lets superseded timers restart the microphone pipeline or continue monitor work in the background, reducing unnecessary runtime activity and avoiding stale recognizer transitions.

Evidence

  • swift test --package-path apps/macos --scratch-path apps/macos/.build-local --filter VoiceWakeRuntimeTests: 21 tests passed.
  • swiftformat --lint --config config/swiftformat ...: 0 files require formatting.
  • swiftlint lint --strict --config config/swiftlint.yml ...: 0 violations.
  • node scripts/check-changed.mjs -- CHANGELOG.md apps/macos/Sources/OpenClaw/VoiceWakeRuntime.swift apps/macos/Tests/OpenClawIPCTests/VoiceWakeRuntimeTests.swift: passed on Blacksmith Testbox; 211 tests passed, 37 skipped.
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base 859280ee11992d5ea4bd72a87d2e53640909de98: clean, no accepted/actionable findings, confidence 0.96.

AI-assisted; implementation and proof reviewed by the author.

@vincentkoc vincentkoc self-assigned this Jul 30, 2026
@openclaw-barnacle openclaw-barnacle Bot added the app: macos App: macos label Jul 30, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review July 30, 2026 02:48
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Jul 30, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 30, 2026
@clawsweeper

clawsweeper Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 10:52 PM ET / July 30, 2026, 02:52 UTC.

ClawSweeper review

What this changes

The PR makes macOS Voice Wake delayed tasks stop after cancellation so superseded timers cannot restart recognition or leave capture monitoring active.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this PR open for normal maintainer review. Current main still lets several Voice Wake delays continue after cancellation, while the proposed guard is focused, covered by a cancellation test, and does not introduce a compatibility, security, or configuration change.

Priority: P2
Reviewed head: 06c451e91692bf1f9d08af0f3cdfc87c81492c15

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused bug fix with clear source rationale and targeted regression coverage; remaining CI completion is normal review gating rather than a patch-quality defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a repository-member PR, so the external-contributor real-behavior-proof gate does not apply; the PR nevertheless provides focused test and changed-files validation evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a repository-member PR, so the external-contributor real-behavior-proof gate does not apply; the PR nevertheless provides focused test and changed-files validation evidence.
Evidence reviewed 5 items Current-main gap: The current-main Voice Wake runtime schedules trigger-only and pre-detect silence checks, the capture monitor loop, and recognizer restart with try? await Task.sleep; a cancellation resumes these paths without a boundary-level cancellation result.
Focused patch: The PR adds one delay helper that returns false on cancellation and applies it at all four delayed Voice Wake work boundaries before they perform stale runtime actions.
Regression coverage: The added focused test cancels an in-flight runtime delay and asserts that it reports cancellation rather than continuing.
Findings None None.
Security None None.

How this fits together

Voice Wake runs a macOS speech-recognition pipeline that schedules short silence, capture-monitoring, and restart delays around microphone capture. Those delayed tasks feed back into recognizer start/stop transitions and user voice-session handling.

flowchart LR
  A[Microphone and speech callbacks] --> B[Voice Wake runtime]
  B --> C[Delayed silence and restart tasks]
  C --> D{Task still active?}
  D -->|Yes| E[Capture or restart action]
  D -->|Cancelled| F[Exit without stale work]
  E --> G[Recognizer and voice session]
  F --> G
Loading

Before merge

  • Complete next step (P2) - A repository-member PR with the protected maintainer label should proceed through ordinary macOS code review and completion of its in-progress native checks; no narrow automated repair is identified.
Agent review details

Security

None.

PR surface

Docs +1, Other +23. Total +24 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 2 27 4 +23
Total 3 28 4 +24

Review metrics

None.

Technical review

Best possible solution:

Land the focused cancellation-aware delay handling after the macOS Swift check completes, preserving the existing Voice Wake lifecycle while ensuring replaced timers cannot perform stale work.

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

Yes, from source: current main swallows cancellation from delayed sleeps in the affected Voice Wake paths, and the PR adds a focused cancellation test. A live microphone reproduction was not needed to establish the stale-task mechanism.

Is this the best way to solve the issue?

Yes. Checking cancellation at each delay boundary is the narrowest maintainable fix because it prevents stale work before it re-enters the Voice Wake actor, rather than attempting to infer cancellation after recognizer state changes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 859280ee1199.

Labels

Label changes:

  • add P2: A stale Voice Wake timer can cause unnecessary microphone-pipeline activity or an incorrect recognizer transition, but the reported impact is bounded to the optional macOS Voice Wake flow.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a repository-member PR, so the external-contributor real-behavior-proof gate does not apply; the PR nevertheless provides focused test and changed-files validation evidence.

Label justifications:

  • P2: A stale Voice Wake timer can cause unnecessary microphone-pipeline activity or an incorrect recognizer transition, but the reported impact is bounded to the optional macOS Voice Wake flow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a repository-member PR, so the external-contributor real-behavior-proof gate does not apply; the PR nevertheless provides focused test and changed-files validation evidence.

Evidence

What I checked:

Likely related people:

  • vincentkoc: The PR author is a repository member, and release history credits this contributor on recent macOS and Voice Wake-adjacent maintenance; they are a likely informed reviewer for the active runtime behavior. (role: recent native-app and Voice Wake contributor; confidence: medium; commits: 06c451e91692; files: apps/macos/Sources/OpenClaw/VoiceWakeRuntime.swift, apps/macos/Tests/OpenClawIPCTests/VoiceWakeRuntimeTests.swift)
  • zoiks65: Release history credits this contributor for the trigger-only Voice Wake runtime behavior that shares the delayed trigger-pause path changed here. (role: earlier Voice Wake feature contributor; confidence: medium; files: apps/macos/Sources/OpenClaw/VoiceWakeRuntime.swift)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vincentkoc
vincentkoc merged commit 86d300a into main Jul 30, 2026
101 of 107 checks passed
@vincentkoc
vincentkoc deleted the perf-macos-runtime-profile-v15 branch July 30, 2026 02:55
vincentkoc added a commit to zhangguiping-xydt/openclaw that referenced this pull request Jul 30, 2026
* origin/main:
  fix(macos): stop canceled voice wake timers (openclaw#116189)
  fix(macos): coalesce location permission requests (openclaw#116183)
  fix(macos): guard remote tunnel restart ownership (openclaw#116172)
  fix(agents): throw CompactionError when summarization fails (openclaw#115500)
  fix(test): isolate ACP startup output stream (openclaw#116076)
  fix(agents): deny all tools when scheduled authority names a removed account (openclaw#115932)
  fix(test): stop collecting Vydra test helpers (openclaw#116139)
  fix(discord): preserve webhook deadline errors (openclaw#116155)
  fix(test): isolate Google embedding batch timeout (openclaw#116161)
  fix(cron): stop replaying old schedule slots after a cron job is edited (openclaw#115779)
  fix(plugins): report request timeouts for stalled response bodies (openclaw#116166)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

1 participant