Repository navigation
Conversation
A chat whose worktree folder was deleted gets it back before its next turn, but only as a bare checkout: the project's copied files (.env and friends) and its setup never ran, so the agent started in a worktree that couldn't build or run. Recreation now copies the environment's untracked files again and starts the setup steps and setup Action in the (setup) terminal, like a new worktree. A setup that can't start is logged and the turn goes ahead. Inspired by: pingdotgg/t3code@e65b19d15e
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.
What T3 added
T3 Code (pingdotgg/t3code@e65b19d15e) now runs the project's setup scripts when it restores a thread's worktree that was removed outside the app. Before, the restored checkout was bare.
How Godspeed does it
Godspeed already recreates a chat's deleted worktree before its next turn (
DocHost::recreate_missing_worktree, PR #41). It had the same gap as T3: no copied files and no setup.WorktreeEnvironments::restore_setup(crates/engine/src/worktree_env.rs) copies the project environment's untracked files (copyrules) into the recreated checkout again. It then starts setup through the existinglaunch_setup: the environment's setup steps plus the project's setup Action, in the "(setup)" terminal.DocHost::restore_worktree_setupcalls it after a successful recreation. The project comes from the chat's project, or else from the worktree record. If setup fails to start, the failure is logged and the turn still runs, so a bad script never blocks the chat.launch_setupnow takes the worktree path instead of a wholeWorktree, because the path is all it ever used. Its two existing callers are updated.Tests
worktree_on_run::a_deleted_worktree_is_recreated_and_set_up_before_the_next_turnnow saves an environment with a.envcopy rule and a setup step. After the folder is deleted and the next turn runs, it checks that.envis back and that setup ran again. Without the fix the test fails because.envis missing.cargo build -p godspeed: ok.cargo check --workspace --tests: ok.cargo test -p zeron-engine --no-fail-fast: 1176 passed, 3 failed.git_actions_gh pull_requests_and_publishing_go_through_ghandlocal_first local_runtime_checks_public_releases_without_starting_edge_links.delegation_notifications stopped_parent_keeps_notification_durable.... It passes when run alone.No screenshots: this is an engine change and the GUI was not launched.
What to check by eye
In a project with a setup Action or a worktree environment, start a worktree chat and let setup finish. Delete the worktree folder in Finder, then send another message. The "(setup)" terminal should run again and copied files such as
.envshould be back.Also updates the T3 watch ledger (reviewed through t3code@2cc8e73014) and T3-GAPS.
🤖 Generated with Claude Code