-
Notifications
You must be signed in to change notification settings - Fork 4.8k
feat: make worktree branch prefix configurable #3954
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?
Changes from all commits
1d17f67
7d63803
fd87f3b
2d40855
2091ae0
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 |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ import { | |
| TurnId, | ||
| type OrchestrationEvent, | ||
| type ProviderRuntimeEvent, | ||
| type ServerSettingsError, | ||
| type VcsStatusLocalResult, | ||
| } from "@t3tools/contracts"; | ||
| import * as Cause from "effect/Cause"; | ||
|
|
@@ -30,6 +31,7 @@ import * as CheckpointStore from "../../checkpointing/CheckpointStore.ts"; | |
| import { ProviderService } from "../../provider/Services/ProviderService.ts"; | ||
| import { CheckpointReactor, type CheckpointReactorShape } from "../Services/CheckpointReactor.ts"; | ||
| import { forkParked } from "../../serverActivation.ts"; | ||
| import { ServerSettingsService } from "../../serverSettings.ts"; | ||
| import { OrchestrationEngineService } from "../Services/OrchestrationEngine.ts"; | ||
| import { ProjectionSnapshotQuery } from "../Services/ProjectionSnapshotQuery.ts"; | ||
| import { RuntimeReceiptBus } from "../Services/RuntimeReceiptBus.ts"; | ||
|
|
@@ -88,6 +90,7 @@ const make = Effect.gen(function* () { | |
| const receiptBus = yield* RuntimeReceiptBus; | ||
| const workspaceEntries = yield* WorkspaceEntries.WorkspaceEntries; | ||
| const vcsStatusBroadcaster = yield* VcsStatusBroadcaster; | ||
| const serverSettingsService = yield* ServerSettingsService; | ||
|
|
||
| const appendRevertFailureActivity = (input: { | ||
| readonly threadId: ThreadId; | ||
|
|
@@ -568,14 +571,19 @@ const make = Effect.gen(function* () { | |
| readonly cwd: string; | ||
| readonly local: VcsStatusLocalResult; | ||
| }) { | ||
| // Detached HEAD has no branch to adopt; a temporary placeholder checkout | ||
| // means the first-turn auto-rename is still in flight — don't race it. | ||
| // Detached HEAD has no branch to adopt. | ||
| const checkedOutBranch = input.local.refName; | ||
| if (checkedOutBranch === null || isTemporaryWorktreeBranch(checkedOutBranch)) { | ||
| if (checkedOutBranch === null) { | ||
| return; | ||
| } | ||
|
|
||
| yield* Effect.gen(function* () { | ||
| // A temporary placeholder checkout means the first-turn auto-rename is | ||
| // still in flight — don't race it. | ||
| const { worktreeBranchPrefix } = yield* serverSettingsService.getSettings; | ||
| if (isTemporaryWorktreeBranch(checkedOutBranch, worktreeBranchPrefix)) { | ||
|
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. 🟡 Medium When a worktree created with Also found in 1 other location(s)
🤖 Copy this AI Prompt to have your agent fix this:
Author
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. Acknowledged, but leaving this as is. The window requires the prefix setting to change between worktree creation and the first-turn rename, which is seconds on an active thread. If it does happen, the drift dispatch is a compare-and-swap on
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. Sorry, I'm unable to act on this request because you do not have permissions within this repository. |
||
| return; | ||
| } | ||
| const thread = yield* projectionSnapshotQuery | ||
| .getThreadShellById(input.threadId) | ||
| .pipe(Effect.map(Option.getOrUndefined)); | ||
|
|
@@ -585,7 +593,7 @@ const make = Effect.gen(function* () { | |
| thread.branch === checkedOutBranch || | ||
| thread.worktreePath === null || | ||
| thread.worktreePath !== input.cwd || | ||
| isTemporaryWorktreeBranch(thread.branch) | ||
| isTemporaryWorktreeBranch(thread.branch, worktreeBranchPrefix) | ||
| ) { | ||
| return; | ||
| } | ||
|
|
@@ -891,7 +899,10 @@ const make = Effect.gen(function* () { | |
| input: ReactorInput, | ||
| ): Effect.Effect< | ||
| void, | ||
| CheckpointStoreError | OrchestrationDispatchError | PlatformError.PlatformError, | ||
| | CheckpointStoreError | ||
| | OrchestrationDispatchError | ||
| | PlatformError.PlatformError | ||
| | ServerSettingsError, | ||
| never | ||
| > => | ||
| input.source === "domain" ? processDomainEvent(input.event) : processRuntimeEvent(input.event); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.