Let flows opt in to a lightweight (no full clone) coding-environment path
Why
dap_full_clone (!245841 (merged)) applies the full blobless clone uniformly to all Duo Agent Platform flows. API-only flows (e.g. the code review flow) pay the full-history clone cost on large repos like the monolith with no benefit.
We have already seen this regress before: a code review flow took ~10 minutes due to a deep clone, cut to under a minute by switching to a shallow clone (#573987 (closed)).
This follow-up came out of the discussion in !245841 (note_3573199762) and the surrounding thread.
What
- Add a per-flow declaration of coding-environment needs.
- Default = full coding environment. This is the safe default: we cannot assume a flow does not need a clone, so no flow should silently lose its coding environment.
- Flows explicitly opt in to the lightweight path (from the coding-environment perspective this is an opt-out; we word it as opt-in to the lightweight path to avoid confusion).
- Decide how many paths we actually need. The main question this issue should resolve:
- 2 paths: coding env (full clone) vs. no coding env (no clone, API-only), or
- 3 paths: full clone / shallow-lightweight clone / no clone — i.e. is there a flow that needs some local files but not full history, justifying keeping a shallow/lightweight path?
- Validate with the code review flow as the first flow to opt in to the no-coding-env path. @kinsingh confirmed that custom instructions are read directly from the default branch via API, so this flow likely needs no clone at all (note_3573199762). Verify the "small nuances" mentioned there hold up end-to-end.
Depends on
- Learnings from running
dap_full_cloneon.comfor a few days (the MR's own follow-up plan to make blobless the default and remove thedap_full_cloneflag + the legacy shallow-clone path).
References
- MR: !245841 (merged)
- Parent work item: #602558 (closed)
- Prior perf issue: #573987 (closed)