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(server): surface a missing workspace folder instead of a spawn error by kakismash · Pull Request #5040 · pingdotgg/t3code

fix(server): surface a missing workspace folder instead of a spawn error #5040

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

Merged
juliusmarminge merged 3 commits into pingdotgg:main from kakismash:fix/provider-missing-workspace-error
Sep 5, 2026

Uh oh!

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

Merged

fix(server): surface a missing workspace folder instead of a spawn error #5040

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
3 commits
Select commit Hold shift + click to select a range
cf86947
fix(server): surface a missing workspace folder instead of a spawn error
kakismash Jul 30, 2026
0416d48
fix(server): require the workspace preflight path to be a directory
kakismash Jul 30, 2026
f2931a7
test(server): verify missing workspace diagnostics across session paths
juliusmarminge Sep 5, 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

There are no files selected for viewing

5 changes: 4 additions & 1 deletion 5 apps/server/integration/providerService.integration.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ const makeIntegrationFixture = (options?: { readonly analytics?: Layer.Layer<Ana
Layer.succeed(ProviderEventLoggers, NoOpProviderEventLoggers),
).pipe(Layer.provide(SqlitePersistenceMemory));

const layer = makeProviderServiceLive().pipe(Layer.provide(shared));
const layer = makeProviderServiceLive().pipe(
Layer.provide(NodeServices.layer),
Layer.provide(shared),
);

return {
cwd,
Expand Down
60 changes: 58 additions & 2 deletions 60 apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ import { afterEach, describe, expect, it, vi } from "vite-plus/test";

import { deriveServerPaths, ServerConfig } from "../../config.ts";
import { TextGenerationError } from "@t3tools/contracts";
import { ProviderAdapterRequestError } from "../../provider/Errors.ts";
import {
ProviderAdapterRequestError,
ProviderWorkspaceMissingError,
type ProviderServiceError,
} from "../../provider/Errors.ts";
import { OrchestrationEventStoreLive } from "../../persistence/Layers/OrchestrationEventStore.ts";
import { OrchestrationCommandReceiptRepositoryLive } from "../../persistence/Layers/OrchestrationCommandReceipts.ts";
import { SqlitePersistenceMemory } from "../../persistence/Layers/Sqlite.ts";
Expand Down Expand Up @@ -181,7 +185,7 @@ describe("ProviderCommandReactor", () => {
readonly stopSessionEffect?: () => Effect.Effect<void, ProviderAdapterRequestError>;
readonly startSessionEffect?: (
session: ProviderSession,
) => Effect.Effect<ProviderSession, ProviderAdapterRequestError>;
) => Effect.Effect<ProviderSession, ProviderServiceError>;
readonly tryHandlePromptCommandEffect?: ProviderAuthService["Service"]["tryHandlePromptCommand"];
}) {
const now = "2026-01-01T00:00:00.000Z";
Expand Down Expand Up @@ -1217,6 +1221,58 @@ describe("ProviderCommandReactor", () => {
}),
);

effectIt.effect("shows the missing workspace message without a provider stack trace", () =>
Effect.gen(function* () {
const attempted = yield* Deferred.make<void>();
const missingCwd = "/missing/project/worktree";
const missingWorkspace = new ProviderWorkspaceMissingError({
threadId: ThreadId.make("thread-1"),
cwd: missingCwd,
});
const harness = yield* Effect.promise(() =>
createHarness({
startSessionEffect: () =>
Deferred.succeed(attempted, undefined).pipe(
Effect.andThen(Effect.fail(missingWorkspace)),
),
}),
);

yield* harness.engine.dispatch({
type: "thread.turn.start",
commandId: CommandId.make("cmd-turn-start-missing-workspace"),
threadId: ThreadId.make("thread-1"),
message: {
messageId: asMessageId("user-message-missing-workspace"),
role: "user",
text: "continue",
attachments: [],
},
interactionMode: DEFAULT_PROVIDER_INTERACTION_MODE,
runtimeMode: "approval-required",
createdAt: "2026-01-01T00:00:00.000Z",
});
yield* Deferred.await(attempted);
yield* Effect.promise(() => harness.drain());

const thread = (yield* Effect.promise(() => harness.readModel())).threads.find(
(entry) => entry.id === ThreadId.make("thread-1"),
);
expect(thread?.session).toMatchObject({
status: "error",
activeTurnId: null,
lastError: missingWorkspace.message,
});
const failure = thread?.activities.find(
(activity) => activity.kind === "provider.turn.start.failed",
);
expect(failure?.payload).toMatchObject({ detail: missingWorkspace.message });
expect(harness.runtimeSessions).toEqual([]);
expect(harness.sendTurn).not.toHaveBeenCalled();
expect(yield* Effect.promise(() => harness.readPendingTurnStarts())).toEqual([]);
}),
);

effectIt.effect("settles a failed provider startup and allows a clean retry", () =>
Effect.gen(function* () {
let failStartup = true;
Expand Down
5 changes: 5 additions & 0 deletions 5 apps/server/src/orchestration/Layers/ProviderCommandReactor.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { increment, orchestrationEventsProcessedTotal } from "../../observabilit
import {
ProviderAdapterRequestError,
ProviderAdapterValidationError,
ProviderWorkspaceMissingError,
} from "../../provider/Errors.ts";
import type { ProviderServiceError } from "../../provider/Errors.ts";
import { TextGeneration } from "../../textGeneration/TextGeneration.ts";
Expand All @@ -56,6 +57,7 @@ import { VcsStatusBroadcaster } from "../../vcs/VcsStatusBroadcaster.ts";
import { GitWorkflowService } from "../../git/GitWorkflowService.ts";
const isProviderAdapterRequestError = Schema.is(ProviderAdapterRequestError);
const isProviderAdapterValidationError = Schema.is(ProviderAdapterValidationError);
const isProviderWorkspaceMissingError = Schema.is(ProviderWorkspaceMissingError);
const isProviderDriverKind = Schema.is(ProviderDriverKind);

type ProviderIntentEvent = Extract<
Expand Down Expand Up @@ -394,6 +396,9 @@ const make = Effect.gen(function* () {
if (isProviderAdapterValidationError(failReason?.error)) {
return failReason.error.issue;
}
if (isProviderWorkspaceMissingError(failReason?.error)) {
return failReason.error.message;
}
return Cause.pretty(cause);
};

Expand Down
17 changes: 17 additions & 0 deletions 17 apps/server/src/provider/Errors.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,22 @@ export class ProviderAdapterProcessError extends Schema.TaggedErrorClass<Provide
}
}

/**
* ProviderWorkspaceMissingError - The session's working directory no longer
* exists on disk, so no provider process can start in it.
*/
export class ProviderWorkspaceMissingError extends Schema.TaggedErrorClass<ProviderWorkspaceMissingError>()(
"ProviderWorkspaceMissingError",
{
threadId: Schema.String,
cwd: Schema.String,
},
) {
override get message(): string {
return `This thread's workspace folder no longer exists or is not a directory: ${this.cwd}. Restore the folder at this path before retrying.`;
}
}

/**
* ProviderValidationError - Invalid provider API input.
*/
Expand Down Expand Up @@ -197,6 +213,7 @@ export type ProviderAdapterError =
export type ProviderServiceError =
| ProviderValidationError
| ProviderUnsupportedError
| ProviderWorkspaceMissingError
| ProviderInstanceNotFoundError
| ProviderSessionNotFoundError
| ProviderSessionDirectoryPersistenceError
Expand Down
Loading
Oops, something went wrong.

Uh oh!

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

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.