refactor: remove Waggle Room captured tasks for external coding agents

Waggle Room is not part of the community edition (decision Q2, ADR-0002).
Its headless runs of Claude Code, Codex, Hermes and OpenClaw needed the
packaged collaboration CLI from the removed @waggle/hive-mind-cli, so
POST /api/tools/run answered 503 collaboration_runtime_missing.

- Remove POST /api/tools/run (routes/external-tool-runs.ts) with its
  Room fan-out, WaggleDance publishing, OpenClaw provisioning and the
  memory write-back of run results.
- Remove runExternalTool (agent/external-tool-runner.ts) and
  resolveWaggleRuntime; the taskkill path helper moves into the process
  tracker, its only remaining user.
- Launcher: drop the hidden "Run task" composer, the Room hand-off and
  adapter.runExternalToolTask. Detect, launch, watch and stop stay.
- Drop the `room` flag from the memory feature map: it only gated the
  Launcher task button.
- The viewer policy no longer reads participants[].workspaceIds, a body
  shape only /api/tools/run accepted.
This commit is contained in:
shumeiko.it
2026-11-01 11:02:46 +01:00
parent 4d54612374
commit 94ad4446fb
20 changed files with 90 additions and 5389 deletions

View File

@@ -93,7 +93,6 @@ import { anthropicProxyRoutes } from './routes/anthropic-proxy.js';
import { taskRoutes } from './routes/tasks.js';
import { capabilitiesRoutes } from './routes/capabilities.js';
import { toolsRoutes } from './routes/tools.js';
import { externalToolRunRoutes } from './routes/external-tool-runs.js';
import { routeProposalRoutes } from './routes/route-proposals.js';
import { SignalBus } from './signal-bus.js';
import { commandRoutes } from './routes/commands.js';
@@ -1950,7 +1949,6 @@ export async function buildLocalServer(config: Partial<LocalConfig> = {}) {
await server.register(taskRoutes);
await server.register(capabilitiesRoutes);
await server.register(toolsRoutes);
await server.register(externalToolRunRoutes);
await server.register(routeProposalRoutes);
server.decorate('signalBus', new SignalBus());
await server.register(commandRoutes);

File diff suppressed because it is too large Load Diff

View File

@@ -529,10 +529,6 @@ function mutationWorkspaceIds(
return fallbackWorkspaceId ? [fallbackWorkspaceId] : [];
}
const participantWorkspaceIds = Array.isArray(body?.participants)
? body.participants.flatMap((participant) =>
stringArrayFields(asRecord(participant), ['workspaceIds']))
: [];
const bodyWorkspaceIds = stringFields(body, ['workspaceId', 'workspace', 'parentWorkspaceId']);
const directBodyWorkspaceIds = request.method === 'POST'
&& (routeUrl === '/api/cron' || routeUrl === '/api/automations')
@@ -543,7 +539,6 @@ function mutationWorkspaceIds(
...directBodyWorkspaceIds,
...stringFields(query, ['workspaceId', 'workspace']),
...stringArrayFields(body, ['workspaceIds']),
...participantWorkspaceIds,
...storedMutationWorkspaceIds(request, fastify, routeUrl),
...createdCronWorkspaceIds(body, fastify, routeUrl),
])];

View File

@@ -1,58 +0,0 @@
import { afterEach, describe, expect, it, vi } from 'vitest';
import Fastify from 'fastify';
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { AgentRunRegistry } from '../../src/local/agent-run-registry.js';
import { externalToolRunRoutes } from '../../src/local/routes/external-tool-runs.js';
const tempDirs: string[] = [];
afterEach(() => {
vi.restoreAllMocks();
for (const dir of tempDirs.splice(0)) fs.rmSync(dir, { recursive: true, force: true });
});
describe('external tool roadmap gate', () => {
it('rejects OpenClaw before workspace, run, or process side effects', async () => {
const dataDir = fs.mkdtempSync(path.join(os.tmpdir(), 'waggle-roadmap-tool-'));
tempDirs.push(dataDir);
const registry = new AgentRunRegistry(path.join(dataDir, 'agent-runs.json'));
const workspaceLookup = vi.fn();
const runner = vi.fn();
const server = Fastify({ logger: false });
server.decorate('agentRunRegistry', registry);
server.decorate('workspaceManager', { get: workspaceLookup } as never);
server.decorate('externalToolDetector', async () => ({
platform: 'win32',
detectedAt: new Date().toISOString(),
tools: [{
id: 'openclaw',
displayName: 'OpenClaw',
releaseStatus: 'supported',
launchable: true,
installed: true,
installedPath: 'C:\\tools\\openclaw.cmd',
version: 'test',
}],
}));
server.decorate('externalToolRunner', runner);
await server.register(externalToolRunRoutes);
const response = await server.inject({
method: 'POST',
url: '/api/tools/run',
payload: { toolId: 'openclaw', workspaceIds: ['alpha'], prompt: 'Do work' },
});
expect(response.statusCode).toBe(409);
expect(response.json()).toMatchObject({
error: 'tool_not_release_supported',
toolId: 'openclaw',
});
expect(workspaceLookup).not.toHaveBeenCalled();
expect(runner).not.toHaveBeenCalled();
expect(registry.snapshot().runs).toHaveLength(0);
await server.close();
});
});

File diff suppressed because it is too large Load Diff

View File

@@ -819,7 +819,6 @@ describe('Team viewer read-only enforcement', () => {
server.post('/api/agent-groups/:id/run', mutate);
server.post('/api/tools/launch', mutate);
server.post('/api/chat', mutate);
server.post('/api/tools/run', mutate);
server.post('/api/rooms', mutate);
server.post('/api/cron', mutate);
server.patch('/api/cron/:id', mutate);
@@ -1122,19 +1121,6 @@ describe('Team viewer read-only enforcement', () => {
},
},
},
{
label: 'nested participant workspaceIds array',
request: {
method: 'POST' as const,
url: '/api/tools/run',
payload: {
participants: [
{ toolId: 'codex', workspaceIds: ['member-workspace'] },
{ toolId: 'claude-code', workspaceIds: ['viewer-workspace'] },
],
},
},
},
])('rejects viewer mutation resolved from $label before the handler runs', async ({ request }) => {
const { server, getMutations } = await createViewerPolicyServer();
try {