Repository navigation
fix(goals): task-session-stays-open and the restart journey match today's board and reopen (FIX-1979, FIX-1981) - #3346
Conversation
…IX-1764's reopen (FIX-1979, FIX-1981)
The new-session control's patch matched a line FIX-1872 rewrote, so the
control could not apply. It now patches the hand-off's
`return { key: taskSessionKey(...) }` line.
Since FIX-1764, leg b's question on the finished task reopens it, so the
plain run graded leg a on the reopened row and failed. Leg a is now graded
on the row as it stood before leg b, and leg b checks the reopen: the task
completes again in its own session, naming the ticket.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RFPYtuYGMJ8xuLNDReeJT4
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: ae91dcf6-e343-4fd4-a512-d1fad96b8368) |
Second look + architecture passVerdict: the approach is right; no blocking findings. Snapshotting the row at the end of leg a and grading a on it is the smallest honest fix. It leaves the legs independent and adds no new harness mechanism. Alternatives I considered (running leg b on a separate task, or loosening the a-assertions to tolerate the reopened row) are worse. The first changes the scenario's meaning, and the second makes the red state weaker. The new leg b grades the reopen contract FIX-1764 decided ( I checked these and they hold:
Optional, not blocking:
Not in scope, so I'd leave it: the control patches are regexes over Generated by Claude Code |
There was a problem hiding this comment.
/simplify review
Verdict: The extra machinery here is proportional to the product change, not an over-built test harness. FIX-1764 makes leg b reopen the task and complete on a new attempt, so the goal had to stop grading leg a from the live row after leg b and stop treating leg b as assistant message text in the worker session. Snapshot (endedRow), a post-run wait for the reopened attempt to settle, and attempt-scoped completed notices are the smallest faithful adaptation I see—not a simpler design that still matches goal.md and store-oracle grading.
What would have been “simpler” (and why it doesn’t work)
| Alternative | Why it falls short |
|---|---|
Keep leg b on items(..., "message") + textOf |
Reopen returns { reopened: taskId } quickly; the ticket lives on the task row after the new attempt, not necessarily as the run action’s assistant message. |
Grade leg a from rows.find(taskId) at grade time |
Leg b mutates the same row (attempts, output, second completed notice)—leg a tags would flake or need heavier filtering anyway. |
Single a:one-completed without attemptOf |
After leg b you get two :completed keys; you need the taskId:attempt:ending attempt slot (same shape as orchestration noticeKey). |
Import noticeKey from @flow-state-dev/orchestration |
Would DRY the key shape but breaks the usual goals convention (SQLite store oracle, no package coupling). Reasonable to cite the format in a comment instead. |
| Third-party helper for polling | waitFor/quiet are already copied across coordinator goals; extracting shared lib is a wider refactor than this PR. |
Approach smell check
- Directory / imports: Still one goal folder + shared
files-tasks-down-the-owners-chain/store.mts; no new cross-package graph. DroppingtextOfis a net simplification. - Control patch: Re-anchoring
new-sessiontoreturn { key: taskSessionKey(...) }matches currentboard.ts—brittle by design for module-patch goals, same as siblings. - Related debt (out of scope):
goals/hand-offs/survives-a-restart-and-runs-once/legs/parked.mtsstill grades leg b as “session answers without row change” (j:still-answers/j:row-unchanged). If FIX-1764 applies there too, that goal will need the same class of update—not a reason to block this PR.
Optional tighten-ups (non-blocking)
- Fail-fast on leg b: If
asked === null, the newwaitForstill polls 120s with a predicate that can never pass—worth guarding to shorten red runs (DX only). attemptOf: A one-line comment that keys aretaskId:attempt:endingwould document whysplit(":")index-2is the attempt.- Naming:
replyin leg b is now task output;reopenOutput(or similar) would reduce confusion with the old message-based check.
No performance or production concerns; this is a sequential goal script dominated by the model and HTTP.
Approval: Direction looks right for FIX-1979 / FIX-1981; I don’t see a materially cleaner change set without weakening the signal.
Sent by Cursor Automation: Review For Best Approach
There was a problem hiding this comment.
Code Snob — tried a rewrite, it tied. No POC.
I read goals/coordinators/task-session-stays-open/run.mts and goal.md.
I hoisted the three ["completed", "errored", "cancelled"] checks into taskDone, inlined attemptOf, and shortened the leg b comment to // Leg b.. Against 7739ad25, run.mts stays net +10 (+21/−11, was +20/−10). The helper is one new line; dropping attemptOf gives that line back and leaves .at(-2) on the filter. Folding reopenedRan into the if wraps to the same length.
The snapshot, the reopen wait's attempts clause, and the { reopened } check are the contract. goal.md's three new verdict rows are the run log.
Sent by Cursor Automation: Code Snob
…FIX-1981) J4 asked the finished task's session the same question leg b does, and graded the row as unchanged after it. Since FIX-1764 the question reopens the task, so j:one-completed counts up to the answered attempt, j:still-answers checks the reopen and the reopened output, and j:row-unchanged becomes j:reopened. Also folds the review's optional nits on task-session-stays-open (fail-fast wait, notice-key comment, naming). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RFPYtuYGMJ8xuLNDReeJT4
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 72944dec-976f-416d-a785-70040060bb4d) |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |


Requested by Jake · project thread
Before: on main
7739ad25,goals/coordinators/task-session-stays-openwas broken twice over. Itsnew-sessioncontrol could not run, because FIX-1872 (#3232) rewrote the line it patches. And the plain run failed every attempt ata:names-region,a:one-completedandb:names-ticket. Since FIX-1764 (#3297), leg b's question on the finished task reopens it, but leg a was still graded on the reopened row. The restart journey J4 (goals/hand-offs/survives-a-restart-and-runs-once/legs/parked.mts) asks the same question, so it failed the same way, atj:one-completed,j:still-answersandj:row-unchanged.After: both plain runs pass.
new-sessionfails ata:names-ticketandc:names-ticket, with exactly the co-failures the closure goal's table lists.drop-answerfails ata:names-regionalone. J4'sfresh-storefails atj:answered, with every laterj:*red too andkill:parkedgreen.How:
return { key: taskSessionKey(claim?.followUpOf ?? task.taskId, worker) };.rundoor answers{ reopened: <taskId> }, and the task completes again in its own session with an output naming the ticket.j:row-unchangedcontradicts the reopen outright, so it becomesj:reopened: completed again, one attempt later, in the session that parked. The runner's tag list is updated to match.Evidence, on
7739ad25+ this change,openai/gpt-5.4-minithrough the gateway, afterpnpm packages:buildandpnpm build:assets:new-session: FAIL, red ata:names-ticketandc:names-ticketas required, plusa:same-session,b:names-ticket,c:same-sessionandc:one-draw.drop-answer: FAIL ata:names-regiononly.fresh-store: FAIL,j:answered failed, as it must.No changeset: goals are private.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RFPYtuYGMJ8xuLNDReeJT4