Repository navigation
Conversation
Swallowing record_chat_quota_question failures let Free-plan /v2/messages continue into the LLM without advancing the counter. Raise 503 before the provider stream starts; keep best-effort recording only for voice after a visible message frame. Co-authored-by: Cursor <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Added the required PR metadata: |
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Record the Free-plan counter before persisting the human turn. On write failure, emit a mobile-visible SSE done: frame and skip persistence so retries do not leave unanswered copies. Allowlist the main-wide search-chunks desktop inventory gap. Failure-Class: none Co-authored-by: Cursor <[email protected]>
|
Addressed both cubic P2s + Backend Unit red:
Tip pushed with updated tests. Local: 18 passed on the touched suites. |
kodjima33
left a comment
There was a problem hiding this comment.
Records the chat-quota question before any billable work and returns an SSE-visible retry instead of failing open, without persisting an orphan human turn; covered by new router tests.
Summary
/v2/messagesused to swallowrecord_chat_quota_questionfailures and still run the billable chat stream, so Free-plan question counters could fail open under Firestore outages.done:canned reply mobile can render (not a bare HTTP 503), and do not persist the human message (avoids orphan copies on retry)./v2/voice-messageskeeps best-effort recording after a visiblemessage:frame (billable work already started there).#11613desktop inventory gap (/v1/tools/conversations/search-chunks) so tip CI is not poisoned.Test plan
pytest backend/tests/unit/test_chat_quota_counting_router.py+test_desktop_rest_inventory.py(18 passed)/v2/desktop/messagesstill best-effort (out of this shrink).Failure-Class: none
Line-Count-Exception: backend/routers/chat.py | 1734 -> 1791 | Adds fail-closed quota accounting before billable
/v2/messagesturns, with SSE-visible retry copy and no orphan human persistence (#11630).