What's the cache key for the Cloud Agent install/update script?

Hey there!

The cache isn’t keyed to the base branch, and there’s no “different branch means install re-runs” guarantee.

An environment/snapshot is scoped to the repo (plus your account/team or saved environment) and the Dockerfile contents, not the branch. So a snapshot built on one branch can be reused for an agent started from another branch of the same repo. The install (update) command re-runs when new code is pulled, not when the branch changes, so if a cached snapshot is reused and nothing new needs pulling, it can be skipped (which matches what you’re seeing).

Because it isn’t branch-scoped, manual tweaks during install/start can carry into an agent on a different branch. Two tips:

Put any branch/commit-conditional setup in the install script and keep it idempotent. It runs against the checked-out code, so it adapts per branch; manual changes won’t.

To force a clean rebuild, delete and recreate the saved environment: walkthrough here.