refactor: launch external tools without Room credentials or hook settings
A Launcher launch still opens the tool in the active workspace's folder, tracks its process, streams observed output and stops it. What it no longer does: - set WAGGLE_SIGNAL_EMIT, WAGGLE_SIDECAR_URL, HIVE_MIND_DATA_DIR or the Room identity variables (WAGGLE_RUN_ID, WAGGLE_ROOM_ID, WAGGLE_DANCE_TEAM_ID, WAGGLE_SENDER_ID, WAGGLE_RUN_TOKEN). Only the removed coding-agent hooks and the WaggleDance CLI read them. The external-process allowlist now admits WAGGLE_WORKSPACE_ID alone; - issue a run credential. Run tokens existed for Room workers (the dance CLI and OpenClaw's model calls), so the registry's credential store, the middleware's run-token bearer on /v1/chat/completions and the proxy's per-run model scope go. While an agent run with a model is active, the proxy still serves only the session bearer. The run record that a launch creates in the agent-run registry stays: it backs cancel from the Room canvas, which this change does not remove.
This commit is contained in:
@@ -170,28 +170,6 @@ describe('AgentRunRegistry', () => {
|
||||
await expect(registry.control(first.id, 'cancel')).rejects.toThrow(/already cancelled/);
|
||||
});
|
||||
|
||||
it('issues ephemeral worker credentials and revokes them at terminal state', () => {
|
||||
const { registry, file } = createRegistry();
|
||||
const room = registry.createRoom({
|
||||
workspaceIds: ['alpha'], source: 'external_tool', title: 'External', task: 'Collaborate',
|
||||
});
|
||||
const worker = registry.createWorker({
|
||||
parentRunId: room.id, workspaceId: 'alpha', source: 'external_tool',
|
||||
executor: { kind: 'external_tool', toolId: 'codex' }, title: 'Codex', task: room.task,
|
||||
status: 'running',
|
||||
});
|
||||
|
||||
const token = registry.issueCredential(worker.id);
|
||||
expect(token.length).toBeGreaterThanOrEqual(32);
|
||||
expect(registry.authenticateCredential(token)?.id).toBe(worker.id);
|
||||
expect(registry.authenticateCredential('x'.repeat(43))).toBeUndefined();
|
||||
expect(fs.readFileSync(file, 'utf8')).not.toContain(token);
|
||||
|
||||
registry.update(worker.id, { status: 'completed' });
|
||||
expect(registry.authenticateCredential(token)).toBeUndefined();
|
||||
expect(() => registry.issueCredential(room.id)).toThrow(/Worker run not found/);
|
||||
});
|
||||
|
||||
it('marks internal work interrupted after restart and reconciles external pids separately', () => {
|
||||
const { registry, file } = createRegistry();
|
||||
const internalRoom = registry.createRoom({
|
||||
|
||||
Reference in New Issue
Block a user