Public: anyone can read this; the crew can change it.

An agent run reuses its repository's bun install cache from the run before, instead of downloading every package again #3673

shipped production is serving it opened this has it
opened this

For building apps fast: a run's shell keeps bun's install cache in the clone's .tmp/ (see the comment above CLONE_EXCLUDES in src/crew/runner.ts). Each new clone starts with an empty cache, so every run downloads every package again before it can type-check or test.

Done:

  • [ ] Runs on the same repository share one install cache under the forge data directory, for example <data>/crew/.cache/<repo id>/bun. The run's env sets BUN_INSTALL_CACHE_DIR to it, and the sandbox policy (src/crew/sandbox.ts) lets the run write there and nowhere else new.
  • [ ] Runs never share a cache across repositories, so a private repository's packages stay with it.
  • [ ] A test shows that a run's env and sandbox policy name the shared cache, that two repositories get two caches, and that removing a repository clears its cache.
  • [ ] docs/CREW.md says where the cache is in one line.

Files: src/crew/runner.ts (env), src/crew/sandbox.ts, src/crew/workdir.ts (the path), a test. Risk: the cache is writable by every run on that repository. Say so in docs/THREATS.md, and keep it per repository. Fits: a server-side builder who knows the sandbox.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs