Repository navigation
fix(session): a joined task ended by its run's stop reads stopped, not finished - #2367
Open
CloudCorpRecords wants to merge 2 commits into
Open
CloudCorpRecords wants to merge 2 commits into
CloudCorpRecords wants to merge 2 commits into
Conversation
…t finished Fixes Agent-Field#1828 Signed-off-by: Rene Turcios <[email protected]>
Signed-off-by: Rene Turcios <[email protected]>
|
|
CloudCorpRecords
force-pushed
the
fix/1828-joined-stop-report
branch
from
November 15, 2026 00:22
ce03c45 to
10a7ae6
Compare
Member
|
Hey, thanks for the PR. Could you sign the CLA when you get a chance so we can review it? |
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.
What changed
Fixes #1828 — the stop-outcome defect.
When several tasks join one run and all are stopped in one batch of concurrent stop calls, a joined task whose stop reached the store after the run's stop was reported as "has already finished; there is nothing to stop", even though its worker was mid-work and was in fact ended by the run's stop (
plandb.Store.StopRootcancelling every open task in the run). The answer depended on the order the concurrent stops reached the store.stopJoinedRow(internal/session/stoprun.go): a terminal joined task is now told apart by its ending. Cancelled under a person's stop reason (planStopReason), with the run's root cancelled under the same reason, it answerstask N (title) was already stopped with task M (run title), whose run it shared. Cancelled under the stop reason while its run is still open, it answerswas already stopped. "Already finished" is now said only for a task that landed or failed on its own.endedBeltRow: a settled run row that reads stopped (TaskNotice.Stopped) now answers "was already stopped" instead of "already finished", so a batch stop that arrives after the run has settled agrees with the row it is looking at.Scope: this PR fixes the stop reporting in the issue (the first defect and the acceptance sentences). The joined card
where:folder and the joined receipt's copy wording named in the same issue are not changed here.How it was checked
New regression tests in
internal/session/stoprun_joined_batch_test.go(deterministic: the run's stop is written before the joined stop is issued, and separately all stops are issued concurrently — no timing luck):dev(f4db1f4):go test ./internal/session/ -run 'TestStopJoinedRow|TestStoppingRunThenJoined|TestStoppingBatch' -count=1 -v-> 3 failed with the exact reporter sentencetask 72 (task D) has already finished; there is nothing to stop; the landed-task guard test passed.-race -count=3-> 12/12 passed, no race reports.stoprun_test.gopassed; cancel/stop-boundary tests passed (11).devworktree at the same commit and unrelated to this change (noplandbcode is touched): theplandbStopRoot/Cancel tests fail inTempDircleanup withplan.json: The process cannot access the file because it is being used by another process(3/3 on both trees), and 5 job/stopwork tests fail withbelt has no "bash" toolon both trees.gofmt -lon both changed files: clean.make pr-ready/make test-quickwere not run; the focused suites above are what was run, per the repo's focused-test guidance.Checklist
docs/changes/unreleased/2367-joined-stop-reads-stopped.md, created withmake changelog-new PR=2367 KIND=fixed SLUG=joined-stop-reads-stoppedin the follow-up commit on this branch (the number only exists once the PR does);changelog-checkpasses (105 entries, all well formed).internal/manual/chat/(searched), and the manual's account of stopping tasks already describes this behaviour.git add -A).Disclosure: this change was prepared with AI assistance.