Repository navigation
Closed
Labels
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p1Scheduled into the current or next milestone.type: fixSomething is broken and must behave the way it is documented.
Milestone
Description
Context
Fetching or checking out a reference repository under workspaces/ counts every file it touches against the turn's files_changed scope limit. One routine git fetch plus git checkout of a mid-sized repository is enough to pause an interactive turn.
workspaces/is the brain's writable, gitignored scratch for repositories and outputs (backends: the worker sandbox leaves no persistent writable place for scratch, workspaces or file outputs #1626; its writability checks areresolveWorkspacesMount,packages/ui-sdk/src/server/worker-sandbox.ts:470-481). Steering detection already treats it as outside the brain (packages/ui-server/src/brain/journal-steering.ts:73).- The scope monitor counts
turn.summary.changedPathsforfiles_changedwithout exception (packages/ui-server/src/brain/turn-scope.ts:78,:117,:192). Those paths come from the journal's observation of the whole brain, including ignored scratch.
Observed on a hosted 0.44.0 install.
- One interactive turn refreshed a shallow clone of a public repository under
workspaces/. It hitscope_capfiles_changed(limit 1000, observed 1152) and was frozen. The roadblock records about 22 minutes waiting at the cap. The model's in-flight tool call came back "interrupted: the session ended before this call's result was recorded", and the user had to send "Continue". - Another turn reported 817 changed files, about 815 of them from a
git checkout --detach origin/mainin the same kind of clone, while the turn changed nothing in the brain.
Decision (maintainer, 2026-11-09)
Exclude workspaces/ from files_changed. turn_bytes and the free-space floor remain the bounds on scratch growth. A separate workspace budget and a documented no were both rejected.
Scope
files_changedcounts only changed paths outsideworkspaces/. Use the same containment rule asjournal-steering.ts:73(isWithin), not a string prefix.turn_bytesand the free-space floor still countworkspaces/writes, unchanged.- The journal summary keeps reporting all changed paths. If useful, it reports the workspace count separately, so the turn disclosure stays honest about what was touched.
- Update the scope-limit paragraph in
docs/decisions/governed-writable-workers.mdand the governance policy reference (max_files_changed) to say the count excludesworkspaces/.
Out of scope
- The limits' values and defaults.
- Changing what the journal retains for workspace files.
- Any new policy key.
Acceptance criteria
- A governed turn that writes 1,500 files under
workspaces/and changes no brain file is not paused byfiles_changed. A turn-scope test proves it and fails before the change. - A turn that changes 1,001 brain files is still paused at a limit of 1,000.
- Workspace writes still count toward
turn_bytes, so a turn writing pastmax_bytes_writtenunderworkspaces/is still paused. A test proves it. - A path like
workspaces-old/x.md, outsideworkspaces/but sharing its prefix, still counts. A test proves it. - Mutation receipt: drop the exclusion, and the first criterion's test fails.
Verification
bun run test packages/ui-server/tests(turn-scope and ws-scope-caps cases).
Contract impact
None. This narrows what max_files_changed counts and documents it in the decision record and policy reference. No key, shape or tool changes.
Updated 2026-11-09: the decision recorded above replaced the open options. Scope and acceptance criteria now follow option 1.
Metadata
Metadata
Assignees
Labels
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p1Scheduled into the current or next milestone.type: fixSomething is broken and must behave the way it is documented.
Activity
schlessera commentedon Nov 9, 2026
Decision (maintainer, 2026-11-09): option 1.
files_changedexcludesworkspaces/.turn_bytesand the free-space floor remain the bounds on scratch growth. A separate workspace budget and keeping the count are rejected.The body now follows this ruling. The decision record's scope-limit paragraph and the policy reference are updated with the implementation. No contract change.
schlessera commentedon Nov 15, 2026
Claimed for implementation. Claim token:
claim-fde42a2b. Branch:fix/3793-workspaces-files-changed.Collisions: path collisions on docs/decisions/governed-writable-workers.md with draft PRs #4002, #4008, #4018, #4024 (doc paragraph only); closure collisions on turn-scope tests with #3622, #3806. None touch turn-scope.ts itself.
schlessera commentedon Nov 15, 2026
Delivered in #4025, squash
eb3c53ac296808291e4aded36c9e4aa65a7e8aaeon main (milestone 0.45.0).files_changednow counts only changed paths outsideworkspaces/, usingisWithincontainment, soworkspaces-old/still counts.turn_bytes, the free-space floor and the scope summary'schangedPathsstill include workspace writes.packages/ui-server/tests/turn-scope.test.tscover each case: 1,500 workspace files do not pause the turn; 1,001 brain paths pause it at 1,000; workspace bytes pause it onturn_bytes;workspaces-old/x.mdcounts. They failed before the change. Two mutation receipts are recorded: dropping the exclusion, and replacingisWithinwith a string prefix.scoperow ofdocs/supported-inputs.mdare updated.@internalonObservationobserver facts gainworkspacePaths.api-reportrecords that member because the journal's type is inferred, so the change is documented indocs/integration-contract/package-api.md. No wire, HTTP or policy shape changed.