WIP: Circuit-breaker state fails to load on every server boot: last_refusal_at is TIMESTAMP in the DB but TIMESTAMPTZ in the row type #613

Draft
toasterson wants to merge 1 commit from claude/wi-01a009dc-circuit-breaker-state-fails-to-load-on-e into main
Owner

Anima work item 01a009dc-6ebf-7dd2-9aec-58360e59d7cb.

Every anima-server boot logs:

Failed to load circuit-breaker state from DB: error occurred while decoding column "last_refusal_at": mismatched types; Rust type Option<DateTime<Utc>> (as SQL type TIMESTAMPTZ) is not compatible with SQL type TIMESTAMP

So the lane circuit breaker starts cold on every restart — persisted refusal history is silently discarded, and a restart resets any tripped breaker. Fix: migrate the column to TIMESTAMPTZ (ALTER TABLE ... ALTER COLUMN last_refusal_at TYPE timestamptz USING last_refusal_at AT TIME ZONE 'UTC') or decode as NaiveDateTime and convert. Check the whole table for sibling TIMESTAMP columns while there. Observed 2026-08-16 08:59:45Z on boot of image a4d0966d.

Anima work item `01a009dc-6ebf-7dd2-9aec-58360e59d7cb`. Every anima-server boot logs: > Failed to load circuit-breaker state from DB: error occurred while decoding column "last_refusal_at": mismatched types; Rust type `Option<DateTime<Utc>>` (as SQL type `TIMESTAMPTZ`) is not compatible with SQL type `TIMESTAMP` So the lane circuit breaker starts cold on every restart — persisted refusal history is silently discarded, and a restart resets any tripped breaker. Fix: migrate the column to TIMESTAMPTZ (`ALTER TABLE ... ALTER COLUMN last_refusal_at TYPE timestamptz USING last_refusal_at AT TIME ZONE 'UTC'`) or decode as `NaiveDateTime` and convert. Check the whole table for sibling TIMESTAMP columns while there. Observed 2026-08-16 08:59:45Z on boot of image a4d0966d.
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-01a009dc-circuit-breaker-state-fails-to-load-on-e:claude/wi-01a009dc-circuit-breaker-state-fails-to-load-on-e
git switch claude/wi-01a009dc-circuit-breaker-state-fails-to-load-on-e

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-01a009dc-circuit-breaker-state-fails-to-load-on-e
git switch claude/wi-01a009dc-circuit-breaker-state-fails-to-load-on-e
git rebase main
git switch main
git merge --ff-only claude/wi-01a009dc-circuit-breaker-state-fails-to-load-on-e
git switch claude/wi-01a009dc-circuit-breaker-state-fails-to-load-on-e
git rebase main
git switch main
git merge --no-ff claude/wi-01a009dc-circuit-breaker-state-fails-to-load-on-e
git switch main
git merge --squash claude/wi-01a009dc-circuit-breaker-state-fails-to-load-on-e
git switch main
git merge --ff-only claude/wi-01a009dc-circuit-breaker-state-fails-to-load-on-e
git switch main
git merge claude/wi-01a009dc-circuit-breaker-state-fails-to-load-on-e
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!613
No description provided.