Skip to content

fix(conversations): Do not store the execution on a lease check-in - #4782

Open
sentry-junior[bot] wants to merge 1 commit into
mainfrom
fix/turn-end-keeps-worker-execution
Open

sentry-junior[bot] wants to merge 1 commit into
mainfrom
fix/turn-end-keeps-worker-execution

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

A Conversation could keep showing working (the ring in In flight) after its Turn ended.

Cause

At a Turn's end, the Turn cursor stores the execution as idle while the worker still holds the lease for post-Turn work, such as memory capture. The worker's next lease check-in then wrote the stored execution again, as running. The upsert reads idle → running as queued work (queuedWork in sql/store.ts) and sets the status to working. That overwrites the status that the Turn's end set, such as done, needs_input, or failed.

Without #4755, nothing clears it until the next event. With #4755, the worker's completion writes idle over working, but the Turn's own end status is still lost.

Change

checkInConversationWork no longer writes the stored execution. A check-in changes only the lease in the work state, so the write only refreshed execution_updated_at. Readers of that column are lastProgressAt, which the dashboard uses only when a Conversation has no lastMessageAt, and the child agent list order, which has a limit of 200 children. The component test that asserted the check-in write is removed.

via @szokeasaurusrex.

--

View Session [Sentry]

@vercel

vercel Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 30, 2026 12:30pm UTC

Request Review

A check-in changes only the lease. Its write of the stored execution came
after the Turn's end set it idle, so it read as new work and set the
status to working after the Turn ended.

Co-Authored-By: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>
@sentry-junior
sentry-junior Bot force-pushed the fix/turn-end-keeps-worker-execution branch from 6b10ca5 to 6a54300 Compare November 30, 2026 12:30
@sentry-junior sentry-junior Bot changed the title fix(conversations): Keep the worker's execution status when its Turn ends fix(conversations): Do not store the execution on a lease check-in Nov 30, 2026
@szokeasaurusrex
szokeasaurusrex marked this pull request as ready for review November 30, 2026 12:34
@github-actions github-actions Bot added the risk: low PR risk score: low label Nov 30, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
tests/integration/thread-input.test.ts/Thread input >
ends a person's sign-in pause when the parent's input arrives
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 6a54300e Deployed Nov 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant