GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(server): cover the adapter passing the instance environment to t… · pingdotgg/t3code@e2d337c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/orchestration-v2/Adapters
    • ClaudeAdapterV2.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
+75-1Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2191,6 +2191,7 @@ describe("ClaudeAdapterV2 background wake turns", () => {
21912191
readonly close?: (sdkMessages: Queue.Queue<SDKMessage>) => Effect.Effect<void>;
21922192
readonly interrupt?: Effect.Effect<void>;
21932193
readonly environment?: NodeJS.ProcessEnv;
2194+
readonly subagentLaunchToolUseId?: ClaudeAdapterV2.ClaudeAgentSdkQueryRunnerShape["subagentLaunchToolUseId"];
21942195
// A CLI process opened after the first streams from its own queue, so the
21952196
// first one can exit (Queue.shutdown) and a later turn can start another.
21962197
readonly freshQueueOnReopen?: boolean;
@@ -2291,7 +2292,7 @@ describe("ClaudeAdapterV2 background wake turns", () => {
22912292
};
22922293
}),
22932294
forkSession: () => Effect.die("unused forkSession"),
2294-
subagentLaunchToolUseId: () => Effect.succeed(null),
2295+
subagentLaunchToolUseId: options?.subagentLaunchToolUseId ?? (() => Effect.succeed(null)),
22952296
assertComplete: Effect.void,
22962297
},
22972298
});
@@ -2359,6 +2360,79 @@ describe("ClaudeAdapterV2 background wake turns", () => {
23592360
});
23602361
const makeWakeHarness = makeWakeHarnessWithOptions();
23612362

2363+
it.effect("looks up a resumed subagent's launch in the instance's environment", () =>
2364+
Effect.scoped(
2365+
Effect.gen(function* () {
2366+
const SEND = "toolu-instance-home-sendmessage";
2367+
const lookups: Array<ClaudeAdapterV2.ClaudeAgentSdkSubagentLookupInput> = [];
2368+
const harness = yield* makeWakeHarnessWithOptions({
2369+
environment: { CLAUDE_CONFIG_DIR: "/instance/claude-home" },
2370+
subagentLaunchToolUseId: (input) =>
2371+
Effect.sync(() => {
2372+
lookups.push(input);
2373+
return null;
2374+
}),
2375+
});
2376+
yield* harness.runtime.startTurn(
2377+
makeClaudeTestTurnInput({
2378+
threadId: harness.threadId,
2379+
providerThread: harness.providerThread,
2380+
now: yield* DateTime.now,
2381+
attemptId: RunAttemptId.make("attempt-claude-instance-home-resume"),
2382+
text: "Ask the auditor to check again.",
2383+
attachments: [],
2384+
}),
2385+
);
2386+
// A subagent launched before a restart: its SendMessage resume names
2387+
// a task this session never saw start.
2388+
yield* harness.offerAndWait(
2389+
claudeSdkFrame({
2390+
type: "assistant",
2391+
message: {
2392+
model: "claude-sonnet-4-6",
2393+
id: "msg_instance_home_sendmessage",
2394+
type: "message",
2395+
role: "assistant",
2396+
content: [
2397+
{
2398+
type: "tool_use",
2399+
id: SEND,
2400+
name: "SendMessage",
2401+
input: { to: "task-before-restart", message: "Check again." },
2402+
},
2403+
],
2404+
},
2405+
parent_tool_use_id: null,
2406+
uuid: "00000000-0000-4000-8000-000000002101",
2407+
session_id: WAKE_NATIVE_SESSION,
2408+
}),
2409+
);
2410+
yield* harness.offerAndWait(
2411+
claudeSdkFrame({
2412+
type: "system",
2413+
subtype: "task_started",
2414+
task_id: "task-before-restart",
2415+
tool_use_id: SEND,
2416+
description: "Audit recent commits",
2417+
is_backgrounded: true,
2418+
task_type: "local_agent",
2419+
prompt: "Check again.",
2420+
uuid: "00000000-0000-4000-8000-000000002102",
2421+
session_id: WAKE_NATIVE_SESSION,
2422+
}),
2423+
);
2424+
assert.deepEqual(
2425+
lookups.map((lookup) => lookup.environment?.CLAUDE_CONFIG_DIR),
2426+
["/instance/claude-home"],
2427+
);
2428+
}).pipe(
2429+
Effect.provide(
2430+
Layer.mergeAll(IdAllocator.layer, McpProviderSessions.layer, NodeServices.layer),
2431+
),
2432+
),
2433+
),
2434+
);
2435+
23622436
it.effect.each([
23632437
{ isError: false, title: "Check weather" },
23642438
{ isError: true, title: "Check weather" },

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.