Repository navigation
feat(core): support native Snowflake Cortex authentication - #47156
Merged
Merged
Conversation
This was referenced Sep 3, 2026
# Conflicts: # packages/core/src/plugin/provider/snowflake-cortex.ts # packages/core/test/plugin/provider-snowflake-cortex.test.ts
Collaborator
Author
|
Follow-up: investigate shared OAuth refresh and authentication retry behavior across providers. Consolidate expiry-based and forced refresh into one per-credential operation that coalesces concurrent refreshes and persists the result once. Replace Snowflake’s attempt === 2 guard with an explicit bounded authentication-recovery policy, deciding the allowance boundary against V1 behavior. Cover concurrent requests, refresh-token rotation, 503 → 401 → recovery, and repeated 401 termination. Keep this separate from the remaining provider ports (Poe browser OAuth; GitLab OAuth and workflow discovery). |
jinhuang712
pushed a commit
to jinhuang712/opencode
that referenced
this pull request
Sep 26, 2026
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
Supersedes #47135, #47139, and #47151. Changes only the existing Snowflake plugin and its tests. Updated against the latest
v2, including the@opencodepackage names and current session request API.compatibility.maxTokensField, removing Snowflake's AI SDK hook/fetch wrapper and redundant package overrides. The native stream parser already supports empty delta roles, so stream-role rewriting is unnecessary.SNOWFLAKE_CORTEX_TOKENandSNOWFLAKE_CORTEX_PATas credential environment variables.SNOWFLAKE_ACCOUNTconfigures the endpoint and is never an API key.401and let the session runner retry.Verification
The cleanup pass removes 28 lines: the plugin is 264 lines and its tests are 290. It removes redundant refresh-token arguments and callback wrappers, and shares expired-credential fixtures, stop-response assertions, and polling setup. All six Snowflake tests and their 42 assertions are retained.
Six focused Snowflake integration tests cover:
Token/model responses are scripted at the HTTP-client boundary; browser callbacks use a real loopback listener. Requests run through the actual model resolver, session request preparation, and native LLM stream.
Checks:
bun typecheckinpackages/core— passed.bun test test/plugin/provider-snowflake-cortex.test.ts test/integration.test.ts test/model-resolver.test.ts test/session-model-request.test.tsinpackages/core— 67 pass.git diff --check— passed.No live Snowflake account authorization was performed.