refactor(core): rename the execution claim column - #46945
Open
kitlangton wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
session_v2.time_suspendedholds the write-ahead execution claim, including while a Session is actively running. The suspension name misrepresents the recovery marker and makes claim queries harder to read.What Changes
Rename the column to
execution_claimed_atand its partial index tosession_v2_execution_claimed_at_idx. Claim acquisition, release, and restart selection keep their existing behavior.time_suspended = 1234,resume_attempts = 2execution_claimed_at = 1234,resume_attempts = 2time_suspended = 5678,resume_attempts = 1execution_claimed_at = 5678,resume_attempts = 1time_suspended = NULLexecution_claimed_at = NULLexecution_claimed_at;resume_attemptsstill defaults to zeroThe new migration uses SQLite's column rename, not a table rebuild. It preserves activity timestamps and dependent history, and recreates the partial index under the new name. The repository's migration generator updates the registry, current-schema bootstrap, and Drizzle snapshot; historical migrations are unchanged. The previous-V2 importer still reads the legacy source column and writes the renamed destination.
Scope
Storage naming and regression coverage only; no public Protocol/API changes. Subagent recovery refactoring and event-based child-claim release remain separate work.
Verification
Run with Bun 1.4.0:
bun install --frozen-lockfile; no lockfile change.