workq: repair legacy system:unclaimed status rows#180
Merged
dgarson merged 1 commit intodgarson/forkfrom Feb 24, 2026
Merged
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.
Motivation
status = 'system:unclaimed', butsystem:unclaimedis an agent sentinel that must live inagent_idnotstatus, and such rows are treated as non-available and break consumers that expect canonical statuses.Description
repairSystemUnclaimedStatusRows()invoked fromWorkqDatabase.initialize()that updates any rows withstatus = 'system:unclaimed'tostatus = 'claimed', setsagent_id = 'system:unclaimed'when the row shows the symmetric corrupted shape, and refreshesupdated_at.src/database.test.tswhich simulates the legacy/corrupted row (status='system:unclaimed', agent_id='claimed') and verifies reopening the DB triggers the repair tostatus='claimed', agent_id='system:unclaimed'.extensions/workq/src/database.tsandextensions/workq/src/database.test.ts.Testing
pnpm --filter @openclaw/workq test -- src/database.test.ts, which failed to run the suites due to a missing Vitest setup file (extensions/workq/test/setup.ts), preventing full automated validation in this environment.Codex Task