Send auth token when fetching Duck.ai models - #9764
Open
malmstein wants to merge 1 commit into
Open
Conversation
The models endpoint only returns the editorial label used for picker sublines when the request is authenticated, so pass the subscription access token as a bearer header. The header is gated behind updatedPickers, keeping the request anonymous until the new pickers consume the labels, and a failed token lookup falls back to an unauthenticated fetch rather than losing the model list. Re-fetch now also keys off subscription status, not just entitlements: signing in or out changes whether labels come back, while entitlements stay empty either way when there is no subscription. https://app.asana.com/1/137249556945/task/1218299204283397 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.

Task/Issue URL: https://app.asana.com/1/137249556945/task/1218299204283397
Tech Design URL (if applicable):
API Proposals URL(s) (if applicable): None
Description
/duckchat/v1/modelsonly returns the editoriallabelbehind each model, which the updatedpicker shows as a subline, when the request carries an auth token. This passes the
subscription access token as a bearer header, gated behind
updatedPickersso the requeststays anonymous until the new pickers consume the labels. A failed token lookup falls back to
an unauthenticated fetch instead of losing the model list.
The re-fetch trigger now keys off subscription status as well as entitlements. Entitlements
emit an empty set whenever there is no active subscription, so they don't signal a sign-in on
their own. Sign-in is covered too: signInV2 refreshes subscription data, which emits a new
status. The one gap is signing in to an account with no subscription record, where that refresh
throws and emits nothing; the picker's on-attach fetch picks the labels up next time it opens.
Stacked on #9759.
Steps to test this PR
Feature 1
updatedPickersoff, open Duck.ai and confirm models still load, and that therequest to
/duckchat/v1/modelscarries no Authorization header (Proxyman or charles)updatedPickersin the internal feature flag menu, force stop and relaunchlabelis null in theresponse
carries
Authorization: Bearer ...and the response haslabelset on some modelsUI changes
None