Skip to content

Commit cf2ab03

Browse files
committed
test: align Swarm fixtures with main runtime context
1 parent bc0730d commit cf2ab03

2 files changed

Lines changed: 18 additions & 13 deletions

File tree

‎apps/desktop/src/main/__tests__/runtime-host-guest-ipc-preload.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import test from 'node:test';
2525
import { build } from 'esbuild';
2626
import { deferred } from '@maka/core/test-only/async-primitives';
2727
import type { DesktopSessionSummary, MakaBridge } from '../../preload/bridge-contract.js';
28-
import { normalizeSessionSummaryForDisplay } from '../../renderer/session-status-presentation.js';
28+
import { normalizeSessionSummaryForDisplay } from '../../renderer/application/contracts/session-status-presentation.js';
2929

3030
test('onboarding and workspace search never fan out Owner IPC to a ready Guest', async () => {
3131
const owner = {

‎packages/runtime-host/src/__tests__/fixtures/agent-graph-provider-scenario.ts‎

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,7 @@ export class AgentGraphProviderScenario {
4242
constructor(private readonly childResultText: string) {}
4343

4444
respond(body: Record<string, unknown>, reply: AgentGraphProviderReply): void {
45-
// The scenario follows user requests, not the Host's ephemeral environment snapshot.
46-
body = {
47-
...body,
48-
messages: (Array.isArray(body.messages) ? body.messages : []).filter(
49-
(message) =>
50-
!(
51-
message.role === 'user' &&
52-
typeof message.content === 'string' &&
53-
message.content.startsWith('Runtime Host environment for this turn')
54-
),
55-
),
56-
};
45+
body = withoutRuntimeHostEnvironment(body);
5746
const names = toolNames(body);
5847
// Read covers both files and the child's Session-scoped tool results.
5948
if (names.join(',') === 'Glob,Grep,Read') {
@@ -215,6 +204,7 @@ export class GatedSwarmProviderScenario {
215204
}
216205

217206
async respond(body: Record<string, unknown>, reply: AgentGraphProviderReply): Promise<void> {
207+
body = withoutRuntimeHostEnvironment(body);
218208
const names = toolNames(body);
219209
if (names.join(',') === 'Glob,Grep,Read') {
220210
const index = this.#childrenRequested++;
@@ -319,6 +309,21 @@ export class GatedSwarmProviderScenario {
319309
}
320310
}
321311

312+
function withoutRuntimeHostEnvironment(body: Record<string, unknown>): Record<string, unknown> {
313+
// The scenario follows user requests, not the Host's ephemeral environment snapshot.
314+
return {
315+
...body,
316+
messages: (Array.isArray(body.messages) ? body.messages : []).filter(
317+
(message) =>
318+
!(
319+
message.role === 'user' &&
320+
typeof message.content === 'string' &&
321+
message.content.startsWith('Runtime Host environment for this turn')
322+
),
323+
),
324+
};
325+
}
326+
322327
function toolNames(body: Record<string, unknown>): string[] {
323328
const tools = Array.isArray(body.tools) ? body.tools : [];
324329
return tools

0 commit comments

Comments
 (0)