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 — fix(claude): fork history in the provider environment by tnfssc · Pull Request #15598 · pingdotgg/t3code

fix(claude): fork history in the provider environment #15598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tnfssc wants to merge 2 commits into pingdotgg:main from tnfssc:fix/claude-provider-history-env

Uh oh!

There was an error while loading. Please reload this page.

Closed

fix(claude): fork history in the provider environment #15598

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit Hold shift + click to select a range
c1310b2
fix(claude): fork history in the provider environment
tnfssc Oct 4, 2026
aeee9df
fix(claude): bound native history fork worker runtime
tnfssc Oct 4, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
fix(claude): bound native history fork worker runtime
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@tnfssc
tnfssc committed Oct 4, 2026
commit aeee9df0337bcfa35230e8cd69816815a54e648f

Some comments aren't visible on the classic Files Changed page.

There are no files selected for viewing

51 changes: 51 additions & 0 deletions 51 apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
ThreadId,
} from "@t3tools/contracts";
import { assert, describe, it } from "@effect/vitest";
import * as Clock from "effect/Clock";
import * as Context from "effect/Context";
import * as DateTime from "effect/DateTime";
import * as Deferred from "effect/Deferred";
Expand All @@ -45,6 +46,8 @@ import * as Schema from "effect/Schema";
import * as Scope from "effect/Scope";
import * as Stream from "effect/Stream";
import { Tool } from "effect/unstable/ai";
import { TestClock } from "effect/testing";
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
import { formatClaudeResumeCompactionQuestion } from "@t3tools/shared/claudeCompaction";
import { HostProcessPlatform } from "@t3tools/shared/hostProcess";
import { SpawnExecutableResolution } from "@t3tools/shared/shell";
Expand Down Expand Up @@ -1607,6 +1610,54 @@ describe("ClaudeAdapterV2 attachments", () => {
});

describe("ClaudeAdapterV2 native fork", () => {
it.effect("times out and terminates a stalled history worker", () =>
Effect.gen(function* () {
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
const spawned = yield* Deferred.make<ChildProcessSpawner.ChildProcessHandle>();
const stalledSpawner = {
...spawner,
spawn: () =>
Effect.gen(function* () {
const child = yield* spawner.spawn(
ChildProcess.make(process.execPath, ["-e", "setInterval(() => {}, 1000)"]),
);
yield* Deferred.succeed(spawned, child);
return child;
}),
};
const fork = yield* Effect.gen(function* () {
const runner = yield* ClaudeAdapterV2.ClaudeAgentSdkQueryRunner;
return yield* runner.forkSession({
environment: {},
sessionId: NodeCrypto.randomUUID(),
options: {},
threadId: ThreadId.make("fork-target"),
providerSessionId: ProviderSessionId.make("fork-session"),
});
}).pipe(
Effect.provide(ClaudeAdapterV2.claudeAgentSdkQueryRunnerLiveLayer),
Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, stalledSpawner),
Effect.provide(
Layer.succeed(ProviderEventLoggers.ProviderEventLoggers, {
native: undefined,
canonical: undefined,
}),
),
Effect.forkChild,
);
const child = yield* Deferred.await(spawned);
yield* TestClock.adjust("30 seconds");
const error = yield* Fiber.join(fork).pipe(
Effect.flip,
Effect.timeout("2 seconds"),
Effect.provideService(Clock.Clock, Clock.Clock.defaultValue()),
);
assert.equal(error.method, "forkSession");
assert.include(String(error.cause), "Timeout");
assert.equal(yield* child.isRunning, false);
}).pipe(Effect.provide(NodeServices.layer), Effect.scoped),
);

it.effect(
"forks history from the provider environment without changing the server environment",
() =>
Expand Down
1 change: 1 addition & 0 deletions 1 apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ export const claudeAgentSdkQueryRunnerLiveLayer: Layer.Layer<
return yield* decodeForkSessionResult(stdout.text);
}).pipe(
Effect.scoped,
Effect.timeout("30 seconds"),
Effect.mapError((cause) => queryRunnerError(cause, "forkSession")),
);
yield* logProtocolEvent({
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
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.