-
Notifications
You must be signed in to change notification settings - Fork 35
[codex] Guard dev session schemas against silent drift #431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Browser Use Desktop Agent Notes | ||
|
|
||
| ## Local Dev Profiles | ||
|
|
||
| - The app's runtime database lives under Electron `userData`, not under the git | ||
| worktree. Do not assume the default profile when working across branches. | ||
| - Use `task worktree:profile:path` to get this branch's isolated profile path. | ||
| It resolves to `.task/user-data/<current-branch>` by default. | ||
| - Use `task worktree:up` to start the app against that isolated profile. | ||
| - Use `task worktree:profile:clean FORCE=1` to delete this branch's isolated | ||
| profile after quitting the app. | ||
| - Use `task db:worktree:copy FROM=default` to copy `sessions.db` from the | ||
| platform default profile into this branch profile. Pass `FROM=branch:<name>` | ||
| to copy from another branch profile, including branch names with `/`. Use an | ||
| absolute path, `./relative/path`, `~/path`, or `FROM=path:<path>` for explicit | ||
| filesystem paths. Pass `FORCE=1` if the target DB already exists. | ||
| - Use `task db:worktree:doctor` after copying or when local task runs fail. It | ||
| compares the target `sessions.db` schema version and schema ID against the | ||
| current checkout's `src/main/sessions/schema-manifest.json`. | ||
| - If the app was launched with `AGB_USER_DATA_DIR`, run `task agent:run` with | ||
| the same `AGB_USER_DATA_DIR`. The local task runner reads | ||
| `<userData>/local-task-server.json`; pointing the CLI at a different profile | ||
| will miss the running app even if `sessions.db` is valid. | ||
| - Quit the app before copying or cleaning profile files. SQLite WAL files and | ||
| Electron runtime files can be open while the app is running. | ||
|
|
||
| ## Session Schema Changes | ||
|
|
||
| - `DB_SCHEMA_VERSION` gates migrations at runtime. | ||
| - `src/main/sessions/schema-manifest.json` tracks the expected fresh schema ID | ||
| for CI/main drift detection. | ||
| - Run `task db:schema:check` after touching `SessionDb` migrations. | ||
| - Run `task db:schema:update` only after an intentional schema change. |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: The new
db:schema:*scripts use single-quoted--compiler-optionsJSON, which is not cross-shell safe and can fail on Windows npm runs. Use escaped double quotes so ts-node receives valid JSON on all platforms.Prompt for AI agents