Skip to content

fix: recover when sqlite parent directory disappears - #19

Merged
giscebot merged 2 commits into
mainfrom
fix/issue-18-sqlite-parent-dir
Jul 28, 2026
Merged

fix: recover when sqlite parent directory disappears#19
giscebot merged 2 commits into
mainfrom
fix/issue-18-sqlite-parent-dir

Conversation

@giscebot

@giscebot giscebot commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • expand literal ~ in the configured SQLite queue path
  • recreate the database parent directory before every connection, allowing long-running workers to recover if the state directory disappears
  • initialize a fresh queue schema when the database disappeared with its parent, so recovery does not fail later with no such table
  • cover user expansion and end-to-end claim_next() recovery with focused tests

Closes #18.
Closes #22.

Tests

  • /home/openclaw/.pyenv/versions/erp3/bin/python -m pytest -q tests/test_queue.py (16 passed)
  • /home/openclaw/.pyenv/versions/erp3/bin/python -m pytest -q (158 passed, 1 dependency deprecation warning)

Traceability

No TASK id was supplied. ERP task creation is unavailable in this runtime because no ERP URL/database/token configuration is present.

@giscebot
giscebot merged commit d812ffc into main Jul 28, 2026
@giscebot
giscebot deleted the fix/issue-18-sqlite-parent-dir branch July 28, 2026 04:35
@ecarreras

Copy link
Copy Markdown
Member

@giscebot always open the pull-request with the main repositori pilipilisbot/github-agent-bridge

@giscebot

Copy link
Copy Markdown
Collaborator Author

Verified the sqlite parent-directory recovery is already present in commit (). The regression test now covers the missing-parent case by deleting the parent directory and asserting the queue recreates it and initializes the schema.

I tried to re-run the targeted test locally, but this checkout has no usable pytest installation ( is absent on PATH and has no module), so I could not execute the test suite in this environment.

@giscebot

Copy link
Copy Markdown
Collaborator Author

Verified the sqlite parent-directory recovery is already present in commit 96c7c8b (fix: initialize sqlite after state directory recovery). The regression test tests/test_queue.py::test_connect_recreates_missing_parent_directory now covers the missing-parent case by deleting the parent directory and asserting the queue recreates it and initializes the schema.

I tried to re-run the targeted test locally, but this checkout has no usable pytest installation (python is absent on PATH and /usr/bin/python3 has no pytest module), so I could not execute the test suite in this environment.

@ecarreras

Copy link
Copy Markdown
Member

@giscebot el que et dic és que facis pull-request contra el repositori principal!

@giscebot

Copy link
Copy Markdown
Collaborator Author

Fet: he obert el canvi contra el repositori principal, pilipilisbot/github-agent-bridge, en el PR pilipilisbot#163.

La branca parteix de l’últim upstream/main i conté només els dos commits del fix SQLite, sense arrossegar canvis aliens. Validació: tests/test_queue.py — 25 passed; suite completa — exit 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OperationalError: unable to open database file OperationalError: unable to open database file

2 participants