fix(orchestrator): hoist --force flag evaluation above TTY check#55
Merged
JacksonFergusonDev merged 1 commit intomainfrom Mar 15, 2026
Merged
Conversation
Previously, the `--force` flag was ignored during interactive terminal sessions because `sys.stdin.isatty()` was evaluated first, routing the execution flow directly to the questionary prompt. This commit hoists the `self.force` check to the top of the `_evaluate_collisions` method, ensuring the explicit CLI flag acts as an unconditional override for the merge strategy, regardless of the environment's interactive status.
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.
Overview
This PR fixes a control flow bug in
Orchestrator._evaluate_collisionswhere the--forceflag was being ignored if the command was executed in a standard interactive terminal.The Bug
When evaluating workspace collisions, the orchestrator checked for non-interactive environments (via
sys.stdin.isatty()andPYTEST_CURRENT_TEST) before evaluatingself.force. This meant that passing--forcein a normal terminal still dropped the user into the blocking TUI prompt, breaking automation scripts and fixture generation.The Fix
Hoisted the
self.forcecondition to be the first logic gate evaluated after collision targets are aggregated.--forceis True: Immediately defaults toCollisionStrategy.MERGEand returns.--forceis False: Falls through to the standard environment checks (aborting if non-interactive, prompting if interactive).Impact
Allows scripts to cleanly generate directory trees and fixtures using the CLI without hanging on the
questionaryprompt or requiring environment variable hacks.