Repository navigation
feat(agent): end each turn with a result card, let the agent ask the user, and stop only its own runs in Auto - #2869
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 2
Please check the settings in the CodeRabbit UI or the
|
🤖 Internal: Discord sync markerAuto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete. |
dylan-savage
left a comment
There was a problem hiding this comment.
- A message the user sent before seeing the question closes the needs-you request. If the user stops during the
ask_userwave, the turn shows only "Stopped" but keepsrequest(run.ts:811). If they type during the last wave, theneeds_inputexit (loop.ts:1160) skips therun.hear()thatdonedoes. Either way the next message reaches the model with(answering request …), and the card's buttons are disabled. Keeprequestonly onneeds_inputturns, and hear queued messages before ending onask_user, continuing asdonedoes withREAD_THE_USER. ChatMessage.cardandonCardActiononChatView/MessageListare new public shell props with no doc. Per AGENTS.md, add them todocs/agents/context/ROCKETRIDE_UI_COMPONENTS.mdandchat-view.entry.tsxin this PR.
Not blocking, but worth fixing too. The Ask card's "This conversation started it." skips the status read, so after token reuse it labels the user's run as the agent's.
85a4e05 to
d07faa8
Compare
4a7d660 to
8074fb3
Compare
|
Both fixed.
The Ask card label now uses the same status read as the Auto run step, so after token reuse it reads "Not confirmed as this conversation's run". The card's question and choices hide values the file tools hid, as the answer already does; its kind, outcome and ids are left alone. FileTracker's |
dylan-savage
left a comment
There was a problem hiding this comment.
Both fixes, the docs and the Ask label look good. Approving.
8e6f799 to
de7ca6e
Compare
8074fb3 to
791c40f
Compare
The turn's result card lists what the run changed, so FileTracker records each file's change (added, modified, deleted or renamed, and where a renamed file came from) and changes() lists them. A file the run created and then deleted is no change. A deleted file keeps its version, so a file the run only deleted is not read back as seen. The stored copy a delete is checked against stays with each read, write and rename.
…user, and stop only its own runs in Auto - runAgent, agent() and AgentSession.execute return a TurnResult: the outcome (done, needs_input, stopped, failed, incomplete), the files and checks, the usage and any needs-you request. Every turn ends once through execute, including a refused message, an error, Stop and an unmount. - The session file is version 2. It keeps the turns, linked to the rows that close them, and the runs the conversation started. A version 1 file loads with neither. Every saved field passes through redactText. - The shell's ChatMessage gains an optional `card`, and ChatView gains `onCardAction`. The Agent tab puts each turn's card under its row: links to the changed files, Open Variables, a button per choice, and Continue. - ask_user ends the turn as needs_input, as a question or a missing Variable. Only the user's next message answers the request. - terminate and restart ask first in Ask mode. In Auto they run only on a run this conversation started with use, after a fresh getTaskStatus matches the record and the scope. Any other run is refused, and the model is told to ask the user. - A turn running when the Agent tab unmounts is saved with its rows and a closing row (known bug 5). - A use refused because the pipeline is already running says how to run the edited version (known bug 14).
… the row card, and check the run on the Ask card A turn the user stopped in the wave that called ask_user kept its request. Its card said only "Stopped", yet the next message answered the question and disabled its buttons. Only a needs_input turn keeps its request now. A message the user sent during the wave that called ask_user stayed queued, then ran as its own turn and answered the question the user had not seen. The loop now takes such a message before it ends the turn. It drops the question, and the model reads the message and may ask again. ChatMessage.card and the onCardAction prop of ChatView and MessageList are documented in ROCKETRIDE_UI_COMPONENTS.md and the ChatView gallery entry. The Ask card for terminate and restart said "This conversation started it." from the run record alone. The engine gives a later run on the same project and source the same token, so the card could claim the user's run. It now reads the run's status first, as the Auto run step does.
de7ca6e to
ad93fd3
Compare
791c40f to
4df0253
Compare
…ed cost, and undo its file changes (#2873) * feat(agent): pause a turn at its step or cost limit, show its estimated cost, and undo its file changes - A turn takes at most 60 steps (waves) by default. At the limit the loop plans no more, answers with the best-effort summary, and the turn ends as needs_input with a continue request: the card says "Paused after 60 steps" and Continue starts a new turn with a fresh budget. Messages sent during the turn do not reset the count. Agent Step Limit in Settings changes it, and 0 turns it off. - A UsageMeter estimates each model request from characters, 4 to a token, priced from a dated table with one row for the stand-in's model (claude-sonnet-5, Anthropic's price page, read 2026-10-27). The prompt start is priced at the cache-write rate on a turn's first request, at the cache-read rate after, and as a write again after a gap over five minutes, only for a provider that caches it and a question that asks. - Before every model request, the retry after a pipeline restart and the best-effort summary included, the meter reserves the input estimate and an output allowance. A request that could pass the turn's cost limit is not sent, and the turn pauses with Continue. A failed request keeps its reservation. The limit is $2 per turn by default (Agent Cost Limit, 0 turns it off); a model with no price shows tokens and has no limit. - The bot row's meta line shows the estimate ("~$0.42 est."), and TurnResult.usage carries the tokens and the cost, marked estimated. - The latest turn's card has Undo for that turn's file changes. The file toolkit records, in memory only, each path's content at its first touch and the version and hash each agent change left. Undo checks every path first: no editor holds unsaved changes, the version is the agent's, no one else changed it between agent changes, and the stored content matches what the agent left (the server's copy afresh, or the staged content for a path still staged). Then every inverse starts in one block, through the versioned write. In manual mode a file the agent created and never committed has its staged entry dropped, so nothing stays pending. A note row says what Undo did, and the model reads it in the next turn. * fix(agent): say that the cost estimate and the cost limit leave out thinking The stand-in model request sends no thinking param, so Sonnet 5 thinks by default and bills it as output the browser never sees. The estimate counts only the reply text, so "~$X est." and the cost limit are lower bounds. The row's meta line now reads "~$X est., not counting thinking", and the cost limit setting says a turn can cost more than the limit. --------- Co-authored-by: Krish Garg <kg@g14-node1.tailb99b1b.ts.net>
…mmit all meets a teammate's change (#2884) * fix(agent): check a staged file against the copy the page read, so Commit all meets a teammate's change In manual mode a staged file's conflict anchor was a fresh server read taken when it was first staged. A teammate's change from before then became the anchor, so Commit all wrote over it. The anchor is now the copy the page read, so the commit meets a conflict. The view's prime records the path only: the dev preview primed what its batch read returned, unsaved typing included, and the cache then served it as the server's copy. The preview and teammate exploration covers both. Going back to a team drops the page's cached copies, so a delete the agent decided on before a switch away and back anchored on the server's copy after it, and Commit all deleted a teammate's change. The view's delete now takes an anchor, the hash of the stored copy the delete is based on. delete_file passes the copy the agent last read or wrote. Under unsaved typing that is the stored copy below the typing, which Discard mine brings back. The view checks the anchor in the delete's turn, against the same capture its tombstone records, so no copy read later can become the delete's anchor. In write-through mode it checks the server's copy. * feat(agent): end each turn with a result card, let the agent ask the user, and stop only its own runs in Auto (#2869) * refactor(agent): move FileTracker changes() here from the save-race PR The turn's result card lists what the run changed, so FileTracker records each file's change (added, modified, deleted or renamed, and where a renamed file came from) and changes() lists them. A file the run created and then deleted is no change. A deleted file keeps its version, so a file the run only deleted is not read back as seen. The stored copy a delete is checked against stays with each read, write and rename. * feat(agent): end each turn with a result card, let the agent ask the user, and stop only its own runs in Auto - runAgent, agent() and AgentSession.execute return a TurnResult: the outcome (done, needs_input, stopped, failed, incomplete), the files and checks, the usage and any needs-you request. Every turn ends once through execute, including a refused message, an error, Stop and an unmount. - The session file is version 2. It keeps the turns, linked to the rows that close them, and the runs the conversation started. A version 1 file loads with neither. Every saved field passes through redactText. - The shell's ChatMessage gains an optional `card`, and ChatView gains `onCardAction`. The Agent tab puts each turn's card under its row: links to the changed files, Open Variables, a button per choice, and Continue. - ask_user ends the turn as needs_input, as a question or a missing Variable. Only the user's next message answers the request. - terminate and restart ask first in Ask mode. In Auto they run only on a run this conversation started with use, after a fresh getTaskStatus matches the record and the scope. Any other run is refused, and the model is told to ask the user. - A turn running when the Agent tab unmounts is saved with its rows and a closing row (known bug 5). - A use refused because the pipeline is already running says how to run the edited version (known bug 14). * fix(agent): answer a needs-you request only after it showed, document the row card, and check the run on the Ask card A turn the user stopped in the wave that called ask_user kept its request. Its card said only "Stopped", yet the next message answered the question and disabled its buttons. Only a needs_input turn keeps its request now. A message the user sent during the wave that called ask_user stayed queued, then ran as its own turn and answered the question the user had not seen. The loop now takes such a message before it ends the turn. It drops the question, and the model reads the message and may ask again. ChatMessage.card and the onCardAction prop of ChatView and MessageList are documented in ROCKETRIDE_UI_COMPONENTS.md and the ChatView gallery entry. The Ask card for terminate and restart said "This conversation started it." from the run record alone. The engine gives a later run on the same project and source the same token, so the card could claim the user's run. It now reads the run's status first, as the Auto run step does. * feat(agent): pause a turn at its step or cost limit, show its estimated cost, and undo its file changes (#2873) * feat(agent): pause a turn at its step or cost limit, show its estimated cost, and undo its file changes - A turn takes at most 60 steps (waves) by default. At the limit the loop plans no more, answers with the best-effort summary, and the turn ends as needs_input with a continue request: the card says "Paused after 60 steps" and Continue starts a new turn with a fresh budget. Messages sent during the turn do not reset the count. Agent Step Limit in Settings changes it, and 0 turns it off. - A UsageMeter estimates each model request from characters, 4 to a token, priced from a dated table with one row for the stand-in's model (claude-sonnet-5, Anthropic's price page, read 2026-10-27). The prompt start is priced at the cache-write rate on a turn's first request, at the cache-read rate after, and as a write again after a gap over five minutes, only for a provider that caches it and a question that asks. - Before every model request, the retry after a pipeline restart and the best-effort summary included, the meter reserves the input estimate and an output allowance. A request that could pass the turn's cost limit is not sent, and the turn pauses with Continue. A failed request keeps its reservation. The limit is $2 per turn by default (Agent Cost Limit, 0 turns it off); a model with no price shows tokens and has no limit. - The bot row's meta line shows the estimate ("~$0.42 est."), and TurnResult.usage carries the tokens and the cost, marked estimated. - The latest turn's card has Undo for that turn's file changes. The file toolkit records, in memory only, each path's content at its first touch and the version and hash each agent change left. Undo checks every path first: no editor holds unsaved changes, the version is the agent's, no one else changed it between agent changes, and the stored content matches what the agent left (the server's copy afresh, or the staged content for a path still staged). Then every inverse starts in one block, through the versioned write. In manual mode a file the agent created and never committed has its staged entry dropped, so nothing stays pending. A note row says what Undo did, and the model reads it in the next turn. * fix(agent): say that the cost estimate and the cost limit leave out thinking The stand-in model request sends no thinking param, so Sonnet 5 thinks by default and bills it as output the browser never sees. The estimate counts only the reply text, so "~$X est." and the cost limit are lower bounds. The row's meta line now reads "~$X est., not counting thinking", and the cost limit setting says a turn can cost more than the limit. --------- Co-authored-by: Krish Garg <kg@g14-node1.tailb99b1b.ts.net> --------- Co-authored-by: Krish Garg <kg@g14-node1.tailb99b1b.ts.net> --------- Co-authored-by: Krish Garg <kg@g14-node1.tailb99b1b.ts.net>
…, and stop the tool clock while the user answers (#2883) * feat(agent): ask before the agent changes a file with unsaved changes, and stop the tool clock while the user answers When the agent wanted to change a file the user had unsaved changes in, the call was refused and the model told the user to save first. Now the user is asked: Save mine first, Discard mine or Keep mine, one dialog at a time. The open editors do what the user chose. A call's time limit stands still while the question is open, in its prepare and in its run. A call its tool refused before changing anything is unstarted, so the finish rule asks for no check. One in which the user's save landed or sent a write still counts as a change, even when that save or another editor's save then failed, since the file may have changed. A save that joins a Ctrl+S already on its way counts once it lands. Open questions close as Keep mine when the run ends or the user stops it. * test(agent): count a tab behind only by a failed write as the known limit, also after a later read With versioned writes, a read that takes a teammate's copy in counts it for the editor too. When that read waited for a write that then failed, the failure's count lands before the read and the editor misses only that one, while the file moves past the failure's version. The text tab exploration broke its not-stored rule in 3 such orders, where the tab shows the stored file. They now count under the known limit for a failed write, as the same order without the teammate's change already does. * fix(agent): show the unsaved-changes question below 1024 px, where the closed drawer is a hidden dialog Below 1024 px the shell's sidebar is a drawer. It stays in the page as a modal dialog, with `visibility: hidden` while it is closed. otherDialogOpen() counted it, so every question resolved unasked, and the agent was told to try again after the user closed a dialog they could not see. otherDialogOpen() now counts only dialogs that checkVisibility({ visibilityProperty: true }) reports visible. The call also passes the option's old name, checkVisibilityCSS, which Chrome 105 to 120 know instead. An open drawer still blocks the question. A browser without checkVisibility counts every dialog, as before, so a question never opens over another dialog. * fix(agent): check a staged file against the copy the page read, so Commit all meets a teammate's change (#2884) * fix(agent): check a staged file against the copy the page read, so Commit all meets a teammate's change In manual mode a staged file's conflict anchor was a fresh server read taken when it was first staged. A teammate's change from before then became the anchor, so Commit all wrote over it. The anchor is now the copy the page read, so the commit meets a conflict. The view's prime records the path only: the dev preview primed what its batch read returned, unsaved typing included, and the cache then served it as the server's copy. The preview and teammate exploration covers both. Going back to a team drops the page's cached copies, so a delete the agent decided on before a switch away and back anchored on the server's copy after it, and Commit all deleted a teammate's change. The view's delete now takes an anchor, the hash of the stored copy the delete is based on. delete_file passes the copy the agent last read or wrote. Under unsaved typing that is the stored copy below the typing, which Discard mine brings back. The view checks the anchor in the delete's turn, against the same capture its tombstone records, so no copy read later can become the delete's anchor. In write-through mode it checks the server's copy. * feat(agent): end each turn with a result card, let the agent ask the user, and stop only its own runs in Auto (#2869) * refactor(agent): move FileTracker changes() here from the save-race PR The turn's result card lists what the run changed, so FileTracker records each file's change (added, modified, deleted or renamed, and where a renamed file came from) and changes() lists them. A file the run created and then deleted is no change. A deleted file keeps its version, so a file the run only deleted is not read back as seen. The stored copy a delete is checked against stays with each read, write and rename. * feat(agent): end each turn with a result card, let the agent ask the user, and stop only its own runs in Auto - runAgent, agent() and AgentSession.execute return a TurnResult: the outcome (done, needs_input, stopped, failed, incomplete), the files and checks, the usage and any needs-you request. Every turn ends once through execute, including a refused message, an error, Stop and an unmount. - The session file is version 2. It keeps the turns, linked to the rows that close them, and the runs the conversation started. A version 1 file loads with neither. Every saved field passes through redactText. - The shell's ChatMessage gains an optional `card`, and ChatView gains `onCardAction`. The Agent tab puts each turn's card under its row: links to the changed files, Open Variables, a button per choice, and Continue. - ask_user ends the turn as needs_input, as a question or a missing Variable. Only the user's next message answers the request. - terminate and restart ask first in Ask mode. In Auto they run only on a run this conversation started with use, after a fresh getTaskStatus matches the record and the scope. Any other run is refused, and the model is told to ask the user. - A turn running when the Agent tab unmounts is saved with its rows and a closing row (known bug 5). - A use refused because the pipeline is already running says how to run the edited version (known bug 14). * fix(agent): answer a needs-you request only after it showed, document the row card, and check the run on the Ask card A turn the user stopped in the wave that called ask_user kept its request. Its card said only "Stopped", yet the next message answered the question and disabled its buttons. Only a needs_input turn keeps its request now. A message the user sent during the wave that called ask_user stayed queued, then ran as its own turn and answered the question the user had not seen. The loop now takes such a message before it ends the turn. It drops the question, and the model reads the message and may ask again. ChatMessage.card and the onCardAction prop of ChatView and MessageList are documented in ROCKETRIDE_UI_COMPONENTS.md and the ChatView gallery entry. The Ask card for terminate and restart said "This conversation started it." from the run record alone. The engine gives a later run on the same project and source the same token, so the card could claim the user's run. It now reads the run's status first, as the Auto run step does. * feat(agent): pause a turn at its step or cost limit, show its estimated cost, and undo its file changes (#2873) * feat(agent): pause a turn at its step or cost limit, show its estimated cost, and undo its file changes - A turn takes at most 60 steps (waves) by default. At the limit the loop plans no more, answers with the best-effort summary, and the turn ends as needs_input with a continue request: the card says "Paused after 60 steps" and Continue starts a new turn with a fresh budget. Messages sent during the turn do not reset the count. Agent Step Limit in Settings changes it, and 0 turns it off. - A UsageMeter estimates each model request from characters, 4 to a token, priced from a dated table with one row for the stand-in's model (claude-sonnet-5, Anthropic's price page, read 2026-10-27). The prompt start is priced at the cache-write rate on a turn's first request, at the cache-read rate after, and as a write again after a gap over five minutes, only for a provider that caches it and a question that asks. - Before every model request, the retry after a pipeline restart and the best-effort summary included, the meter reserves the input estimate and an output allowance. A request that could pass the turn's cost limit is not sent, and the turn pauses with Continue. A failed request keeps its reservation. The limit is $2 per turn by default (Agent Cost Limit, 0 turns it off); a model with no price shows tokens and has no limit. - The bot row's meta line shows the estimate ("~$0.42 est."), and TurnResult.usage carries the tokens and the cost, marked estimated. - The latest turn's card has Undo for that turn's file changes. The file toolkit records, in memory only, each path's content at its first touch and the version and hash each agent change left. Undo checks every path first: no editor holds unsaved changes, the version is the agent's, no one else changed it between agent changes, and the stored content matches what the agent left (the server's copy afresh, or the staged content for a path still staged). Then every inverse starts in one block, through the versioned write. In manual mode a file the agent created and never committed has its staged entry dropped, so nothing stays pending. A note row says what Undo did, and the model reads it in the next turn. * fix(agent): say that the cost estimate and the cost limit leave out thinking The stand-in model request sends no thinking param, so Sonnet 5 thinks by default and bills it as output the browser never sees. The estimate counts only the reply text, so "~$X est." and the cost limit are lower bounds. The row's meta line now reads "~$X est., not counting thinking", and the cost limit setting says a turn can cost more than the limit. --------- Co-authored-by: Krish Garg <kg@g14-node1.tailb99b1b.ts.net> --------- Co-authored-by: Krish Garg <kg@g14-node1.tailb99b1b.ts.net> --------- Co-authored-by: Krish Garg <kg@g14-node1.tailb99b1b.ts.net> --------- Co-authored-by: Krish Garg <kg@g14-node1.tailb99b1b.ts.net>
Before this, a turn ended with only its reply text. Nothing recorded what it changed or checked, so the chat couldn't show it and the next turn couldn't build on it. The agent had no way to stop and ask the user for something it needed, such as a missing Variable. A turn stopped by a team switch lost its transcript. And
terminatewas a free call: in any mode the agent could stop a run it didn't start, including a team's deployed run.Now every turn ends with a
TurnResultand a card on its last reply: what it changed, what it checked, and what it needs. The agent can end a turn by asking the user (ask_user), and the next message answers it. Terminate and restart ask in Ask mode. In Auto they act only on a run this conversation started, after a live check right before the call.Part of #2718: layer 8 of 11, on the commit check PR's branch
feat/rocket-agent-commit-check, the last of the four PRs split from #2840. Merge the stack top-down: each PR into the branch below it, down to #2835 intofeat/rocket-agent-browser. A bottom-up squash conflicts unless each next branch is rebased onto the squashed base first. The next layer, limits and Undo, builds on the result and the card added here.How a turn ends
runAgent,agent()andAgentSession.executenow return aTurnResult(turn.ts). Before,runAgentresolved with nothing, and the only record of a turn was its reply text.turnId,messageId,scopeKeyoutcome,reasondone(the finish rule took the answer),needs_input(ask_user),stopped(Stop, orunmounted),failed(the model failed, orrefusedfor a message the session would not run),incomplete(replies stayed unusable).finalText,errorfilesadded,modified,deletedorrenamed, and a rename's source. From the file tracker #2840 added, which also hears the filescreate_app's scaffold wrote.checksusagecoststays empty: the stand-in model call returns no token counts (known bug 15), and the next layer adds the estimate.request,runsStarted,undoAvailableEvery turn ends once, in
execute: a refused message, a model error, Stop and an unmount all leave a result. A model that fails before the turn gathered anything still throws, so the chat shows its error row, but the error carries the result.Session file version 2
The session file gains
turns, each linked to the id of the row that closes it, andrunsStarted. A turn is linked by position: its opening user row sits at the index of its history length, and its closing row is the first bot row after that which is not a thinking row. A version 1 file loads with no turns and no runs, so it owns no run. Rows, cards, turns and run records all pass throughredactTexton save. Run tokens stay readable, as #2836 keeps them for the model.The card
This is the one shell change.
ChatMessagegains an optionalcard(tone,title,lines,files,actions), andChatViewgainsonCardAction(messageId, action).MessageListdraws the card under its row with #2853's "Needs your OK" card styles. With no handler, its links and buttons are disabled. Approval cards are unchanged and stay on the turn, unsaved.ROCKETRIDE_UI_COMPONENTS.mdand the ChatView gallery entry documentcardandonCardAction.The Agent tab puts each turn's card on its row (
AgentSession.decorate), and saves it with the row:A file link opens the file the way the Explorer does (
AgentHost.openFile). Open Variables emitsshell:openOverlaywithenvironment. A choice or Continue sends its text as the user's reply. An error row shows its own banner, so it gets no card.Needs you
ask_user(toolkits/askUser.ts) ends the turn after its wave. The question is the turn's answer, and the outcome isneeds_input. The answer gets "Not checked" only when something the turn changed is still unchecked; a pipeline that validated on save needs nothing more.question, with up to 4 choices, each a button.variable, with aROCKETRIDE_name. The tool readsaccount.getEnvironmentKeys(names only), so the card says whether the name is set. It never says whether a key works.continueis defined for the next layer's limits, with a Continue button. The model cannot ask with it.Each request has an 8-character id. Only the user's next message answers it, typed or pressed, and the model reads "(answering request )" under it. A second press, a press after the reply, and a press after a typed reply do nothing, and the card shows its answers disabled.
A message the user sent before the question showed never answers it. If the user writes during the wave that called
ask_user, the loop takes the message before it ends the turn, drops the question, and the model reads the message and may ask again. Only aneeds_inputturn keeps its request, so a turn the user stopped in that wave, whose card says only "Stopped", has nothing to answer.Terminate and restart
terminateandrestartwere free. They are now ask rows inapproval.ts, with a rule for the run they name.ask_user, so the turn ends as needs-you.toolkits/runs.ts). Ausethat the engine answers withreused: falseis followed at once bygetTaskStatus(token), sinceusereturns no start time. The record keeps the token,project_id,sourceandstartTimefrom that read, the scope and the conversation. It lives in the session file. A reused run, a run whose status could not be read, and everydeploy.runstart are never recorded.project_idandsourcemust match the record, and the host's scope must still be the recorded one. Otherwise the call is refused. A restart refreshes the record from a status read afterwards.Known bugs folded in
detach). The session saves them at once, in the conversation's own team. When the stopped turn ends, the session adds a closing row ("Stopped by you: the Agent tab closed.", with the progress rows the chat showed), links the turn to it and saves again. React's dev double mount runs that cleanup once at start, so the tab's effect callsattachfirst.userefused that way now adds one line: the edits are not in the running task, so terminate it (getTaskTokengives the token) and calluseagain, and ask the user first if this conversation did not start it.A turn that the chat closes before it ends (Stop's 3-second grace runs out, for example behind a slow store) now links itself to the chat's stop row and saves when it ends. Before, nothing saved it.
Tests
Each new behavior has a test that fails without it.
turn.test.ts: each loop stop maps to its outcome; the card for each outcome; the needs-you cards and their disabled state;redactDeepkeeps the run token.wave/loop.test.ts: a call that asks the user ends the turn asneeds_inputeven in a reply that says done; the tool-call count.toolkits.test.ts, one per outcome throughrunAgent: done (files with a rename source, checks, usage), the filescreate_appscaffolds, needs_input (variable and question, a bad name refused, "Not checked" only when something is unchecked), stopped (with the unchecked app), failed (best effort, and a thrownTurnError), incomplete. Also: a key in a result is redacted; the rerun guidance; ownership (a fresh start then reuse, Ask for owned and foreign runs, Auto owned and foreign, a token holding another run, in Auto and on the Ask card, a vanished run, a scope change, adeploy.runstart, a switch to Auto with a waiting owned and foreign card, the refresh after restart, and runs handed throughrunAgent).agent.test.ts, throughAgentSessionand the shell'sTurnController: version 1 to 2; a chat request retried after a pipeline restart counts twice; a refused message's turn; a reloaded version 2 conversation that still owns its run while a version 1 file owns none; an unmount mid-turn; a turn the chat closed before it ended; late and duplicate answers; a turn stopped in the wave that asked, whose request the next message does not answer; a message sent while the model asks, read in the same turn; each card action; no key in the saved file, including a key already in a stored turn; the dev double mount.Each of 33 mutations, one per new behavior, fails at least one of these tests.
Fixes from review
create_appwrites through the host's scaffold, not the file toolkit, so a turn that created an app returnedfiles: [], and its card listed nothing. After the scaffold, the toolkit now lists the new app's folder and records each file as added (FileTracker.created). The model still reads a scaffolded file before it edits one.modelRequestscounted calls to the model function, so the requestcreateChatModelsends again after a pipeline restart was not counted.createChatModelnow reports each chat request it sends (onRequest), the retry included. A model a test passes in still counts once per call, so nothing counts twice.Each fix has a test that fails on the commit before it and passes with it: "the files create_app scaffolds are in the turn result as added, though the scaffold writes past the file toolkit" (it got
files: []), and "a chat request the stand-in pipeline retries after a restart counts as two model requests in the turn's usage" (it gotmodelRequests: 1).Later review rounds found five more ways the file list could misreport a turn, all fixed, each with a test that fails without its fix:
create_appnow records the new folder's files in afinally, so files a failed scaffold wrote are listed as added.deleted.FileTracker.creatednow turns a deleted file into a modified one, as a write does.deletedrow. The card said "Deleted apps/daybook-ui" next to a link to a file inside it. A write, create or rename under a folder the run deleted now brings the folder back.delete_filenow lists a folder's files before deleting it, and each gets adeletedrow of its own.deleted. A rename now brings the folder back too.Fixes from Dylan's review
ask_usershowed only "Stopped" but kept its request. And a message sent during that wave stayed queued, so it ran as its own turn. Either way the next message reached the model with "(answering request …)", and the card's buttons went dead. Only aneeds_inputturn keeps its request now. Before it ends onask_user, the loop takes queued messages. When there are any, it drops the question and goes on, as a done does with a message the model has not read. Tests: "a turn stopped in the wave that asked the user answers nothing: the next message is not a reply to the question" and "a message sent while the model asks the user is read in the same turn, and the model can ask again" (agent.test.ts). Each fails on the commit before.ChatMessage.cardandonCardActionhad no doc. They are now indocs/agents/context/ROCKETRIDE_UI_COMPONENTS.mdand the ChatView gallery entry.toolkits.test.ts).After the restack
changes()is here now, as its own first commit ("move FileTracker changes() here from the save-race PR"). It moved out of fix(agent): give every file a version, so the agent and an editor cannot write over each other #2840's split, since this PR is its only reader. It records each file's change kind and where a renamed file came from, and keeps the commit check's stored-copy hash with each read, write and rename.ask_userquestion and choices, so those two now pass through the run's hiding too. Only those two: a hidden value with a character that is not a letter can be a word the card acts on, such asneeds_input, and the card acts on the request's kind and id and on the turn's outcome and reason. Test:a value a read hid shows as its marker in the turn's question and choices, and the card keeps its outcome, kind and buttons(toolkits), with a.envthat holdsPASSWORD=needs_input. It fails when the question and choices are not hidden, and when every string of the turn is.Proof
On this commit, with the fixes from Dylan's review:
./builder shared:test: 483 tests, 481 pass, 0 fail, 2 todo (fix(agent): keep secrets out of the model in the browser agent #2836's known limits). Every exploration breaks 0 rules, with the same order counts as fix(agent): give every file a version, so the agent and an editor cannot write over each other #2840../builder rocket-ui:buildpasses.ROCKETRIDE_UI_COMPONENTS.md, whose tables were never Prettier-formatted; the new row follows them. gitleaks: no leaks.On the commit before the review, which the review did not change outside the files above:
turnController,statusRows) 8 of 8. The review changed no shell code.Browser journeys, on an engine built from this branch (server-v3.5.0 binary, the branch's engine Python), with Claude through the stand-in. On this commit every journey passed every check in one full run. An earlier full run failed one needs-you check on a counting flaw in the check itself, explained below.
answeredByin the file). After a reload the card came back from the session file, and its link opened the pipeline.verify-searchbefore and after the click. That run's second answer showed the name in a code span, so the count was 1 before the click, and 1 after it once the chat was hidden. The rerun's answer had no such span, and the count went from 0 to 1.The first full run found two problems in this PR's own behavior, both fixed above with tests: a needs-you answer said "Not checked" under "Checked: validate OK", and in Auto the model answered the refusal in prose, so the turn ended "Done" with an empty card.
Known limits
done, the chat writes its stop row and the card on it says Done.Proved with: 481 of 483 shared tests (2 todo for #2836's limits), all twelve ordering explorations with 0 broken rules, dirtyClose and the shell chat tests, the type-checks and test-file check, the rocket-ui build, and nine browser journeys passing every check on an engine built from this branch, two of them new (needs-you, foreign-terminate).
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.