Problem
When the automation service runs from a source checkout with SQLite, startup migration discovery first checks packaged migrations under openhands/automation/migrations, then falls back to package_dir.parent / "migrations". With the current source layout, package_dir is openhands/automation, so that fallback resolves to openhands/migrations, but the repo-root migrations directory is migrations/.
This means source-tree SQLite startup can fail to find/apply Alembic migrations, or run with a stale local schema, even though migrations exist at the repo root.
Expected behavior
Source-tree SQLite startup should locate repo-root migrations at package_dir.parent.parent / "migrations" while preserving the packaged wheel path.
Suggested fix
Update the migration discovery fallback in openhands/automation/app.py to check the actual repo-root path for source checkouts. Optionally keep the current package_dir.parent / "migrations" fallback as a legacy fallback if needed.
Context
This was noticed while validating automation PR #120, but it is a separate migration-discovery concern and should not be bundled into that PR.
This issue was created by an AI agent (OpenHands) on behalf of the user.
Problem
When the automation service runs from a source checkout with SQLite, startup migration discovery first checks packaged migrations under
openhands/automation/migrations, then falls back topackage_dir.parent / "migrations". With the current source layout,package_dirisopenhands/automation, so that fallback resolves toopenhands/migrations, but the repo-root migrations directory ismigrations/.This means source-tree SQLite startup can fail to find/apply Alembic migrations, or run with a stale local schema, even though migrations exist at the repo root.
Expected behavior
Source-tree SQLite startup should locate repo-root migrations at
package_dir.parent.parent / "migrations"while preserving the packaged wheel path.Suggested fix
Update the migration discovery fallback in
openhands/automation/app.pyto check the actual repo-root path for source checkouts. Optionally keep the currentpackage_dir.parent / "migrations"fallback as a legacy fallback if needed.Context
This was noticed while validating automation PR #120, but it is a separate migration-discovery concern and should not be bundled into that PR.
This issue was created by an AI agent (OpenHands) on behalf of the user.