feat: configure sparse repository checkout per intent - #450
Draft
ivancasco wants to merge 1 commit into
Draft
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.
Draft status: Fable 5.1 found two staging bugs in the current PR head. Fixes and regression tests pass locally, but the follow-up commit is not yet pushed because the configured 1Password signer failed. Keep this draft until that commit lands.
Large working trees can exhaust AgentCore's managed session storage before an intent starts. Add optional per-repository directory selection to the New Intent form and creation API. For example,
sparseCheckout: { "owner/monorepo": ["services/api", "packages/shared"] }checks out those directories using Git cone mode. Omitted or empty selections retain full checkout.The runtime clones with
--no-checkout, configures the cone before materializing files, and carries the immutable selection through stage restoration and parallel lane operations. Input validation rejects unknown repositories and unsafe paths. Tests cover real Git checkout, selected-file commits without deleting excluded files, warm reuse, mount-loss recovery, API validation, and UI submission.This mitigates #438; it does not fully resolve it. Git history is still downloaded in full, cone mode includes root/ancestor files, and the selected tree plus metadata and agent state must still fit in managed storage. Partial clone, larger storage, and broader storage-error reporting remain separate work.
Validation of the local follow-up (not yet pushed because 1Password commit signing failed):
GIT_CONFIG_GLOBALfiles,--maxWorkers=4, andGIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=commit.gpgsign GIT_CONFIG_VALUE_0=false(test-process-only override; temporary fixture commits otherwise wait on the local 1Password signer).--maxWorkers=4. The initial unrestricted run timed out in ToolsRegistry; that file also passes in isolation.action_required; CI/CodeQL is not claimed as passed. Optional local semgrep/opengrep scanners are not installed. No Terraform files changed.Independent review: Claude Fable 5.1 reviewed the complete diff and surrounding code. Two staging bugs were reproduced with real Git: committing new files outside the sparse cone, and concluding an out-of-cone merge conflict. Both are fixed locally with
git add -A --sparseand regression tests; the fix commit is pending successful signing. Leading/trailing whitespace in API directory selections is now rejected. Fable 5.1's focused follow-up confirmed the fixes and found no new concrete bug. Generic initialization-error wording and showing the immutable selection on the intent detail page remain follow-up improvements.