HERMES-GIELIE/api
Thad Reber cabda6b77a feat: CLI session bridge - read CLI sessions from agent SQLite store
Read CLI sessions from the agent's state.db and surface them in the
WebUI sidebar alongside local sessions, with read-only display and
import-on-click to avoid data duplication.

Key changes:
- get_cli_sessions(): reads sessions list via parameterized SQL,
  wrapped in sqlite3 context manager (no connection leaks)
- get_cli_session_messages(): reads messages for a CLI session
  via parameterized SQL, also context-managed
- GET /api/sessions: merges WebUI + CLI sessions with dedup
  (WebUI takes priority on same session_id)
- GET /api/session: falls back to CLI store if not a WebUI session
- POST /api/session/import_cli: imports a CLI session into the
  WebUI store (idempotent, no duplicates on re-import)
- Imported sessions use get_last_workspace() for the workspace field
  (not a hardcoded string) and carry the active profile tag
- CSS: .cli-session with ::after 'cli' indicator (no theme changes)

Fixes review feedback:
- SQLite connections use 'with' context managers (no leaks)
- Workspace uses real path via get_last_workspace()
- Profile awareness via api.profiles.get_active_profile_name()
- Parameterized SQL queries throughout (no injection risk)
- Graceful fallback when sqlite3 or state.db is missing
2026-04-03 19:54:54 -07:00
..
__init__.py Hermes Web UI — Sprints 11-14: multi-provider models, settings, session QoL, alerts, polish 2026-03-31 07:02:47 +00:00
auth.py fix(auth): redirect to /login when auth is enabled and accessing root 2026-04-03 06:21:04 -07:00
config.py feat: token usage toggle (setting + /usage command) + timestamp fixes 2026-04-03 19:11:36 -07:00
helpers.py feat: Sprint 19 — password auth, security headers, login page 2026-04-03 05:53:26 -07:00
models.py feat: CLI session bridge - read CLI sessions from agent SQLite store 2026-04-03 19:54:54 -07:00
profiles.py fix(review): 4 issues found in agent review of PR #45 2026-04-03 13:58:43 -07:00
routes.py feat: CLI session bridge - read CLI sessions from agent SQLite store 2026-04-03 19:54:54 -07:00
streaming.py feat: token usage toggle (setting + /usage command) + timestamp fixes 2026-04-03 19:11:36 -07:00
upload.py fix: stop leaking stack traces to clients in HTTP 500 responses 2026-04-03 06:41:32 -07:00
workspace.py fix: workspace isolation, session filtering, and clean migration path 2026-04-03 20:01:12 +00:00