Skip to content

session: a run finishes what it starts, or says it did not - #5

Merged
will-lamerton merged 1 commit into
mainfrom
session-finishes-what-it-starts
Oct 4, 2026
Merged

will-lamerton merged 1 commit into
mainfrom
session-finishes-what-it-starts

Conversation

@will-lamerton

Copy link
Copy Markdown
Member

What this changes

A mention asking the CTO to fix the conflicts on playpip/pip-web#161 ran twice (playpip/cto runs 37121977804 and 37202943003), each time for about 14 minutes. Each time it merged the branch, pushed nothing, posted nothing, and was recorded as a success.

The cause: pnpm test:all ran past Claude Code's 10-minute Bash cap, so it was moved to the background. The agent then said "the background job will tell me when it finishes" and ended its turn. In an unattended run, ending the turn ends the session, and the work was lost with the runner.

  • session.yaml: sets CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 and BASH_MAX_TIMEOUT_MS=2700000 at job level. A slow gate now finishes inside the turn, whatever the tenant's test command is.
  • session.yaml: adds a new "Check the request was answered" step. A mention passes it if the staff member's App replied on the issue after the run started, or if the issue is now closed (a forwarded request answers on the PR and closes the issue). Otherwise the job fails, and the existing notice posts in the thread that the run stopped without replying. If the issue can't be read, the step stays silent.
  • run-record.mjs: adds a new outcome, unanswered. The portal already shows it as hot.
  • operating.md: "Finish inside the run": don't end a turn to wait on a command, and push before a slow check.

Type of change

  • fix bug fix

Testing

Automated: three new tests: the env vars are set, the answer check exists and runs before the record, and outcomeOf handles unanswered.

Manual: dry-ran the check's gh api queries against playpip/cto. #135 comes out unanswered, as it should. #132, where pip-cto[bot] replied at 12:03 after a 12:01 start, passes.

Checklist

  • pnpm test:all passes
  • Tests cover the change, and I broke one deliberately to check it fails
  • Docs updated (the suite fails if a command or flag is undocumented)
  • No generated file was edited in a tenant instead of in templates/
  • If this touches a live org: roster prompt output checked, and roster upgrade reviewed

Breaking changes

None to manifests. Tenants pick up the new session.yaml and operating.md with roster upgrade. From then on, a mention run that exits without answering shows red rather than green.

🤖 Generated with Claude Code

A mention to fix the conflicts on pip-web#161 ran twice for fourteen
minutes, merged the branch, and pushed nothing. The test suite ran past
Claude Code's ten-minute Bash cap, was moved to the background, and the
agent ended its turn to wait for it. In an unattended run that ends the
session, so the work died with the runner and the run was recorded as a
success.

- Background tasks are off and the Bash cap is 45 minutes, so a slow gate
  finishes inside the turn whatever the repo's test command is.
- A mention that exits without a reply in its thread, or without the
  issue being closed, fails the job, is recorded as "unanswered", and
  the existing notice tells the human in the thread.
- The operating guide says to finish inside the run and to push before a
  slow check.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying roster with  Cloudflare Pages  Cloudflare Pages

Latest commit: 04804d6
Status: ✅  Deploy successful!
Preview URL: https://967a8c92.roster-7ih.pages.dev
Branch Preview URL: https://session-finishes-what-it-sta.roster-7ih.pages.dev

View logs

@will-lamerton
will-lamerton merged commit 1c5f87b into main Oct 4, 2026
9 of 12 checks passed
@will-lamerton
will-lamerton deleted the session-finishes-what-it-starts branch October 4, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant