You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: add waitForRecording MCP tool for user-controlled takes - #1369
Add waitForRecording to the in-app MCP server so a client can wait while the user records and stops a take from the HUD. The call binds to the current recording ID, includes finalization and project saving, and returns the same recording result fields as stopRecording.
timeoutSec accepts 1–3600 seconds (default 300). Idle calls fail immediately. Timeout, request cancellation and HTTP disconnect release only the wait; they never stop the recording. Concurrent waits are independent. Cancelled, failed and superseded takes cannot be mistaken for a later take or an imported project.
The recorder reports terminal failures/discards, and the editor acknowledges the take after its duration and automatic-zoom saves. The main process reads the persisted project and checks its measured clip and nonempty media before completing waits. Completed client takes release their recorder claim so another startRecording works without an extra stop call.
Observation works with MCP edits off, behind the existing HTTP authentication and origin checks. No MCP notifications or command hooks are introduced. The stdio server registers an explanatory unsupported-tool response; clients observing the GUI must connect to the in-app HTTP server.
No visual UI changes. The scoped real-desktop attempt and its capture blocker are recorded in technical-documentation/testing/manual-e2e-checklist.md.
Testing
Tested locally on macOS 15.8 arm64, Node 22.22.1 / npm 10.9.4, based on upstream main d8bf2d81.
Targeted Vitest run: 191 tests passed across nine recorder, MCP, HTTP, import and native-stop suites.
npm run test: 4955 passed, 7 skipped; 354 suites passed, one skipped.
npx tsc --noEmit and npx tsc -p tsconfig.test.json --noEmit: passed.
Related-file npx biome check: passed without diagnostics. Full npm run lint and npm run lint:fix: exit 0, 26 existing warnings; no automatic changes.
npm run docs:check: passed (37 files). git diff --check: passed.
Regression coverage includes immediate completion after subscription, target isolation, concurrent waits, retry after timeout, already-aborted requests, MCP cancellation, HTTP disconnect cleanup, save/import failure, discard, persisted project/media readiness and reuse of the recording slot. Removing the recording ID guard makes the isolation regression fail; restoring it passes all 17 completion tests.
Real Electron 41.2.1 + authenticated HTTP MCP, isolated userData and ports (Vite 5188, MCP 47888, CDP 9388): idle waitForRecording returned HTTP 200 with isError: true in 679 ms.
Real recording remains unverified: computer-use selected Screen 1 and pressed Record on the HUD, which reported “Native macOS capture helper is not available.” The borrowed native directory has the compositor/ffmpeg but no capture helper, and npm run build:native:mac is blocked by the absence of full Xcode. Consequently, HUD recording → wait → manual stop → result and timeout during a real ongoing recording were skipped. Fixture/SDK/HTTP tests are not claimed as real capture validation. Windows/Linux desktop capture, webcam, transcription and export were not exercised.
The initial full run encountered an optional peer dependency missing after installation with the host's npm 11. Reinstalling with the repository's pinned Node/npm and including optional/peer dependencies restored @noble/hashes; the AppImage suite then passed all 14 tests, followed by the passing full run above. Package manifests and lockfile are unchanged.
Summary by CodeRabbit
New Features
Added an MCP tool to wait for an active recording to finish and become available in the editor, without starting or stopping capture.
Waits can time out or be cancelled without interrupting the recording.
Bug Fixes
Recording waits now report failures or discarded takes instead of leaving them unresolved.
Documentation
Updated MCP guidance and manual checks for recording waits, including timeout and cancellation behavior.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
📝 Walkthrough
The change adds an MCP tool that observes user-controlled recordings and returns their project and media details after editor saves complete. Recording outcomes are associated with recording IDs. Timeout and cancellation end the wait without stopping the recording.
The renderer reports failed or cancelled recordings and reports ready after the imported project meets save, duration, and auto-zoom conditions. The Electron API carries these outcomes.
Track take lifecycle and verify completion electron/mcp/recording-completion.ts, electron/ipc/handlers.ts, electron/mcp/app-recorder.ts, related tests
The main process tracks recording IDs and saved media, verifies the persisted project and media before completion, and releases an app-recorder take only for the matching ID.
The MCP server adds waitForRecording, which returns the shared recording result or an error. Tests and documentation cover idle waits, timeout, cancellation, and request disconnects.
sequenceDiagram
participant MCPClient
participant WaitForRecording
participant RecordingCompletion
participant RecordingImport
participant ElectronIPC
MCPClient->>WaitForRecording: Request waitForRecording
WaitForRecording->>RecordingCompletion: Wait with timeout and abort signal
RecordingImport->>ElectronIPC: Report ready after project saves
ElectronIPC->>RecordingCompletion: Verify project readiness for recording ID
RecordingCompletion-->>WaitForRecording: Return completed recording
WaitForRecording-->>MCPClient: Return project and take details
Loading
Merge Risk:⚪ Minimal · up to e06e6
The recording-wait change is ready to merge after normal checks. Real HUD capture remains unverified, but no current failure has been established.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 16 files. (3 skipped:…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely identifies the main change: adding the waitForRecording MCP tool for user-controlled recordings.
Description check
The description follows the repository template and provides a detailed summary, linked issue, change classification, release and desktop impact, screenshot information, and comprehensive testing resu…
Linked Issues check
Issue #1188 requests a way for an MCP client or script to detect that a user-controlled take ended and was saved. The PR adds the in-app HTTP waitForRecording tool. The tool observes the current rec…
Out of Scope Changes check
The changes stay connected to #1188. Recorder outcome reporting, recording-ID tracking, project/media readiness checks, and editor acknowledgements support reliable completion detection. Tests and arc…
Full details: Description check
Explanation
The description follows the repository template and provides a detailed summary, linked issue, change classification, release and desktop impact, screenshot information, and comprehensive testing results, including known real-recording limitations.
Full details: Linked Issues check
Explanation
Issue #1188 requests a way for an MCP client or script to detect that a user-controlled take ended and was saved. The PR adds the in-app HTTP waitForRecording tool. The tool observes the current recording, waits for finalization and project readiness, and returns the recording result. Recording IDs, failure states, cancellation, timeout, disconnect handling, and MCP-edits-off operation address the issue's stated use case. The reported automated tests cover completion, isolation, persistence, failure, cancellation, and reuse of the recording slot.
Full details: Out of Scope Changes check
Explanation
The changes stay connected to #1188. Recorder outcome reporting, recording-ID tracking, project/media readiness checks, and editor acknowledgements support reliable completion detection. Tests and architecture/testing documentation cover the new tool and its failure modes. The reported real-capture limitation does not show an unrelated code change.
Full details: Docstring Coverage
Explanation
Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 16 files. (3 skipped: 3 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
waitForRecordingto the in-app MCP server so a client can wait while the user records and stops a take from the HUD. The call binds to the current recording ID, includes finalization and project saving, and returns the same recording result fields asstopRecording.timeoutSecaccepts 1–3600 seconds (default 300). Idle calls fail immediately. Timeout, request cancellation and HTTP disconnect release only the wait; they never stop the recording. Concurrent waits are independent. Cancelled, failed and superseded takes cannot be mistaken for a later take or an imported project.The recorder reports terminal failures/discards, and the editor acknowledges the take after its duration and automatic-zoom saves. The main process reads the persisted project and checks its measured clip and nonempty media before completing waits. Completed client takes release their recorder claim so another
startRecordingworks without an extra stop call.Observation works with MCP edits off, behind the existing HTTP authentication and origin checks. No MCP notifications or command hooks are introduced. The stdio server registers an explanatory unsupported-tool response; clients observing the GUI must connect to the in-app HTTP server.
Related issue
Fixes #1188
Type of change
Release impact
Desktop impact
Screenshots / video
No visual UI changes. The scoped real-desktop attempt and its capture blocker are recorded in
technical-documentation/testing/manual-e2e-checklist.md.Testing
Tested locally on macOS 15.8 arm64, Node 22.22.1 / npm 10.9.4, based on upstream main
d8bf2d81.npm run test: 4955 passed, 7 skipped; 354 suites passed, one skipped.npx tsc --noEmitandnpx tsc -p tsconfig.test.json --noEmit: passed.npx biome check: passed without diagnostics. Fullnpm run lintandnpm run lint:fix: exit 0, 26 existing warnings; no automatic changes.npm run docs:check: passed (37 files).git diff --check: passed.waitForRecordingreturned HTTP 200 withisError: truein 679 ms.npm run build:native:macis blocked by the absence of full Xcode. Consequently, HUD recording → wait → manual stop → result and timeout during a real ongoing recording were skipped. Fixture/SDK/HTTP tests are not claimed as real capture validation. Windows/Linux desktop capture, webcam, transcription and export were not exercised.The initial full run encountered an optional peer dependency missing after installation with the host's npm 11. Reinstalling with the repository's pinned Node/npm and including optional/peer dependencies restored
@noble/hashes; the AppImage suite then passed all 14 tests, followed by the passing full run above. Package manifests and lockfile are unchanged.Summary by CodeRabbit