Skip to content

fix(state): Propagate schema reconciliation failures - #82568

Open
thanosapollo wants to merge 1 commit into
NousResearch:mainfrom
thanosapollo:fix/79531-propagate-schema-locks
Open

thanosapollo wants to merge 1 commit into
NousResearch:mainfrom
thanosapollo:fix/79531-propagate-schema-locks

Conversation

@thanosapollo

@thanosapollo thanosapollo commented Aug 9, 2026

Copy link
Copy Markdown

What does this PR do?

Stops schema reconciliation from silently swallowing SQLite lock and migration errors. Only the benign concurrent duplicate column name race is ignored, allowing SessionDB's existing open retry path to handle transient contention.

Related Issue

Fixes #79531

This complements #80797: that PR fixes stale-schema detection on read-only opens; this PR fixes the independent writable-reconciliation path that swallowed migration lock and other operational errors. #80030 was an earlier draft of the #80797 approach.

Type of Change

  • 🐛 Bug fix

Changes Made

  • Propagate schema-probe and non-duplicate ALTER TABLE failures.
  • Add regressions for probe locks, ALTER TABLE locks, and duplicate-column races.

How to Test

scripts/run_tests.sh tests/test_schema_reconciliation.py tests/test_schema_read_probe.py tests/state/test_write_lock_patience.py -q
scripts/run_tests.sh tests/test_hermes_state.py -k TestSchemaInit -q

Results: 14 passed; 3 passed. Ruff and Python compile checks pass.

Checklist

  • Read contributing guide and searched for duplicate PRs
  • Focused diff with regression tests
  • Considered cross-platform behavior
  • Documentation/config/tool schemas: N/A

Only a concurrent duplicate-column race is benign. Let schema inspection, lock, busy, and other migration failures reach SessionDB's existing open retry and error path instead of reporting a half-reconciled schema as initialized.

Fixes NousResearch#79531
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/sessions Session lifecycle, resume, persistence, history sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sessions Session lifecycle, resume, persistence, history comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cross-platform update regression: existing sessions disappear when state.db migration is skipped

2 participants