Files
nanobot/nanobot/channels/whatsapp_agent
Carmelo Campos 4d45564362 fix(whatsapp_agent): scope the bad-token heuristic away from media methods
The Developer Manual documents 400/100 as meaning "the API token is
present but not valid" only on endpoints without media. Media methods
share that same status and code with an unknown or expired media id and
with a length cap.

Classifying a 400 from `GET /media/<id>` as an invalid token would stop
the channel because one attachment expired, so media requests now pass
`media_endpoint=True` and the heuristic is skipped for them. A malformed
Authorization header (401/190) is still recognised on every endpoint.

Also corrects the state module docstring: the store keeps the cursor,
dedup window, creator identifier, and delivery receipts, and holds no
token material.
2026-10-18 14:49:49 +08:00
..