Repository navigation
Conversation
…A_DIR `offeru start` set OFFERU_DATA_DIR but kept any inherited DATABASE_URL via setdefault. A stale relative URL from an old repo-root .env (sqlite:///./offeru.db) sent agent runs, actions and audit logs to a DB in the launch directory, while sessions and config went to the data dir. Later it looked like run history and audit had been lost. - runtime_paths: sqlite_path_from_url / database_location_problem flag a relative sqlite path or one outside the data dir (postgres and :memory: are never flagged) - entry.configure: refuse to start with an actionable message; OFFERU_ALLOW_EXTERNAL_DATABASE=1 keeps an external DB with a warning - diagnostics bundle: data_safety.database_location_mismatch (verdict only, no path) CI is unaffected: build.yml starts backend/run_server.py, not app.entry, and release-lite.yml runs `offeru start` without DATABASE_URL.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
offeru startsetsOFFERU_DATA_DIR, butentry.configure()usedos.environ.setdefault("DATABASE_URL", ...). An inherited stale value, usually a relativesqlite:///./offeru.dbfrom an old repo-root.env, wins. Sessions and config go to the data dir, while agent runs, actions and operation audit go to a DB in whatever directory the process started in. Nothing is deleted, but history and audit look lost. This came up during the agent E2E audit: the sessions of 5 runs had no matching rows in the data-dir DB, and the runs turned up in the launch directory'sofferu.db.Change
runtime_paths.database_location_problem(url, data_dir): flags a relative sqlite path or one outside the data dir. Postgres and:memory:are never flagged.entry.configure(): refuses to start with a Chinese message naming the cause and the fix.OFFERU_ALLOW_EXTERNAL_DATABASE=1keeps an external DB and prints a warning. With no inherited URL, behavior is unchanged (<data dir>/djm.db).data_safety.database_location_mismatchis true, false, or null (null when no data dir is set). It carries the verdict only, never a path.Not affected
build.ymlstartsbackend/run_server.py(notapp.entry), andrelease-lite.ymlrunsofferu startwithoutDATABASE_URL.conftest.pyalready clearsDATABASE_URL.Tests
backend/tests/test_runtime_database_guard.py: 8 passed.-k "entry or runtime or data_safety or diagnostics or database": 17 passed.Follow-up (not in this PR): running
app.maindirectly through uvicorn in dev doesn't go throughentry.configure, so it is only covered by the diagnostics flag.Rebased onto main (6ef9569) and reopened; supersedes closed #152.
Local backend tests: no new failures vs main (the 8 failing on main are 7 Windows-only test_boss_sync WinError 193 and the change-capture FK test fixed by #166).