Repository navigation
Plan bar: run-all plans offer Pause, not Run step N; the model is told not to end its reply between steps - #733
Merged
Conversation
Contributor
Preview Deployment
This preview will be updated automatically when you push new commits. |
…ause on the last step; tell the model a held step never ran; a new plan clears a pause (Refs #731) (tested)
…ep and Pause on the last step (docs only)
Contributor
|
Worker changes detected. After merging to Manual deployment (if needed): cd workers/osa-worker
wrangler deploy --env dev # for develop branch
wrangler deploy # for main branch |
Member
Author
|
Review round 1 (Sonnet code reviewer): outcomes
|
…e and the send guard read currentReply, Run step N is grayed during an unrelated reply, the held note survives a failed send; the Next line says an unanswered call was not run (Refs #731) (tested)
Member
Author
|
Review round 2 (Sonnet code reviewer): outcomes
Suites after the changes: pytest 364 passed; ruff clean; |
…run-all-bar # Conflicts: # CHANGELOG.md
This was referenced Nov 11, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #731
Diagnosis
The main cause is how the widget decides that a reply is in flight; a model that ends its reply early is a secondary cause.
progressOf(frontend/osa-plan.js) returnspausedwheneveractiveis false. The widget passedactive: isLoading || toolActivity !== null(the strip, the bar and the rail). ButisLoadingmeans "no visible text yet":handleStreamingResponse's reveal callback clears it as soon as the reply shows any text.sendMessage(eachexecute_coderequest is answered on/chat/resumeand its stream read in the same loop). So between two steps, once the model had written a sentence,isLoadingwas false while the reply was still running: the bar read "Paused after step N" with Run step N+1, and clicking it passed theif (isLoading) return;guard and sent a second/chatalongside the running reply.currentReply !== null(set at the start ofsendMessage, cleared in itsfinally) or a tool activity is on, at both call sites and in the click guard.run_modereaches the model only as the "Run mode" line of thepropose_planresult and, for NEMAR, as one weak clause inplan_first_instructions. The prompt is made explicit (below).Change
Prompt (server):
src/assistants/nemar/config.yaml: therun_allbranch now says the reader will not tell the model to continue, to callexecute_codefor the next step in the same turn after each result, to write no closing message until the last step has run (one sentence of what a step showed may come with the next call), and to summarize once at the end. Failure handling (item 6) is unchanged.src/api/tool_results.py: for an approvedrun_alldecision theNext:block gets the same instruction, deterministic, plus: anexecute_codecall left unanswered during a run-all plan means the reader paused before that step started; it never ran and is not a failed attempt.Client:
currentReply/tool activity, notisLoading(see the diagnosis).Working on step N of M.with Pause and Stop plan.canPause(progress)(run-all, running or retrying) decides when it is offered; clicking setscurrentReply.pausing. IncontinueBrowserReply,pauseDue(messages)(approved plan, the request is the first attempt of a step) leaves the next request for code unanswered, exactly as Stop plan does, and the reply ends with the plan still approved. The bar is then the paused one: Run step N+1, Change step N+1, Stop plan. A step that failed is tried again before the pause takes effect, since it has not finished. While Pause is asked and the step still runs, the bar saysPausing: ...with Stop plan only.Continue with step N. It has not run: I paused before it started, so it is not a failed attempt. Run it now, then run the remaining steps without stopping.(the held step is kept on the plan asheld), so the continuing reply is run-all too and the step is not counted as an attempt. A run-all reply that ended on its own getsContinue with step N, then run the remaining steps without stopping.A plan that pauses after each step is unchanged (Continue with step N., no Pause button).Runs all stepsfoot read the same plan state, and the bar beside it follows the rules above (tested with the dialog raised, including text streamed between steps).frontend/osa-plan.jschanged, sofrontend/osa-runtime.bundle.jsand the integrity hash in the widget are rebuilt (bun scripts/build-runtime-bundle.js). Widget: OSAChatWidget.seed (open with a reply, send nothing); smooth open and dock; bottom-right Move to corner icon #730 also editsfrontend/osa-chat-widget.js: the hash line is the one place both PRs will touch, rebuild after the merge of the second.Docs: the "strip and bar" table, a note on why Run step N is absent and how Pause works, and the rail text in
docs/community-widget.md; CHANGELOG entry.Not verified here: the on-test.nemar.org check in the issue (a three-step run-all plan running to the end, Pause, then Run step). Whether the stronger wording makes the model stop ending its reply is a model behavior and needs that check; the client never ends a plan the model has ended, by design (see Pause's paused state, which is also what a run-all plan whose reply ended anyway shows).
Commands run
pytest tests/test_agents/test_plan_first.py tests/test_api/test_tool_results.py tests/test_api/test_propose_plan.py tests/test_frontend tests/test_scripts/test_plan_consistency.py -o addopts="": 364 passed.ruff check src tests: passed;ruff format --check src tests: 301 files already formatted.bun frontend/test-widget-plan-card.js: 338 passed, 0 failed;bun frontend/test-widget-plan-rail.js: 170 passed, 0 failed;bun frontend/test-plan-rail.js: 78 passed; all 45frontend/test-*.jsexit 0.bun scripts/build-runtime-bundle.jsthen--check: "Runtime bundle is current".