Skip to content

Commit efd50a0

Browse files
docs: correct inaccurate API and model docstrings from PR review
1 parent b1b04be commit efd50a0

5 files changed

Lines changed: 18 additions & 8 deletions

File tree

api/composers.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,11 @@ def get_composer(composer_id: str) -> tuple[Response, int] | Response:
134134
composer_id: Composer UUID.
135135
136136
Returns:
137-
Composer JSON from per-workspace storage or global fallback. 404 when not
138-
found or schema drift blocks serving; 500 on unexpected failure.
137+
Composer JSON from per-workspace storage or global fallback. Per-workspace
138+
schema drift is logged and skipped before global fallback is attempted.
139+
404 when the composer is absent from both stores (``{"error": "Composer not found"}``)
140+
or when the global row fails validation (``{"error": "Composer schema drift"}``).
141+
500 on unexpected failure.
139142
"""
140143
try:
141144
workspace_path = resolve_workspace_path()

api/logs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ def get_logs() -> tuple[Response, int] | Response:
3333
"""List chat logs from global and per-workspace storage (GET /api/logs).
3434
3535
Returns:
36-
JSON array of log summary objects (id, title, timestamp, etc.). 500 on
36+
JSON ``{"logs": [<log summary>, ...]}`` where each summary has ``id``,
37+
``title``, ``timestamp``, etc. 500 with ``{"error": ..., "logs": []}`` on
3738
unexpected failure.
3839
"""
3940
try:

api/pdf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ def _safe_text(text: str) -> str:
4949
def generate_pdf() -> tuple[Response, int] | Response:
5050
"""Render markdown chat content as a PDF download (POST /api/generate-pdf).
5151
52-
Body: ``{"markdown": "...", "title": "..."}``.
52+
Body (optional): ``{"markdown": "...", "title": "..."}``. Missing keys
53+
default to ``""`` and ``"Chat"`` respectively.
5354
5455
Returns:
55-
``application/pdf`` attachment on success. 400/500 JSON errors on failure.
56+
``application/pdf`` attachment on success. 500 JSON error on failure.
5657
"""
5758
try:
5859
body = request.get_json(silent=True) or {}

api/workspaces.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,17 @@ def get_workspace_tabs(workspace_id: str) -> tuple[Response, int] | Response:
169169
"""List conversation tabs for a workspace (GET /api/workspaces/<id>/tabs).
170170
171171
Args:
172-
workspace_id: Storage folder name or ``cli:<project_id>``.
172+
workspace_id: Storage folder name, ``global`` for unassigned chats, or
173+
``cli:<project_id>``.
173174
174175
Query params: ``summary=1`` for lightweight tab headers only; ``nocache=1`` to
175176
bypass cache on summary requests.
176177
177178
Returns:
178-
Tabs payload from :func:`services.workspace_tabs` helpers. 500 on failure.
179+
Tabs payload from :func:`services.workspace_tabs` helpers (typically
180+
``{"tabs": [...]}`` with optional ``warnings``). May return 200 with an
181+
empty ``tabs`` list when upstream SQLite reads fail silently; 404 when
182+
global storage is missing; 500 on unexpected route-level failure.
179183
"""
180184
if workspace_id.startswith("cli:"):
181185
try:

models/cli_session.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def from_dict(cls, raw: dict[str, Any]) -> "CliSessionMeta":
2626
Validated :class:`CliSessionMeta`.
2727
2828
Raises:
29-
SchemaError: When ``latestRootBlobId`` is missing or not a string.
29+
SchemaError: When ``latestRootBlobId`` is missing, falsey (e.g.
30+
empty string or ``None``), or not a string.
3031
"""
3132
raw = require_dict(raw, model="CliSessionMeta", field="meta")
3233
latest = require_truthy(

0 commit comments

Comments
 (0)