Fix crash from deprecated Cortex model + Python version constraint - #5
Open
Alishba007 wants to merge 2 commits into
Open
Fix crash from deprecated Cortex model + Python version constraint#5Alishba007 wants to merge 2 commits into
Alishba007 wants to merge 2 commits into
Conversation
- MODEL was set to 'claude-4-sonnet', a Snowflake Cortex model deprecated on 2026-04-14 and fully retired on 2026-06-15. This caused an uncaught HTTPError on every chat request. Updated to claude-sonnet-4-6, the current supported model. - Added error handling around the completion call so future model issues surface as a friendly message instead of a crash. - Constrained requires-python to >=3.12,<3.14 in pyproject.toml, since numba (a transitive dependency via snowflake-ml-python) does not yet support Python 3.14. Without this cap, uv sync fails on any environment (e.g. a fresh Codespace) that defaults to Python 3.14.
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.
Fixes #3
Problem
The app was crashing with an uncaught
requests.exceptions.HTTPErrorwhenever a user sent a chat message. Root cause:
MODELwas set to"claude-4-sonnet", a Snowflake Cortex model that was deprecated on2026-04-14 and fully retired on 2026-06-15. Every call to
complete()therefore hit an unavailable model and Cortex returneda non-2xx response.
While reproducing this locally in a Codespace, I also hit a
dependency install failure:
uv synctried to buildnumba(atransitive dependency via
snowflake-ml-python) on Python 3.14,which
numbadoesn't support yet.pyproject.tomlonly specifiedrequires-python = ">=3.12"with no upper bound, so any environmentthat defaults to 3.14 (like a fresh Codespace) fails to install.
** Fix**
MODELto"claude-sonnet-4-6", the current supportedCortex model.
complete()call inget_response()in a try/exceptso a future model or API issue shows a friendly
st.errormessageinstead of crashing the app.
requires-pythonto">=3.12,<3.14"souv syncresolves to a Python version numba actually supports.
Testing
Verified locally in a GitHub Codespace:
uv syncfails on Python 3.14 (numba build error) andsucceeds cleanly on Python 3.12.
errors with the corrected
requires-python.account (per the README's Snowflake backend setup), which I don't
have access to, so I wasn't able to verify the live model response
end-to-end. Happy to have a maintainer confirm that part.