Skip to content

SQLite migration discovery fallback points to wrong source-tree path #128

@neubig

Description

@neubig

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.

Metadata

Metadata

Assignees

Labels

openhandsOpenHands-related issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions