Repository navigation
fix: keep Anthropic BYOK notes from failing conversation processing - #21131
Git-on-my-level merged 3 commits into
Conversation
The notes worker-loop clone only accepted ChatOpenAI, so a provider-switched Anthropic key raised TypeError and the conversation returned HTTP 500. Co-authored-by: Cursor <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Root cause of the red unit shards (diagnosed from run 38048116131 logs): This PR adds a module-level A fix (lazy/TYPE_CHECKING-gated anthropic import) is being pushed to this branch. |
A module-level langchain_anthropic import fails when unit tests have replaced langchain_core in sys.modules. Co-authored-by: Cursor <[email protected]>
…sport Catch the Anthropic import failure so path-loaded unit tests still collect, while pyright keeps the real ChatAnthropic narrowing. Co-authored-by: Cursor <[email protected]>
|
errfix finisher: this PR has been open >3 days without merging — escalating to a human. |
Summary
Error group:
{"source": "gcp", "service": "backend", "group": "process_conversation.py:620 | fastapi.exceptions.HTTPException: 500: Error processing conversation, please try again later", "count": 109, "id": "gcp:backend-process-conversation-py-620-fastapi-exceptions-httpexception-500-error-processing-conversation-please-"}Root cause:
_get_structuredwraps the notes failure as that generic HTTP 500. The chained error isTypeError: Shaped notes requires the configured OpenAI-compatible notes laneinisolated_notes_model. Provider-switched BYOK notes useChatAnthropic, and the worker-loop transport clone only acceptedChatOpenAI, so those conversations never reached the model.Fix: clone the Anthropic async client onto a per-invocation HTTP transport the same way the OpenAI lane already does, and leave the cached client untouched.
Verification
Failure-Class: none