Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

test: pin desktopCommands in skill/plugin action harness against cross-file mock leaks

3 months ago

1ab18ce
Authored
Cursor Agent7/1/2026, 11:57:36 PM
The skills-actions and plugin-actions store tests passed in isolation but
failed in the full desktop suite: earlier test files (e.g. backup-page.test.ts)
register mock.module('../src/lib/desktopCommands', ...) mocks that persist in
the shared bun test process. The leaked getWorkspaceServerStatus reports
{ running: true, url: 'ws://mock' }, so ensureServerRunning treated the fake
per-workspace server URLs (ws://source, ws://secondary, ws://management,
ws://selected) as stale and ran syncWorkspaceServerRunningUrl ->
markWorkspaceThreadsDisconnected, crashing on the threads-less harness state
('get().threads.filter' TypeError) or silently tearing down the fake JSON-RPC
sockets so expected catalog reads never happened.

Fix: the harness now installs its own desktopCommands mock replicating the
real module's bridge-unavailable behavior (status url: null, start/stop
throwing), installed at load and re-pinned in resetSkillPluginActionRuntime so
the second file to run re-establishes it after intervening files re-mock.

Co-authored-by: Max Weinbach <mweinbach@users.noreply.github.com>

Parent5912166

1 file changed
  • apps/desktop/test/skill-plugin-actions.harness.ts+35−0