Repository navigation
fix(conn-server): saved schedules survive a deleted base and a folder without Git, as T3 - #286
Merged
Merged
Conversation
… without Git, as T3 - A scheduled run launches its saved strategy, which can outlive its base branch. Its provisioning now falls back as T3's worktreeFallbackBase does: the remote's default branch (fetched), then the checked-out branch, then HEAD. A stale tracking ref is skipped when the fetch finds no branch. An interactive launch that names a missing base still fails. - A worktree strategy for a project whose folder is positively not a Git repository, Scratch included, is saved as root, as T3's upsert does. Runs apply the same rule to tasks saved earlier. A folder Git cannot read keeps its own error. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… broken repo keeps its worktree - The fallback for a missing base no longer reads `scheduledTaskId` from the request. The scheduler asks for it through `Engine::launch_thread_with`; every client launch passes `MissingBase::Fail`. - The remote default branch comes from `rev-parse --verify --symbolic-full-name refs/remotes/<remote>/HEAD`, as T3's `resolveDefaultBranchName` does. A dangling `origin/HEAD` now falls through to the checked-out commit. - The checkout probes in `conn_vcs::repo` stat the folder on `spawn_blocking`, not on the runtime thread. - `is_repository` matches "fatal: not a git repository" only at a line start, as T3's `probeWorkTree` does; T3's bad-config regression test is ported. A scheduled worktree strategy becomes `root` only in a plain folder: a `.git` entry that Git cannot read keeps the worktree. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… as T3 does - `is_plain_folder` walks the physical path, as Git's discovery does, up to the filesystem root. Only `NotFound` counts as no `.git`. A link inside a checkout to a plain folder now saves `root`; a link into an unreadable repository keeps `worktree`. - Local and remote status read only the primary remote's default branch, as T3's `resolvePrimaryDefaultBranchName`. Without one, `main` and `master` both count as the default. `default_branch_with` folds back into `default_branch`. - The unreadable-`.git` test asserts Git's view only when the fixture denies access, and a dangling `.git` link covers it on every runner. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # apps/conn-server/crates/conn-features/src/scheduled/mod.rs
# Conflicts: # apps/conn-server/crates/conn-vcs/tests/repos.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pass 8 regressions 8.1 and 8.2. Both stopped saved automations from starting. Recorded at 9017c1b against the customized T3 server.
8.1: a saved schedule fails after its base branch is deleted. T3 provisions a scheduled run's saved strategy through
worktreeFallbackBase. Rust passed the dead ref togit worktree add, which failed with "not a valid object name".conn-vcs(setup::provision). A newMissingBasemode falls back the way T3 does: the remote's default branch (fetched), then the checked-out branch, thenHEAD. A completed fetch that finds no branch skips a stale tracking ref. A:/commit search and-keep their meaning.conn-engineasks for the fallback only for a launch that carries a scheduled task's message (initialMessage.scheduledTaskId). Interactive and delegated launches keepFail. T3 checks only those launches up front (checkWorktreeBase), and Rust has no such pre-check, so this keeps their failure.ThreadLaunchServicecases (re-base on the remote default, keep a:/search, skip a stale tracking ref), plus a valid local base and a refused interactive launch. All run on real repositories.8.2: a worktree schedule in a folder without Git fails. T3's
upsertsavesrootwhen the project is Scratch or positively non-Git. Rust savedworktree, and the run failed with "not a git repository".conn-features. A newTaskRunner::is_non_git_projectresolves the project through the engine: its shell snapshot,projects.isScratchRoot, and the existingcheckpoint::is_repository. Only Git's "not a git repository" counts, so a folder Git cannot read keeps its own error.upsertsavesroot, as T3 does. Runs apply the same rule to tasks saved earlier, which the review asked for. T3 itself does not do this at run time.Runtime proof. The review's probe ran on the fixed server.
thread:scheduled-task:schedule-base:…:manual. The worktree is at6538f875…, which is remotebeta. Local HEAD is527be8a0….nonGit: "root", runsucceeded, bound thread present. The real repository keptworktree.obsolete-basestill fails.Round 2 (merge gate).
is_plain_foldercanonicalizes the path, then walks up to the filesystem root, and onlyNotFoundcounts as no.git. A link inside a checkout to a plain folder savesroot; a link from outside into an unreadable repository keepsworktreeand Git's error.resolvePrimaryDefaultBranchName. Withorigin/HEADpointing at a deletedorigin/master, a checked-outmasteris the default (isDefaultRef: true,aheadOfDefaultCount: 0), as ismain..gittest checks Git's view only when the fixture denies access (root on Linux reads it). A dangling.gitlink covers the case on every runner.a_symlinked_project_saves_and_runs_the_strategy_of_the_folder_git_sees(conn-features) andeither_conventional_branch_is_the_default_without_a_remote_default(conn-vcs) fail one9a9255726and pass now.Overlap: #262 rewrites the
WorktreeRequestconstruction inconn-engine/src/engine.rs, and #274 changes theTaskRunnertrait and the testFake. Each conflict is one added line next to theirs.Merge notes: a trial merge with #274 conflicts in
scheduled/mod.rsandscheduled/tests.rs. Keep #274'sRunEndchanges and #286's non-Git probe (is_non_git_project, the asyncnon_gitfield of the testFake).Checks:
cargo fmt --check; clippy--workspace --all-targets -D warnings; tests for conn-vcs, conn-features, conn-engine, conn-mcp and conn-server. Round 2: fmt, clippy--all-targets -D warningsand tests for conn-vcs, conn-engine and conn-features.Claude Opus 5.5, Claude Code.
🤖 Generated with Claude Code
Follow-ups (non-blocking, from the latest review)
giton the server's PATH, a plain folder is not treated as non-Git; the TypeScript server treats a missing Git executable as outside a repository..gitancestor walk does not stop atGIT_CEILING_DIRECTORIES, so a.gitabove the ceiling keepsworktree.