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
Server crashes or orphans a recording when a session-registry write fails inside a recording event handler #207
A full disk or a briefly locked sessions.json (antivirus, OneDrive) can crash the whole MCP server, or leave an ffmpeg capture running that nothing can stop.
Evidence
src/tools/startRecording.ts:288-314: the ffmpeg child exit handler calls store.update, which calls persist(). persist() throws on writeFileSync errors (ENOSPC) and when renameWithRetry gives up after about 1 s of EPERM/EBUSY (src/utils/sessions.ts:195, 327-328). An exception in an EventEmitter handler is uncaught.
src/utils/events.ts:329 uses void done.finally(...). Its catch path at startRecording.ts:276 also calls store.update, so a rejection there is unhandled.
The process has no uncaughtException or unhandledRejection handler. When the server dies, the shutdown stopAll never runs and other recordings keep capturing until their cap.
startRecording.ts:260-262: store.create(record) runs after ffmpeg and the input logger have started. If it throws, the tool returns an error with no session id and no attachChild, and capture continues for up to maxDurationSec (default 1 h). Neither stop_recording nor shutdown can reach it.
Suggested approach
Wrap registry writes in event handlers in try/catch and log to stderr.
Add .catch on the finalizer chain.
Register the child for shutdown before writing the registry, and kill the child if store.create fails.
Add process-level handlers that run stopAll and log, so a crash never leaves captures running.
Done when
Unit tests: an injected persist failure in the exit handler does not crash the process, and a store.create failure kills the spawned child.
Activity
ci: release only after green CI and from the tag, pin actions, CodeQL…