[codex] Generalize sparse agent worktree inference#396
Merged
Conversation
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
Generalizes AgentHub's sparse checkout inference for launched agent worktrees so monorepo subdirectory starts no longer depend on hard-coded paths like
ios,android,ribbons, ortools/ios/SproutApp.The new flow infers a sparse owner path from project markers near
startPath, keeps repo-root launches as full checkouts, preserves explicitsparseProfileandfullCheckout, and includes tracked support paths such as.agents,.claude, and git hook support when present. Gradle support is included only when a Gradle marker is detected.Why
The previous implementation solved sparse checkout for one set of known monorepo layouts, but it did not cover generic layouts like
apps/iosandapps/android. That meant AgentHub could still materialize an entire monorepo when the desired agent launch path was only one app subtree.Validation
swift test --filter WorktreeManagementServiceTestspassed../scripts/test.shpassed the fast package gates throughAgentHubCLI,AgentHubGitHub,SimulatorPreview, andStorybook../scripts/test.shis not green due to unrelatedAgentHubCoreissues observed before PR creation:DiffAvailabilityServiceTests:Invalidate succeeds after the adaptive window elapsesexpectation failure.WebPreviewResolverLaunchOptionsTests:Has no static fallback when no HTML files existtimed out.The folder “Output” doesn’t exist.