fix(kanban): avoid fragile failure-column renames - #20848
Closed
helix4u wants to merge 1 commit into
Closed
Conversation
helix4u
marked this pull request as ready for review
May 6, 2026 17:44
Collaborator
|
Merged via PR #20855. Your fix was cherry-picked onto current |
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.
What does this PR do?
Fixes the Kanban DB migration regression where the embedded dispatcher can fail on startup with
sqlite3.OperationalError: no such column: "spawn_failures".This is a follow-up to #20410, not a duplicate of it. #20410 changed the Kanban failure counter schema from
spawn_failures/last_spawn_errortoconsecutive_failures/last_failure_errorand usedALTER TABLE ... RENAME COLUMNto migrate existing DBs. The reported failure happens when an existing Kanban DB is on an older or partial schema that does not actually havespawn_failures, so the rename path itself crashes before the dispatcher can start.This PR makes that migration tolerant of those real-world DB shapes: add the new columns if missing, copy legacy values only when the legacy columns exist, and leave any old columns harmlessly in place. Installs with old counters keep their values; installs without the legacy columns no longer crash.
Related Issue
Fixes #20842
Follow-up to #20410
Type of Change
Changes Made
hermes_cli/kanban_db.pyspawn_failuresintoconsecutive_failuresonly when the legacy column exists.last_spawn_errorintolast_failure_erroronly when the legacy column exists.tests/hermes_cli/test_kanban_core_functionality.pyHow to Test
./.venv/bin/pytest tests/hermes_cli/test_kanban_core_functionality.py::test_legacy_db_without_skills_column_migrates tests/hermes_cli/test_kanban_core_functionality.py::test_legacy_spawn_failure_columns_are_copied_not_renamed -q../.venv/bin/pytest tests/hermes_cli/test_kanban_core_functionality.py -q.hermes kanban init/ embedded gateway dispatcher startup no longer raisesno such column: "spawn_failures".Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
Targeted migration checks pass:
Full Kanban core test file passes:
Full suite was run and is not green on this checkout:
The full-suite failures are outside the touched Kanban migration path. They are in cron script prompting, gateway approval/config/DingTalk/API/restart tests, update command tests, model provider persistence/validation, concurrent interrupt tests, browser Chromium detection tests, delegation credentials/heartbeat, Dockerfile TUI dependency checks, skill provenance, credential-pool dotenv fallback, Tirith marker handling, and Daytona/Vercel environment command wrappers.