-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Bug/1726 #1737
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.
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
base: main
Are you sure you want to change the base?
Bug/1726 #1737
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ import { | |
| type RuntimeMode, | ||
| type TurnId, | ||
| } from "@t3tools/contracts"; | ||
| import { Cache, Cause, Duration, Effect, Equal, Layer, Option, Schema, Stream } from "effect"; | ||
| import { Cache, Cause, Duration, Effect, Equal, FileSystem, Layer, Option, Result, Schema, Stream } from "effect"; | ||
| import { makeDrainableWorker } from "@t3tools/shared/DrainableWorker"; | ||
|
|
||
| import { resolveThreadWorkspaceCwd } from "../../checkpointing/Utils.ts"; | ||
|
|
@@ -256,6 +256,26 @@ const make = Effect.gen(function* () { | |
| projects: readModel.projects, | ||
| }); | ||
|
|
||
| // Validate that the workspace root exists before attempting to start a session | ||
| // This provides a clear error message when a project directory has been moved/deleted | ||
| if (effectiveCwd) { | ||
| const pathExists = yield* FileSystem.FileSystem.pipe( | ||
| Effect.flatMap((fs) => fs.stat(effectiveCwd)), | ||
| Effect.map(() => true), | ||
| Effect.catchTag("SystemError", (e) => | ||
| e.reason === "NotFound" ? Effect.succeed(false) : Effect.fail(e), | ||
| ), | ||
| Effect.result, | ||
| ); | ||
| if (Result.isFailure(pathExists) || pathExists.success === Option.none()) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Path validation never triggers due to wrong comparisonHigh Severity The condition Reviewed by Cursor Bugbot for commit b949ec7. Configure here. |
||
| return yield* new ProviderAdapterRequestError({ | ||
| provider: preferredProvider ?? "claudeAgent", | ||
| method: "thread.turn.start", | ||
| detail: `Project workspace path '${effectiveCwd}' no longer exists. The project directory may have been moved or deleted. Please recreate the project or select a different project.`, | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| const resolveActiveSession = (threadId: ThreadId) => | ||
| providerService | ||
| .listSessions() | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Critical
Layers/ProviderCommandReactor.ts:270When the workspace path does not exist,
Effect.succeed(false)creates aResult.Success(false), but the conditionpathExists.success === Option.none()never matches becausefalseis notOption.none(). The missing-path error is therefore never raised. Consider checkingResult.isSuccess(pathExists) && !pathExists.valueto detect the non-existent path case.Also found in 1 other location(s)
apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts:1705🤖 Copy this AI Prompt to have your agent fix this: