The workspace never updates a repo it has already cloned. /clone checks whether the destination exists, validates it is a usable worktree, and returns 409 repo-exists. There is no git fetch, pull, checkout, or reset anywhere in that path — verified against apps/workspace-agent/src/clone.ts at the currently pinned v0.113.2.
The gateway treats repo-exists as success and proceeds to run against whatever is on disk.
Why this matters here specifically
/workspace/repos is backed by the persistent Docker volume workspace-repos, so checkouts survive container recreation and redeploys. The workspace container is long-lived. Combined, a repo cloned once can serve every subsequent run for months at the commit it had on the day it was first cloned.
A mention run against a stale tree looks completely normal. The agent reads files, reasons about them, and answers confidently — about code that may be many commits behind main. Nothing in the reply signals which commit it was looking at.
What this is not
Worth separating from something that looks similar. v0.113.2's workspace image bakes OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true, and the upstream note mentions a cached VCS branch going stale. That cache is read only by GET /vcs and branch-mode GET /vcs/diff, neither of which the mention loop calls, so it is inert in this deployment — see apps/gateway/AGENTS.md.
That is a stale metadata cache. This is a stale working tree. Re-enabling file watching would not fetch anything; the two have nothing to do with each other beyond both being describable as "stale".
The hard part
A naive git pull before each run is wrong, because the tree is not guaranteed clean. A previous run's agent may have left uncommitted edits, and that is legitimate state — the brokered-push flow depends on an agent producing changes in the workspace.
So an update policy has to decide, at minimum:
- Dirty worktree. Fetch and leave it alone, stash, or refuse to run? Silently discarding an agent's uncommitted work would be worse than the staleness.
- Detached or non-default branch. A previous run may have switched branches. Does the policy force back to the default branch, or update in place?
- Timing. Per run, or on a schedule? Per run is fresher and costs a network round-trip on every mention.
- Failure mode. If a fetch fails — network, auth, rate limit — does the run proceed against the stale tree with a warning, or fail closed? Given the whole point is trusting what the agent read, a silent fall back to stale is the failure mode worth avoiding.
- Ownership.
/clone currently has one job and does it idempotently. Updating is a different operation and probably deserves its own endpoint rather than overloading clone's semantics.
Where it belongs
Almost certainly upstream in fro-bot/agent — clone.ts and the workspace executor live there, and any other deployment reusing a persistent repo volume has the identical exposure. This repo only pins the ref.
Filing it here to record the finding and the analysis. If the shape above is right, it should become an upstream issue with this repo tracking the version that fixes it.
Severity
Not urgent, but not cosmetic either. It degrades silently and in the direction of confident wrong answers, which is the worst way for something to degrade. Came out of the v0.93.1 → v0.113.2 verification pass (#1384).
The workspace never updates a repo it has already cloned.
/clonechecks whether the destination exists, validates it is a usable worktree, and returns409 repo-exists. There is nogit fetch,pull,checkout, orresetanywhere in that path — verified againstapps/workspace-agent/src/clone.tsat the currently pinnedv0.113.2.The gateway treats
repo-existsas success and proceeds to run against whatever is on disk.Why this matters here specifically
/workspace/reposis backed by the persistent Docker volumeworkspace-repos, so checkouts survive container recreation and redeploys. The workspace container is long-lived. Combined, a repo cloned once can serve every subsequent run for months at the commit it had on the day it was first cloned.A mention run against a stale tree looks completely normal. The agent reads files, reasons about them, and answers confidently — about code that may be many commits behind
main. Nothing in the reply signals which commit it was looking at.What this is not
Worth separating from something that looks similar.
v0.113.2's workspace image bakesOPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true, and the upstream note mentions a cached VCS branch going stale. That cache is read only byGET /vcsand branch-modeGET /vcs/diff, neither of which the mention loop calls, so it is inert in this deployment — seeapps/gateway/AGENTS.md.That is a stale metadata cache. This is a stale working tree. Re-enabling file watching would not fetch anything; the two have nothing to do with each other beyond both being describable as "stale".
The hard part
A naive
git pullbefore each run is wrong, because the tree is not guaranteed clean. A previous run's agent may have left uncommitted edits, and that is legitimate state — the brokered-push flow depends on an agent producing changes in the workspace.So an update policy has to decide, at minimum:
/clonecurrently has one job and does it idempotently. Updating is a different operation and probably deserves its own endpoint rather than overloading clone's semantics.Where it belongs
Almost certainly upstream in
fro-bot/agent—clone.tsand the workspace executor live there, and any other deployment reusing a persistent repo volume has the identical exposure. This repo only pins the ref.Filing it here to record the finding and the analysis. If the shape above is right, it should become an upstream issue with this repo tracking the version that fixes it.
Severity
Not urgent, but not cosmetic either. It degrades silently and in the direction of confident wrong answers, which is the worst way for something to degrade. Came out of the
v0.93.1→v0.113.2verification pass (#1384).