Repository navigation
fix(content): refuse a Start or a page rewrite while a Fix open rules runs on the draft - #1525
Merged
Merged
Conversation
… runs on the draft Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nce after Stop; neutral dialog wording; 409 codes in the docs (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
gkhngyk
approved these changes
Oct 26, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good.
What I checked:
- Where it refuses.
startDraftWritinganswers 409runningwhile a Fix open rules or a hand-off is under way on the draft (content-writer.js:396-401).- It applies to a new page's Start, a live page's Start and a rewrite.
- It runs after
not_draft,writingandopen_suggestions. It runs before the AI budget hold, the claim and the run row, so a refusal costs nothing and holds nothing. - The new test covers all three cases, and a Start once the Fix has finished.
- No false refusals from its own runs.
- A live page's Start runs as
fixand holds a claim. A second Start is refused aswritingbefore this check. - A writing run finishes its row however it ends (done, stopped or failed). So Try again after a failed live-page Start goes at once.
- A row left by a server that stopped counts for 10 minutes at most, the same window as a stale
writingclaim.
- A live page's Start runs as
- Stopped runs.
fixUnderWaynow leaves out stopped runs (content-runs.js:61).- A stopped run's batch is dropped before it's written (
stopIfStoppedcomes before the suggestions insert). So a Start or a Fix may go right after Stop. - Fix open rules' own
runningrefusal benefits too. Before, it waited out a stopped run.
- A stopped run's batch is dropped before it's written (
- Web.
runningis inAGENT_WRITE_ERRORS, with words in both places that show these errors:- the editor's
agentFailed.errors, for Try again and Rewrite page; - the New content dialog's
start.agentErrors. - In the editor, a Fix or hand-off in the same tab already holds Start and Rewrite (
agentBusy). The server's refusal only shows for another tab's run, as the words say.
- the editor's
- Merge. It merges cleanly on main, alongside #1511, and on top of the editor chain's last PR (#1526). CI passes.
- Before the API is deployed, nobody sees a change: the live API never answers
runningon these routes. After the deploy, a Start or Rewrite during another tab's Fix is refused with the new words, instead of running beside it.
This was referenced Oct 26, 2026
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.
Summary
From main, independent of the open editor chain; no conflicts with it.
startDraftWriting(content-writer.js) is behind the editor's Start / Try again, Rewrite page, and the New content dialog's Start. It refused a run while the draft is being written, and (for a live page or a rewrite) while suggestions are open. But it didn't refuse while a person's Fix open rules is still under way on the same draft, for example from another tab. Then:fixruns for a live page's Start).fixDraftRulesalready refuses the other way round: beside a Start (409writing) and beside another fix (409running,fixUnderWay). Found in the pre-push review of #1524.Server
startDraftWritingrefuses with 409runningwhile a Fix or Quality's hand-off is under way on the draft (fixUnderWay).writing, and open suggestions still answeropen_suggestions.fixUnderWayaddsstopped_at is null). Its batch is dropped anyway (stopIfStopped).stopDraftRun, the stop route). They now say that a live page's Start runs as a Fix and holds its own. The 409 lists in the route and function docs namerunningtoo.Web
runningis a known start error (AGENT_WRITE_ERRORS), so it's said, not shown as "couldn't start".Related issue
Follow-up to the editor test findings 2026-10-25 (#1524's review).
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdnpm run lintpasses (run fromserver/)npm testpasses (run fromserver/)yarn lintpasses (run fromweb/): 0 errors; the 6 warnings are in files this PR doesn't touchyarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Web:
yarn testandyarn buildtoo. Tests:fixUnderWayleaves stopped runs out;runningmaps to therunningerror.A pre-push review ran; its fixes are the last commit. After it: server format, lint and
npm testin full; web lint, typecheck and the affected tests.🤖 Generated with Claude Code