fix: shared status/sync/manage from contained layout root#353
Merged
Conversation
When running `daft shared status` (or sync/manage) from the container root of a contained layout, `get_current_worktree_path()` fails because the container root is a bare repo with no working tree. Fix with two changes: 1. Fall back to `std::env::current_dir()` when not inside a worktree, so the command doesn't error out at the container root. 2. Use `resolve_config_root()` to locate `daft.yml` before passing the path to `read_shared_paths()`. The previous code passed the worktree path directly, but `load_yaml_config_with_fallback` skips its project-root fallback when `project_root == worktree_root` — which is exactly the case at the container root. `resolve_config_root` has no such guard and reliably finds the config. Also fixes a latent bug in `run_sync`/`run_manage` where `resolve_config_root` was called but its result wasn't used for `read_shared_paths`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
daft shared status(andsync/manage) failing when run from the container root of a contained layoutcurrent_dir()whenget_current_worktree_path()fails (bare repo has no working tree)resolve_config_root()to reliably locatedaft.ymlbefore reading shared paths — fixes the case whereload_yaml_config_with_fallbackskips its project-root fallback when worktree path equals project rootrun_sync/run_managewhereresolve_config_rootwas called but its result wasn't passed toread_shared_pathsFixes #353
Test plan
shared/status-from-container-rootdaft shared statusfrom contained layout root🤖 Generated with Claude Code