feat: repository prebake for agent runtimes - #4070
Conversation
Soffi AI SummaryThis PR introduces a repository prebake system for AI agent runtimes, enabling agent run pods to start with pre-cloned Git repositories already available — eliminating cold-start cloning latency when AI coding agents (Claude, Gemini, Codex, etc.) spin up. The core idea: a new On the Go side, a new ChangesRepository prebake for agent runtimes
Updated: 2026-09-08 09:05 UTC |
Greptile SummaryThe PR adds OCI-backed repository prebaking for agent runtimes, allowing pods to copy matching repositories locally and expose other prebaked repositories as context.
Confidence Score: 4/5The requested-branch fallback should be fixed before merging because it can silently run an agent against the wrong checkout and pull-request base. A failed fetch or checkout on the new prebake path is converted to success, after which downstream configuration and prompts proceed as though the requested branch had been honored. Files Needing Attention: go/deployment-operator/pkg/agentrun-harness/environment/environment.go
|
| Filename | Overview |
|---|---|
| go/deployment-operator/pkg/agentrun-harness/environment/environment.go | Adds prebake copying and safe-directory setup, but silently continues on an explicitly requested branch when fetch or checkout fails. |
| go/deployment-operator/pkg/agentrun-harness/prebake/prebake.go | Implements manifest loading, path confinement, repository listing, and normalized URL matching with appropriate fallback behavior. |
| go/deployment-operator/internal/controller/agentrun_pod.go | Adds the repository image volume and read-only mounts to the intended agent-run containers. |
| go/deployment-operator/dockerfiles/repository-prebake/prebake.sh | Builds validated prebake layouts and sanitizes embedded HTTPS credentials before storing remotes and manifest entries. |
| go/deployment-operator/pkg/agentrun-harness/tool/v1/tool.go | Supplies available prebaked repositories to system prompt templates while tolerating missing or invalid manifests. |
Reviews (1): Last reviewed commit: "repository prebake for agent runtimes" | Re-trigger Greptile
…pository-prebake-for-agent-runtimes
…pository-prebake-for-agent-runtimes
…pository-prebake-for-agent-runtimes Co-authored-by: Cursor <cursoragent@cursor.com>
| } | ||
|
|
||
| klog.V(log.LogLevelInfo).InfoS("copying prebaked repository", "src", match.Dir, "dst", repoDirPath, "url", in.agentRun.Repository) | ||
| if err := exec.NewExecutable("cp", exec.WithArgs([]string{"-a", match.Dir, repoDirPath})).Run(context.Background()); err != nil { |
There was a problem hiding this comment.
There has to be a golang based way to do this right? better than shelling out to cp.
| return false, nil | ||
| } | ||
|
|
||
| if err := exec.NewExecutable("git", |
There was a problem hiding this comment.
this just copies the repo and configures the upstream, shouldn't we also pull it to grab new changes? It's highly likely it will lag origin, since people will build the prebake image on a cron.
(Doing a pull from a largely cloned repo is still way better than a fresh clone from 0)
There was a problem hiding this comment.
yes right, I've added updateFromOrigin method for it
…pository-prebake-for-agent-runtimes
Test Plan
Test environment: https://console.your-env.onplural.sh/
Checklist
Plural Flow: console