Repository navigation
skills(running-in-ci): end the turn only when work is shipped - #661
Conversation
Backgrounding a multi-minute local validation (`cargo run -- hook pre-merge --yes`, full test suite, comprehensive lint) behind a `Monitor` wait before `git push` / `gh pr create` destroys the deliverable when the session ends mid-wait. Two consecutive worktrunk sessions in the same two-hour window did real code work for the same maintainer ask, then silently failed to ship because both gated the push on a backgrounded pre-merge run that outlived the session budget. Add a subsection to PR Creation telling the bot to sequence the visible deliverable (commit, push, `gh pr create`) first and let CI re-run the matrix after push. A targeted compile plus the tests exercising the change is enough local confidence to ship. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
But why did the session end? That seems like the core problem here! Is this a problem with running without Is max-sixty/worktrunk#2986 similar? Is that running without |
|
You're right that this PR papers over the symptom. The root cause: Why the session ends. Both failed runs emitted Is this a Is worktrunk#2986 the same? Yes — same Given the questions, two options I'd take direction on:
The deeper structural fix — having |
|
3rd occurrence of the same shape this hour, on a different PR.
Cadence. 3 occurrences inside ~17 hours, across 2 worktrunk PRs (#2983 twice, #2991 now) and 2 workflow types (tend-mention twice, tend-notifications once). All inside max-sixty/worktrunk — consistent with worktrunk#2986's overlay-level scope. The bundled-vs-overlay choice from my prior comment still stands; this just sharpens the rate. Maintainer-impact signal. Each occurrence leaves a visibly unanswered maintainer ask. PR #2991 now sits with max-sixty's "great, yes, let's do that" unresponded-to, even though the bot did the rework — the maintainer can't see that and has no reason to expect a sibling cycle will redo it. The invisibility is the user-facing harm worth pricing in. No response needed — posting as evidence for the open decision. Recorded in the evidence gist. |
please explain? |
|
consider generalizing this to a simple "do not end the turn until everything is complete"? |
Replaces the narrow "Ship the deliverable before any long wait" subsection under PR Creation with a top-level "End the turn only when work is shipped" section. The failure mode generalises beyond PR creation — any case where `end_turn` fires while a maintainer-visible deliverable is staged but un-shipped has the same shape (comment posting, follow-up commits, inline replies). Reframes after maintainer review #661. The wakeup-mechanism evidence from the cited runs shows the model never attaches a `task-notification` subscription before `end_turn` (either no `Monitor` call, or `Monitor({})` failing with InputValidationError because the deferred-tool schema isn't loaded), so even if the underlying wakeup window is generous the model can't reach it. Rule sidesteps this: don't end the turn while the deliverable is un-shipped, regardless of why. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Traced both session logs — the wakeup never fired because neither failed run successfully subscribed to one. Resolves my earlier "haven't traced exactly which" hedge: Run 27053336290. Backgrounded Run 27075856123. Same shape, but the model did call So: neither "wakeup window too short" nor "final Re: generalising to "do not end the turn until everything is complete" — yes, that's the right framing. Even when Pushing the rewrite in a follow-up commit on this branch. |
…re end_turn" Triage Step 6.3's "Run the full test suite and lints" conflicts with running-in-ci's "End the turn only when work is shipped" (#661): a long suite kicked off before push pushes the agent into mid-wait end_turn and the deliverable never ships. Fold the targeted-test check into Step 2 and renumber. Closes a 2-occurrence pattern (May tend-mention #5741, June tend-triage on PRQL/prql#5988) where the agent finished real work, called ScheduleWakeup expecting resumption, and exited without commit/push. Co-Authored-By: Claude <[email protected]>
Bumps the generator version to 0.1.4, syncs the lockfile, and adds the 0.1.4 CHANGELOG section (published as the GitHub Release notes on tag push). Notable changes since 0.1.3: - Claude harnesses switch to `bypassPermissions` (#677) - GitHub Releases publish from `CHANGELOG.md` on tag push (#678) — this release is the first live exercise of that workflow - Interactive sandbox receives GitHub Actions context env vars (#664) - install-tend bot-token step restructured around scope-audit remediation (#680) - Review skill checks the rollup before APPROVE (#667); running-in-ci/triage/ci-fix skill refinements (#661, #666, #669, #670, #671) > _This was written by Claude Code on behalf of max_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5 <[email protected]>
Three sessions over a ~17-hour window did meaningful code work for a maintainer ask, then silently failed to ship anything because each one emitted
end_turnwhile arun_in_background: truepre-merge gate was still pending. The harness did not resume — none of the runs ever subscribed to atask-notificationwakeup (one didn't callMonitor, two more gotInputValidationErroron a deferred-tool schema race and never retried). Each occurrence leaves a visibly unanswered maintainer ask: branch never pushed, no commit, no comment, no signal the work happened.This reframes the rule after maintainer review (#661 (comment)). The first cut narrowed it to "ship the deliverable before any long wait" under PR Creation; the failure mode generalises beyond PR creation to any case where
end_turnfires while a maintainer-visible deliverable is staged but un-shipped — comment posting, follow-up commits, inline replies, anywhere arun_in_backgroundtask gates the next step.Adds a new top-level section End the turn only when work is shipped to
running-in-ci, placed after Restrictions. Rule: treat the session as live until the deliverable is maintainer-visible (pushed, posted, opened); don't background work whose output gates the deliverable; therun_in_backgroundrecipe under CI Monitoring stays safe because it runs after push.Evidence
tend-mentionrun 27051779110 — backgrounded pre-merge gating a deprecation PR, session ended mid-wait, no PR shipped.tend-notificationsrun 27053336290 — picked up the deferred work, implemented cleanly on local branchdeprecate/squash-commits-var-27053336290, ~17 min and $7.35 of session, never calledMonitor, branch never pushed, no comment.tend-mentionrun 27075856123 — different PR (worktrunk#2991), full rework implemented, calledMonitor({})with empty input →InputValidationError, loaded the schema viaToolSearchbut never retried,end_turnwith text "I'll be re-invoked when it finishes". It was not.Classification. Three occurrences inside ~17 hours, across two worktrunk PRs and two workflow types (
tend-mentiontwice,tend-notificationsonce). Gate 1 (High structural needs 2–3 occurrences). Gate 2 (targeted fix at Normal threshold).Evidence gist: https://gist.github.com/15c523384cfad7449cb81933b47165ff