fix: harden worktree creation and improve subagent mode support#1889
fix: harden worktree creation and improve subagent mode support#1889mohammedahmed18 merged 4 commits intomainfrom
Conversation
- Make worktree creation mandatory by exiting on failure instead of silently skipping - Remove redundant git repo check from create_detached_worktree (caller handles it) - Skip duplicate optimization checks in subagent mode (same as LSP) - Log optimization results as markdown in subagent mode instead of Rich tree - Disable custom benchmark loop overrides for subagent runs - Downgrade Jest benchmarking failure logs from info to debug Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @mohammedahmed18's task in 2m 28s —— View job PR Review Summary
Prek ChecksClean — no ruff or formatting issues introduced by this PR. Mypy reports 174 pre-existing errors across 4 files (not caused by this PR). Code ReviewBug: if self.current_worktree:
return Failure("There is an existing worktree, Can't create more than one per function")The original code silently Minor: Since the success value is meaningless ( Minor: Removed helpful comment ( The comment explaining why LSP skips Duplicate DetectionNo duplicates detected. Last updated: 2026-03-25 |
|
LGTM. i have noticed the windows tests are a bit flaky. will investigate a bit. |
aseembits93
left a comment
There was a problem hiding this comment.
see if you could just return instead of sys.exit(). like here - https://github.com/codeflash-ai/codeflash/pull/1889/changes#diff-d242b27fa098f222741a48a7daa8e421433b4c5e19dd38512404cd000df144a0L489
Summary
setup_worktreeexits with an error instead of silently skipping when the git repo check fails or worktree creation returnsNone. This prevents optimizations from running in an invalid state.create_detached_worktree()— the caller inoptimizer.pyalready performs this check, so the parameter and duplicate logic were unnecessary.was_function_previously_optimizedchecks in subagent mode (same behavior as LSP), and render optimization result trees as markdown logs instead of Rich console output.pytest_min_loops/pytest_max_loops) for subagent runs — commented out pending further tuning.infotodebugto reduce noise.Test plan
🤖 Generated with Claude Code