Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): scheduled tasks in a non-Git project folder run in the folder #34995

Closedjuliusmarmingewants to merge 2 commits intomain fromrefs/pull/34995/headopened View on GitHub

Showing 2 changed files with 48 additions and 8 deletions.

x
0 of 2 viewed, 2 left
36 additions and 0 deletionsapps/server/src/mcp/OrchestratorMcpService.test.tsModified
View file
@@ -3191,6 +3191,42 @@
+ it.effect("runs in the project folder when that folder is not a Git repository", () =>
+ Effect.gen(function* () {
+ const saved = yield* Ref.make<ReadonlyArray<ScheduledTask["workspaceStrategy"]>>([]);
+ const notARepository = (operation: string, cwd: string) =>
+ Effect.fail(
+ new GitCommandError({
+ operation,
+ command: "git",
+ cwd,
+ detail: "fatal: not a git repository (or any of the parent directories): .git",
+ reason: "not_a_repository",
+ }),
+ );
+ const mcp = yield* OrchestratorMcpService.OrchestratorMcpService.pipe(
+ Effect.provide(
+ service(
+ {
+ execute: (input) => notARepository(input.operation, input.cwd),
+ resolvePrimaryRemoteName: (cwd) => notARepository("resolvePrimaryRemoteName", cwd),
+ resolveDefaultBranchName: (cwd) => notARepository("resolveDefaultBranchName", cwd),
+ resolveCommit: ({ cwd }) => notARepository("resolveCommit", cwd),
+ },
+ saved,
+ { ...existing, threadId: ThreadId.make("thread:scheduled-base") },
+ ),
+ ),