feat: glass ui pass

This commit is contained in:
Brooklyn Nicholson
2026-05-16 19:21:33 -05:00
parent 062eed654d
commit d67a438fec
104 changed files with 5173 additions and 1919 deletions
+16 -3
View File
@@ -205,6 +205,7 @@ CREATE TABLE IF NOT EXISTS sessions (
cache_read_tokens INTEGER DEFAULT 0,
cache_write_tokens INTEGER DEFAULT 0,
reasoning_tokens INTEGER DEFAULT 0,
cwd TEXT,
billing_provider TEXT,
billing_base_url TEXT,
billing_mode TEXT,
@@ -690,13 +691,14 @@ class SessionDB:
system_prompt: str = None,
user_id: str = None,
parent_session_id: str = None,
cwd: str = None,
) -> None:
"""Shared INSERT OR IGNORE for session rows."""
def _do(conn):
conn.execute(
"""INSERT OR IGNORE INTO sessions (id, source, user_id, model, model_config,
system_prompt, parent_session_id, started_at)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)""",
system_prompt, parent_session_id, cwd, started_at)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)""",
(
session_id,
source,
@@ -705,6 +707,7 @@ class SessionDB:
json.dumps(model_config) if model_config else None,
system_prompt,
parent_session_id,
cwd,
time.time(),
),
)
@@ -741,6 +744,16 @@ class SessionDB:
)
self._execute_write(_do)
def update_session_cwd(self, session_id: str, cwd: str) -> None:
"""Persist the session working directory when a frontend knows it."""
if not session_id or not cwd:
return
def _do(conn):
conn.execute("UPDATE sessions SET cwd = ? WHERE id = ?", (cwd, session_id))
self._execute_write(_do)
def update_system_prompt(self, session_id: str, system_prompt: str) -> None:
"""Store the full assembled system prompt snapshot."""
def _do(conn):
@@ -1343,7 +1356,7 @@ class SessionDB:
for key in (
"id", "ended_at", "end_reason", "message_count",
"tool_call_count", "title", "last_active", "preview",
"model", "system_prompt",
"model", "system_prompt", "cwd",
):
if key in tip_row:
merged[key] = tip_row[key]