fix: correct 9 inaccurate type hints

- get_password_hash() -> str | None (not bool, returns hash or None)
- parse_cookie() -> str | None (not None, returns cookie value)
- Session.__init__ session_id: str (not int, uuid hex)
- Session.__init__ project_id: str (not int)
- Session.__init__ **kwargs (remove incorrect dict annotation)
- Session.load() remove -> None (returns Session | None)
- import_cli_session session_id: str (not int)
- sync_session_start session_id: str (not int)
- sync_session_usage session_id: str (not int)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nathan Esquenazi
2026-04-04 23:54:58 -07:00
parent 4d333acbbc
commit 74fcd2e0ab
3 changed files with 9 additions and 9 deletions

View File

@@ -43,7 +43,7 @@ def _get_state_db():
return None
def sync_session_start(session_id: int, model=None) -> None:
def sync_session_start(session_id: str, model=None) -> None:
"""Register a WebUI session in state.db (idempotent).
Called when a session's first message is sent.
"""
@@ -65,7 +65,7 @@ def sync_session_start(session_id: int, model=None) -> None:
pass
def sync_session_usage(session_id: int, input_tokens: int=0, output_tokens: int=0,
def sync_session_usage(session_id: str, input_tokens: int=0, output_tokens: int=0,
estimated_cost=None, model=None, title: str=None) -> None:
"""Update token usage and title for a WebUI session in state.db.
Called after each turn completes. Uses absolute=True to set totals