WIP: Reap heartbeat-live but activity-dead turns using an explicit activity watermark #604

Draft
toasterson wants to merge 1 commit from claude/wi-019fe0f0-reap-heartbeat-live-but-activity-dead-tu into main
Owner

Anima work item 019fe0f0-e1e2-7d42-a23f-7dae6174f26e.

Second bounded replacement for WI-371. Depends on 019fe0f0-e16e-79f0-b407-a04af93eae0e.

Track a last-meaningful-activity watermark separately from transport heartbeat. A configurable idle-turn watchdog must request cooperative turn cancellation, then end the session through the supported session control if it remains inactive. Record no activity for Ns as a distinct reason.

Heartbeat continues to mean transport liveness only. Do not treat token silence during a tool call as inactivity: define meaningful activity from ACP events and allow an explicit long-running-tool lease or progress signal.

Tests cover the original case: heartbeats continue, no meaningful activity arrives, the session is ended, its slot returns, and unrelated sessions stay alive.

Anima work item `019fe0f0-e1e2-7d42-a23f-7dae6174f26e`. Second bounded replacement for WI-371. Depends on 019fe0f0-e16e-79f0-b407-a04af93eae0e. Track a last-meaningful-activity watermark separately from transport heartbeat. A configurable idle-turn watchdog must request cooperative turn cancellation, then end the session through the supported session control if it remains inactive. Record no activity for Ns as a distinct reason. Heartbeat continues to mean transport liveness only. Do not treat token silence during a tool call as inactivity: define meaningful activity from ACP events and allow an explicit long-running-tool lease or progress signal. Tests cover the original case: heartbeats continue, no meaningful activity arrives, the session is ended, its slot returns, and unrelated sessions stay alive.
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin claude/wi-019fe0f0-reap-heartbeat-live-but-activity-dead-tu:claude/wi-019fe0f0-reap-heartbeat-live-but-activity-dead-tu
git switch claude/wi-019fe0f0-reap-heartbeat-live-but-activity-dead-tu

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff claude/wi-019fe0f0-reap-heartbeat-live-but-activity-dead-tu
git switch claude/wi-019fe0f0-reap-heartbeat-live-but-activity-dead-tu
git rebase main
git switch main
git merge --ff-only claude/wi-019fe0f0-reap-heartbeat-live-but-activity-dead-tu
git switch claude/wi-019fe0f0-reap-heartbeat-live-but-activity-dead-tu
git rebase main
git switch main
git merge --no-ff claude/wi-019fe0f0-reap-heartbeat-live-but-activity-dead-tu
git switch main
git merge --squash claude/wi-019fe0f0-reap-heartbeat-live-but-activity-dead-tu
git switch main
git merge --ff-only claude/wi-019fe0f0-reap-heartbeat-live-but-activity-dead-tu
git switch main
git merge claude/wi-019fe0f0-reap-heartbeat-live-but-activity-dead-tu
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
toasterson/Anima!604
No description provided.