Highlights
Agents (and humans) can now list, add, switch, and remove workspaces at runtime with no server restart. Switching between already-opened workspaces is sub-millisecond — the storage registry keeps each workspace's SQLite connection warm, so switching is just a pointer flip plus a settings patch under an asyncio.Lock.
opendb_list_workspaces() # see what's registered
opendb_use_workspace(id_or_root="a3f2b1c8") # switch by id
opendb_use_workspace(id_or_root="D:/work/openDB") # …or by path
opendb_add_workspace(root="./new_project", switch=true)
opendb_current_workspace()
opendb_remove_workspace(id_or_root="e18a9f03")
Added
- Global workspace registry persisted at
~/.opendb/workspaces.json(overridable viaFILEDB_STATE_DIR). Entries carryid,name,root,backend,created_at,last_used_at. - Five new REST endpoints under
/workspaces:GET /workspaces— list all registered workspaces (active first)POST /workspaces— register (optionally switch) a new workspaceGET /workspaces/active— current active workspacePUT /workspaces/active— switch by id or root pathDELETE /workspaces/{id}— unregister (files untouched;?force=trueto drop the active one)
- Five new MCP tools:
opendb_list_workspaces,opendb_current_workspace,opendb_use_workspace,opendb_add_workspace,opendb_remove_workspace. opendb_info/GET /inforesponses now embed aworkspaceblock with the active workspace's identity so agents can answer "which workspace am I in?" in a single call.- New CLI subcommand group:
opendb workspace list | add | use | current | remove. CHANGELOG.md(Keep a Changelog format) and.github/pull_request_template.md.
Changed
- Factored
Workspace.init()— the settings-patching block and parser registration became reusable helpers (apply_workspace_config,_ensure_parsers_registered) so the runtime switch path and the embedded-modeWorkspaceclass apply workspace config identically. opendb serve(SQLite mode) auto-registers the startup workspace in the global registry during lifespan setup.- README: new workspace management section, tool count updated 7 → 12, REST table +
FILEDB_STATE_DIRconfig entry.
Tests
13 new workspace tests. 225 total, all passing (up from 212).
Upgrade notes
- No breaking changes. Existing
opendb serve -w <path>andopendb serve-mcp -w <path>invocations continue to work — the startup workspace is now also registered in the global registry so you can switch away from it at runtime. - The registry file lives at
~/.opendb/workspaces.jsonby default. SetFILEDB_STATE_DIRif you want it elsewhere (also useful for CI / isolated tests).
Full Changelog: v1.4.0...v1.5.0