Skip to content

fix(agent): keep a run in its team, start nothing over a timed-out call, and ignore markers of deleted files - #2839

Merged
dylan-savage merged 4 commits into
feat/rocket-agent-browserfrom
feat/rocket-agent-team-timeout
Oct 28, 2026
Merged

dylan-savage merged 4 commits into
feat/rocket-agent-browserfrom
feat/rocket-agent-team-timeout

Conversation

@krishhgg

@krishhgg krishhgg commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Base: feat/rocket-agent-secrets (#2836). This is the third of eleven stacked PRs: #2835, #2836, this one, the four PRs split from #2840 (versioned writes, editor documents, the unsaved-changes dialog, the commit check), then the turn contract, limits and Undo, testing, and the eval runner. Each piece was redone on Rod's workspace fs layer, Dylan's stop work, #2853's tool approval, the read-only .rocketride/ guides and #2836's redaction, not cherry-picked.

Team switch mid-run

The bug. rocket-ui's workspace backend translated every path with the module-level activeScope, which Rod's onMutate announcement also reads. A write in flight during a team switch landed in the new team and overwrote its file.

The fix.

  • createWorkspaceBackend(scope) and the staged view's onMutate keep their own scope. activeScope stays only for raw binary reads and bus adoption.
  • createRocketAgentHost(client, ws) binds the host to one workspace and passes it to scaffoldApp and packAppSource, which default to the current one. After a switch, the host's devSession returns null.
  • The session file gains scopeKey. A turn in another team's conversation is refused: "This conversation belongs to team Acme; switch back to continue it."
  • The App Builder's listing save reads and writes the app's package.json in the workspace it started in (bug 6, below).

Late writes of the old run stage in the old team. The turn ends as stopped, since the bootstrap cleanup unmounts the agent tabs.

Timeout reorder

The bug. When a tool call timed out, the loop started the next call on the same file while the first still ran. The first could land last and erase the second.

The fix. runWave does not start a call on the same files as a call that timed out and still runs, from this wave or an earlier one, or as an earlier call in the wave that was held back that way. It gets "Not run: it waits for edit_file on apps/a.ts, which timed out and is still running." The held-back call is never prepared, so no approval card asks about it. Its outcome is unstarted, #2853's flag for a call whose work never began, so the finish record never hears of it. A call whose prepare failed or timed out, or whose act the user refused, holds nothing back, since nothing of it can land. When the timed-out call ends, the model gets a late entry with its result, and the result is stored under the entry's memory key.

Delete stuck

The bug. Monaco keeps a deleted file's model and markers, so check_app kept failing on a file the agent had deleted.

The fix.

  • appTypeEvidence drops markers on TypeScript files missing from the live file list and says "Ignored 1 marker for a file that no longer exists: src/unused.ts."
  • The dev session lets go of a deleted file's model (bug 4, below), so Monaco's TypeScript worker forgets the file and clears its markers.

On top of #2836

#2836 and this PR both change agent.ts, loop.ts, toolkits.test.ts and loop.test.ts. The restack keeps both behaviors.

Folded in

Bug 6: a listing save could write one team's package into another. saveListing in webHost.ts read the app's package.json, then wrote it through whatever workspace was current. With a slow read and a team switch in between, team A's package landed in team B, staged there in manual mode. The save now takes the current workspace when it starts and reads and writes through that view. writeAppPackage takes a view, as readAppPackage already did. Test: a listing save whose read ends after the team changes writes the package in the team it started in, in manual mode. It fails on the old saveListing.

Bug 4: a deleted file's model stayed in the dev session. When the session could not read a changed file, it kept the file's model, so the TypeScript worker kept its errors and the preview build kept the module. Now the session asks the view whether the path still exists. Only when the view says no, after a staged delete or a delete written through, does it let go of the model, the same way dispose() does: one reference per session, and the model is disposed with the last one. Any other read failure, such as a store error, keeps the model, as before. Test: a deleted file's model leaves the dev session, and a file the store failed to read keeps its model. It fails on the old catch and on a version that lets go on any failed read.

Review fixes from earlier rounds

Two reviews found eight more holes. Each fix has a test that fails on the version before it.

The first review found these four:

  • A preview fetch could write into the new team. The dev session read the package, icon and lock file through whatever workspace was current. A version lookup that ended after a switch wrote rr-lock.json into the new team. It now keeps the workspace it opened in.
  • Going back to a team could lose a late write. Returning built a second workspace over the same staging store. A late write staged in the first one, and the next edit rewrote the manifest without it. Now each team's workspace lives as long as the page and is reopened on return, with its cache dropped. A shared staging store alone would still leave two views that disagree in memory. The second review's first two fixes make this reuse safe.
  • Unmount could drop the scope stamp. A conversation saved before scopes got its stamp only in memory, and the chat never saves a turn that ends by unmount. Reopened in another team, it ran there. It now saves the stamp before the first model call.
  • A %20 in a file name could hide a real error. Monaco decodes it in a model's uri; the file list does not. The second review's last fix replaced this one.

The second review found these four:

  • Another tab's staged change could vanish on return. The kept workspace reused its layers without reading the staging manifest again. If another tab staged a file in that team meanwhile, the next save rewrote the manifest without it. A change another tab discarded came back the same way. Each manifest write now records a random rev. On return, the kept workspace is reused only when the manifest's rev is still the one its store last loaded or wrote. Otherwise a fresh build loads the manifest, as on a first visit. A manifest without a rev, from before this change, also gets a fresh build.
  • An old read could refill the reopened cache. A read that started before the switch could end after the user came back and saved, and put the older file in the cache. Later reads returned it. CachedVfs in packages/shell now counts changes per path. A read fills the cache only when nothing wrote, primed, invalidated, deleted or moved its path while it was on its way, and the whole cache was not dropped. It is the only shell change, and it leaves the staged view alone.
  • A late result named a memory key that held nothing. When a timed-out call ended, its entry named a key such as wave-1.late0, but the result was never stored there. memory.peek and {{memory.ref:...}} on that key failed. The loop now stores each late result under its key.
  • A deleted foo%2520bar.ts kept failing check_app. Its model is named foo%20bar.ts, and the first fix kept every marker whose name had a %. check_app now asks the marker source for the uri each live file's model would get. The Monaco source uses Uri.parse, as the dev session does, so the names match exactly and no % exception is needed.

Known limit: two tabs in one team, with no switch, still erase each other's staged changes, as on the base. Each tab's store writes the whole manifest from its own memory, and the rev is checked only on return. A check on every save would need a merge or a refusal, so it is left for later. When a return needs a fresh build, a late write of the old run is not kept, as on the base.

Fixes from review

Review found five more holes. Each fix has a test that fails on the commit before it.

  • A done could stand before the model read a late result. A timed-out call could end while the finish rule heard a done wave, after the loop had taken the calls that had ended. It no longer counted as running, so the done stood and the model never read how the call ended. unfinished() again counts every timed-out call until the loop hands over how it ended, as fix(agent): keep secrets out of the model in the browser agent #2836 did. Test: a call on the same file as one that timed out is not run, and done waits until the model reads how the first one ended, even when it ends as the finish rule hears a wave. Its hung edit ends inside the second wave's endWave.
  • A late result could go missing. A timed-out call that ended before the rest of its wave left late before the loop looked. The model got no late entry and no wave-N.lateI key, and the call held back behind it was never planned again. Now a call stays in late from the moment it is cut loose until the loop hands over how it ended. lateReturns() hides the result as an outcome is hidden, so the entry and memory both hold the hidden text. The late note now says "This call timed out and has now ended", since that can happen in the same wave. Test: a call that times out and ends before the rest of its wave still gets its late entry, redacted and stored under its key. The edit has a 10 ms limit and ends at 25 ms, and a read in the same wave takes 50 ms.
  • An old read could cache a file its folder lost. On a delete or rename of src, CachedVfs marked only src, so a read of src/a.ts still on its way cached the old file and later reads returned it. A read now fills the cache only when neither its path nor any folder above it changed. Test: a read still on its way does not cache its old copy once its file, a folder above it or the whole cache changed, one case for each change the cache checks.
  • A new file could run a deleted file's code. The shared emit cache is keyed by model uri and version. A deleted file's model was disposed, but its output stayed. A new model at the same path starts again at version 1, so the preview got the old JavaScript. The last release of a model now drops its uri's entries. Test: a deleted file's compiled output goes with its model, so a new file at its path is compiled again.
  • An emit on its way could put the old code back. If a file was deleted and made again while its emit was still with the worker, the old emit landed in the cache after the release cleared it. An emit whose model was released meanwhile is now returned uncached. Test: an emit still on its way when its file is deleted and made again does not cache the deleted file's output.

After the restack

  • A late result hides what the file tools hid. Since fix(agent): keep secrets out of the model in the browser agent #2836's review, every tool result shows a value the file tools hid as its marker, but a late entry went through redactText only, so it could show that value in full. Late returns now get the same hiding as an outcome, values first, then key shapes. The late-entry test above also returns a value only the .env read hid, and fails without this.

Built on #2853 and the guides

  • One flag for work that never started. feat(agent): ask before the browser agent's outward or irreversible actions #2853's unstarted marks a call whose work never began, and feat(agent): ask before the browser agent's outward or irreversible actions #2853 leaves such calls out of the finish record. A held-back call is unstarted too. A later call waits when an earlier one was held back, but not when it was refused or its prepare failed. That fact stays inside runWave as the call each held-back call waits for, not as a second flag.
  • Approvals and timeouts. A held-back call is never prepared, so it shows no card. An OK still uses no tool time, and a call let through after a long OK can still time out in its run and hold back the next call on its files.
  • Team binding with approvals. createRocketAgentHost(client, ws) keeps feat(agent): ask before the browser agent's outward or irreversible actions #2853's approval feed, one per page, and binds vfs, scopeKey, scaffold, pack and dev sessions to ws. The run's Approvals reads app names through the bound view. A delete approved after a team switch stages in the old team, and commits there on return.
  • The guides' tree. createWorkspaceBackend(scope) and toStorePath(path, scope) sit on the base's root table. Store roots translate into the backend's own scope; .rocketride/ reads come from the server's bundle in every team's workspace. A kept or reopened workspace is the same staged view, so its assertWritable still refuses guide changes before they stage.

Tests

The ordering explorations cover the orders of team switches, timeouts and approvals. A hand-written test stays only for what they cannot reach. Each fix line of this PR was reverted on its own (69 reverts), and each kept test fails on a revert that no other kept test or exploration fails on. Nine of the reverts fail no test; "Notes for Dylan" lists those lines and what each is for.

  • ordering.test.ts tries every order of up to six steps (start, release a store call, switch, time out). With this change, none of 78 orders erases a write. A second pass makes each edit ask for an OK first and adds an approve step. It also fails an order that asks for an OK while an edit's work is on its way. None of 112 orders fails. With the backend translating paths in the active scope, as on fix(agent): keep secrets out of the model in the browser agent #2836, 19 of 77 and 13 of 112 orders fail. Without the hold-back in a wave, 25 of 113 and 32 of 122 do.
  • fakeStore.harness.ts (new) is the fake store client that ordering.test.ts and workspace.test.ts share. A read or write of a watched path waits until the test releases it.
  • workspace.test.ts (new) runs rocket-ui's real workspace over that store for what the explorations cannot reach: the old team's change announcements, a scaffold after a switch, going back to a team (a late change kept, another tab's discard, files and the file list read again, an old read after a save), a read on its way through each change the cache checks, and the listing save. It also runs the dev session: its package, lock and icon reads and its lock write after a switch, its models and its emit cache.
  • loop.test.ts: a call held back by a timed-out call in its wave, in an earlier wave (and a call on another file that runs), or behind a held-back call. A done is sent back until the model has read how a timed-out call ended: with no calls, with calls that all worked, and when the call ends while the finish rule hears the wave. The late entry when the call ends before the rest of its wave, redacted and stored under its key. A timed-out prepare holds nothing back.
  • agent.test.ts (new): another team's conversation is refused by the team's name, and a conversation saved before scopes saves its team before the model or a pasted key is reached.
  • toolkits.test.ts: the errors of a deleted file are ignored and named, so the check passes, and the same errors fail it while the file exists. Each file is matched to its model by the name the editor gives it.

Dylan's review found several orders tested twice. The hand-written copies are gone: the write in flight at a switch, the timed-out edit in the real workspace, and the loop tests that pair an approval with a timeout. So are tests whose every revert another kept test fails, and two loop tests that pass on #2836, since they cover #2853's stop and OK clock. The preview's helper-level tests became one test that drives the dev session across a switch, since only that catches the session leaving its workspace out. Tests went from 1,863 to 1,208 added lines.

All 290 tests in ./builder shared:test pass but #2836's 2 known limits, which are marked todo. #2836 alone has 268, so this PR adds 22, down from 42.

The apps/shared, apps/rocket-ui and packages/shell type-checks pass, and so does ./builder rocket-ui:build. The changed test files type-check but for 3 errors that stagedFileSystem.test.ts already has on #2836. ESLint finds nothing new in the changed files, and Prettier is clean on every changed line.

Browser journeys

Both with an engine whose Python comes from this branch (release server-v3.5.0 binary, since no release matches the branch's C++), so chat sessions save.

  • build-pipeline, on this commit: passes 4 of 4. The turn ends on its own, writes pipelines/verify-chat.pipe, which the engine validates with no errors, and the final reply is saved in the session.
  • secrets, on this commit before the unfinished() fix, which changes only when a done is accepted: passes 14 of 14, sessions-saved included, so the checks on the saved sessions read real files. The fake key in a pipeline reaches the model only as a «secret:…» marker. A pasted key and a key sent mid-run reach no frame the page sent, no saved session and no catalog row, and both show as [redacted] in the user's own rows.

The team switch cannot be driven here: the OSS engine has one team. The ordering tests and the workspace tests cover it.

Notes for Dylan

  • These lines have no test, and each stays for what a user would see. The rev bookkeeping on a discard and on a load: going back after Discard all, or after a reload that restored staged changes, reuses the workspace and keeps a late write. isCurrent() waiting for the store's own manifest write: going back right after a save still reuses the workspace. In loop.ts, stopped() naming only calls still running; runWave holding files only for timed-out calls with no ending yet, so a call is not held back by one that has ended; and a late failure's error in its entry. A new conversation saves nothing before its first turn ends. A conversation from the user's own files is refused as "your personal workspace".
  • The listing save passes its view to the read too. A revert of that fails no test, because the read starts in the tick the view is taken; it keeps the read and the write on one view.
  • deps.ts and the preview session are yours. The change adds a last parameter with today's default to readAppPackage, writeAppPackage, readAppText, readAppImageDataUri and prepareDependencies. WebDevSession keeps the workspace from its constructor and passes it to those reads and to the lock write.
  • WebDevSession now keeps one content listener per path instead of a list, so it can let go of one model. dispose() goes through the same releaseModel. The last release of a model also drops its entries from the shared emit cache.
  • When a deleted file's model goes, the preview build drops the module too. An import of the deleted file then fails at link time, where before the preview kept running the old module.
  • webHost.ts binds only saveListing. Its other calls only read, and deploy already takes the workspace when it starts, through packAppSource's default.
  • A call held back by a timed-out call uses your unstarted flag, so the finish record never hears of it, as with a refused call.
  • In runLoop, a late entry is read before your READ_THE_USER check.
  • The session file gains scopeKey. The session saves a conversation from before scopes once more at its first turn, to record its team.
  • A turn ended by unmount still loses its own exchange, as on the base: only the chat's idle effect saves.
  • Stand-in pipelines are not keyed by scope. The pipeline reads no files, and the engine finds it by owner, project and source, so a scope in the local key alone would return the same task. Please key your replacement by scope.

Proved with: 288 of 290 shared tests (2 todo for #2836's limits), the ordering explorations (0 of 78 and 0 of 112 orders erase a write), a revert of each fix line, the three type-checks, the rocket-ui build, and the build-pipeline and secrets browser journeys passing every check on an engine built from this branch.

The stack

Eleven PRs, each on the one below it. Merge top-down: each PR squashes into the branch below it, starting with #2885 and ending with #2835 into feat/rocket-agent-browser. A top-down rehearsal in a scratch clone was clean at every step and ended on #2885's tree. Bottom-up also works if each next branch is first rebased onto the squashed base.

  1. fix(agent): let Wave read plan replies itself #2835 plan replies
  2. fix(agent): keep secrets out of the model in the browser agent #2836 secrets
  3. fix(agent): keep a run in its team, start nothing over a timed-out call, and ignore markers of deleted files #2839 team, timeouts and deleted files (this PR)
  4. fix(agent): give every file a version, so the agent and an editor cannot write over each other #2840 versioned writes
  5. fix(agent): keep one document per open file and pipeline, so splits, closed tabs and saves stay in step #2882 editor documents and the rename fix
  6. feat(agent): ask before the agent changes a file with unsaved changes, and stop the tool clock while the user answers #2883 unsaved-changes dialog and tool clock
  7. fix(agent): check a staged file against the copy the page read, so Commit all meets a teammate's change #2884 manual-mode commit check
  8. feat(agent): end each turn with a result card, let the agent ask the user, and stop only its own runs in Auto #2869 turn result, needs you and run ownership
  9. feat(agent): pause a turn at its step or cost limit, show its estimated cost, and undo its file changes #2873 step and cost limits, cost estimate, Undo
  10. feat(agent): check the browser agent end to end in a real browser, with a verify skill for each layer of the stack #2874 verify skill
  11. feat(agent): replay the browser agent's smoke scenarios in CI, from fresh recordings #2885 eval runner

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 2
  • develop
  • release/.*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the builder Node builder tooling and ./builder workflows label Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor
🤖 Internal: Discord sync marker

Auto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete.

@dylan-savage dylan-savage left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are 76% of this PR (1,875 lines for 337 lines of code), and several interleavings are tested twice: by the exhaustive runs in ordering.test.ts, then by hand in workspace.test.ts and loop.test.ts (the write in flight at a switch, the timed-out edit in the real workspace, the loop cases that pair an approval with a timeout). Keep one test per behaviour: the exploration for orders of switches, timeouts and approvals, and hand-written tests only for what it can't reach. Share one fake store between the two vfs test files and aim for about 1,200 test lines; doing this once at the top of the stack is fine if restacking costs too much.

Not blocking: land this only together with #2840. Until its versioned writes are in, the CachedVfs.fill change lets a stale read pass the write-through freshness gate, so one save can erase another. Separately, nothing holds a timed-out call that outlives its run against the next turn's edits.

@krishhgg

Copy link
Copy Markdown
Collaborator Author

Tests are down from +1,863 lines to +1,208, and from 42 tests to 23. I reverted each of the PR's fix lines on its own and kept a hand-written test only where it catches a revert the explorations miss. Every duplicate you named is gone. ordering.test.ts and workspace.test.ts share one fake store (fakeStore.harness.ts). Four fix lines have no test; the PR body names the behaviour each one keeps.

The revert pass also found a real bug. A call that ended while endWave was running could let the run finish before the model saw its result. unfinished() now counts every unreported late call. A late result also now hides the values the file tools hid, as #2836 does for every other tool result.

On your notes: this lands together with #2840, since the stack merges in one go. The timed-out call that outlives its run is on our follow-up list.

@dylan-savage dylan-savage left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. The trim is done, and both new fixes check out: unfinished() counting every unreported late call, and late results hidden like other tool results. Reverting either one fails its test.

@krishhgg
krishhgg force-pushed the feat/rocket-agent-team-timeout branch from 6dfcb2c to 651bef5 Compare October 28, 2026 19:22
Base automatically changed from feat/rocket-agent-secrets to fix/rocket-agent-plan-json October 28, 2026 20:06
Base automatically changed from fix/rocket-agent-plan-json to feat/rocket-agent-browser October 28, 2026 20:08
Krish Garg added 2 commits October 28, 2026 20:28
…ll, and ignore markers of deleted files

A tool call still running when the team changes lands in the team it started in.
A turn in another team's conversation is refused before anything runs.
A call on the same files as a timed-out call that still runs is not started, and the model hears when that call ends.
A late result is stored under its memory key redacted, as the model reads it.
check_app ignores type errors of TypeScript files that no longer exist, matching files by Monaco's own model uri.
Going back to a team reuses its workspace only if no other tab changed its staged state, and an old read cannot refill its cache.
A listing save reads and writes the app's package in the workspace it started in.
The dev session disposes a deleted file's model once the view confirms the deletion, and keeps it when a read only failed.
…t per behaviour, and cut comments to the why

The ordering explorations cover the orders of team switches, timeouts and
approvals. Each hand-written test left guards a fix line no other kept test
or exploration fails on when that line is reverted. Cut: the in-flight write
at a switch, the timed-out edit in the real workspace, the loop tests that
pair an approval with a timeout, and tests that pass on the base.

ordering.test.ts and workspace.test.ts now share FakeStore
(fakeStore.harness.ts). One cache test covers every change fill() checks.

unfinished() counts every call in late again, as on the base. A timed-out
call that ended while endWave ran, after lateReturns() took the calls that
had ended, let a done stand before the model read how it ended.

Where a revert passed every kept test, a test now fails on it: a deleted
file's markers let check_app pass, a done with calls waits for a late
result, going back to a team reads its files and file list again, and a
dev session reads its package, lock and icons and writes its lock in the
team it opened in after a switch.

A reopened workspace is no longer written back to builtByScope. The next
reopen gets the same workspace from the first entry.
A call that timed out reaches the model as a late entry once it ends. Its
result and error went through redactText only, so a value a read had hidden
showed in full there, while every other tool result shows its marker. Late
returns now go through the same hiding as an outcome, values first, then key
shapes.
@krishhgg
krishhgg force-pushed the feat/rocket-agent-team-timeout branch from 651bef5 to 91b5fb4 Compare October 28, 2026 20:29
…not write over each other (#2840)

* fix(agent): give every file a version, so the agent and an editor cannot write over each other

The agent read a file, the user saved it, and the agent's edit then landed
on the text it had read, so the save was gone. In manual mode Commit all,
the discards, a rollback and Undo also raced the writes called just before
them.

Every path in the staged view now has a version. A mutation counts when it
is called and then waits behind the path's earlier ones; a read waits for
them too, up to 60 s. A delete or rename also counts every path under it,
at both ends of a rename. A write that names an older version is refused
with StaleVersionError. Commit all, Undo, the discards and a rollback run
in call order, and a commit carries only what was staged before it was
called. Undo counts and holds its paths from its call, also those a commit
called before it retains only once it runs. A checkpoint runs after the
writes called before it and holds the ones called after it. A server read
that one of the view's own changes overtook is read again.

A switch to auto mode is refused while a staged save is on its way, as it
is while changes are staged. A staged write to a folder, or a rename onto
one, is refused before it stages anything. A staged rename stages its delete
and its write together and saves them in one store write, so the view never
keeps the delete without the write.

An invalidate keeps the cached copy it drops. A read that then takes in a
different server copy, or finds one a batch read cached, counts a version,
so an editor that loaded the old copy cannot save over a teammate's
change, and until a read does, the dropped copy guards the next save.

The agent's tools read and write at a version: write_file refuses a file
that changed since the read, edit_file applies to a changed file only when
its anchor still matches once, and each wave tells the model which files
someone else changed. The ordering harness gets the auto run with an
editor save, a teammate's change and a Reload, and three manual runs
without the dialog.

* fix(agent): count a save or Commit all once when the cached copy is dropped while its write is on its way

Going back to a team, or the agent's refused write, drops the cached copy.
When an editor's save or Commit all's write was still on its way, the read
after it took the write's own content in as a changed copy and counted a
second version. The editor's next save was then refused as changed on the
server, and a canvas save after a Reload was too. The dropped copy now
becomes the written content once the write lands, for a write-through save
and for each file Commit all writes.

* fix(agent): keep one document per open file and pipeline, so splits, closed tabs and saves stay in step (#2882)

Two splits of one file kept their own text and version, so a save from one
left the other behind and its next save was refused or wrote over the
first. A closed tab's unsaved text came back stale, and Ctrl+S and the close
dialog's Save skipped the version check.

A text file's text, version and save state now belong to a FileDocument
that every tab of the path shares and that outlives its last tab while the
text is unsaved. A pipeline's belong to a CanvasDocument that lives while
Documents holds it. Each document queues its saves; Reload, Overwrite and
closing the last tab drop the saves still waiting, which reject with
SaveDroppedError, so Save & Run and a publish stop. A refused save offers
Reload or Overwrite. The editors register their unsaved typing with the
view, so the agent's dirty guard and a rename see it: a rename over
unsaved changes is refused, also when it waited its turn behind a save or
Commit all, and it reads what the view stores. A rename from the sidebar
or the explorer closes the tabs of the file, or of the files under a folder,
while it runs and opens them on the new paths, so no typing lands on an old
path. Documents keeps typing that lands during a read or a write.

Co-authored-by: Krish Garg <krish.garg@rocketride.ai>

---------

Co-authored-by: Krish Garg <kg@g14-node1.tailb99b1b.ts.net>
Co-authored-by: Krish Garg <krish.garg@rocketride.ai>
@dylan-savage
dylan-savage merged commit c464228 into feat/rocket-agent-browser Oct 28, 2026
4 checks passed
@dylan-savage
dylan-savage deleted the feat/rocket-agent-team-timeout branch October 28, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builder Node builder tooling and ./builder workflows module:ui Chat UI and Dropper UI tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants