fix(backend): replace sunset Assistants file-chat with Chat Completions - #12284
Open
Git-on-my-level wants to merge 4 commits into
Open
fix(backend): replace sunset Assistants file-chat with Chat Completions#12284Git-on-my-level wants to merge 4 commits into
Git-on-my-level wants to merge 4 commits into
Conversation
OpenAI retired Assistants on 2026-08-26, so every /v1/threads create 404s and non-vision file chat is down. Stream PDFs as Chat Completions file parts on gpt-4.1 (documented file-input contract) and keep images on the verified gpt-5.6-luna vision lane. Failure-Class: FC-pinned-vendor-request-contract-retired Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: multica-agent <github@multica.ai>
Unpacking a token-budget dict into create() is untyped and fails pyright. Failure-Class: FC-pinned-vendor-request-contract-retired Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: multica-agent <github@multica.ai>
CI ran each unit file in its own process; incomplete BYOK/LLM stubs and a duration-guard race on desktop transcribe failed the backend suite. Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: multica-agent <github@multica.ai>
Upstream 7c900a9 moved the Soniox client into utils.stt.soniox but left SafeSonioxSocket / process_audio_soniox imported in streaming.py without a re-export marker; receiver.py and test_soniox_streaming.py import them through utils.stt.streaming, so strict pyright fails main and every PR merge ref. Carry the one-line marker so this backend CI lane can go green; matches the existing SafeDeepgramSocket compat re-export convention on the previous line. Co-authored-by: multica-agent <github@multica.ai>
Git-on-my-level
force-pushed
the
fix/sca-362-file-chat-completions
branch
from
August 27, 2026 18:02
4f6d9f1 to
ebd3618
Compare
Collaborator
Author
|
Backend unit suite unblocked — the failure was not in this PR's diff. Upstream main has been failing its own Backend Unit Tests since the Soniox module refactor (
|
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OpenAI retired the Assistants API on 2026-08-26. Production Cloud Run
backend/v2/messagesfile-chat has been 100% down on the non-vision path since 20:02Z: everyPOST /v1/threadsis 404, wrapped asRuntimeError('failed to create OpenAI thread').This PR replaces that retired surface with the already-healthy direct Chat Completions lane (SCA-361 RCA):
gpt-5.6-lunaas base64image_url(live-verified).{"type":"file","file":{"file_id":…}}ongpt-4.1(documented file-input contract; luna is not pinned for an untested file-part capability).purpose=vision; PDFspurpose=user_data; other docs rejected at attach asUnsupportedChatFileError.openai_thread_id/openai_assistant_idremain readable on old session docs.unsupported_attachment/provider_rejectedvsstream_failure) withstatus_code+ sanitizedparamonly.search_files_toolrides the same replacement and still returns a soft error string.Closes #3361
Closes SCA-362
RCA (SCA-361)
Last-24h
chat_responsefailures were the Assistants file-chat lane. Historical ~2% were Assistants 400s (message-create / run-create). The hard break is the sunset: 8/8 thread creates 404 after 2026-08-26 20:02Z. Files API andchat/completions200 on the same key. Agenticsearch_files_tool404s were swallowed as journey success.Test plan
file_id→ typedunsupported_attachmenterror frame + journey failureUnsupportedChatFileError; PDF →purpose=user_datasearch_files_toolprovider failure returns soft error string without raisingVerification
Focused backend unit tests for the file-chat / graph / upload / tool / inventory surfaces passed locally (
25 passedon the new Completions suite plus the updated neighbors).Failure-Class: FC-pinned-vendor-request-contract-retired