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:
@@ -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
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user