You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(tests): test_public_chat_history.py::test_sessions_returns_list_shape — handle list-shaped link response #766
tests/test_public_chat_history.py::TestPublicSessionsEndpoints::test_sessions_returns_list_shape calls links_resp.json().get("links", []) but the public-links endpoint (/api/agents/{name}/public-links) returns a bare list, so .get(...) raises:
AttributeError: 'list' object has no attribute 'get'
Context
Discovered via full test suite run on 2026-05-09:
FAILED test_public_chat_history.py::TestPublicSessionsEndpoints::test_sessions_returns_list_shape
E AttributeError: 'list' object has no attribute 'get'
test_public_chat_history.py:79
The test should either (a) tolerate both shapes or (b) consume the bare list directly if that's the intended contract.
Acceptance Criteria
Confirm intended response shape by reading routers/public_links.py (GET /api/agents/{name}/public-links handler).
Fix the test:
If the endpoint returns a bare list (current behavior): links = links_resp.json().
If the endpoint should return {links: [...]}: fix the endpoint instead, then leave the test as-is.
If both shapes are valid: links = data["links"] if isinstance(data, dict) else data.
Test passes when run (a) standalone, (b) in the full integration suite.
Reproduction
cd tests &&source .venv/bin/activate
pytest test_public_chat_history.py::TestPublicSessionsEndpoints::test_sessions_returns_list_shape -v
Why this is small
A 1-2 line test fix once the endpoint contract is confirmed. Likely a test bug (envelope assumption) introduced when public-links endpoint shape stabilized.
Related
routers/public_links.py — owns the contract.
Public chat history feature flow: docs/memory/feature-flows/public-chat.md.
Activity
fix(tests): handle bare-list response from public-links endpoint (#766)…
vybe commentedon Jun 1, 2026
Shipped in v0.6.0 (released via #998).