fix(model-proxy): surface actionable error for location PermissionDeniedError#100
Closed
gastondana627 wants to merge 8 commits intoKaggle:cifrom
Closed
fix(model-proxy): surface actionable error for location PermissionDeniedError#100gastondana627 wants to merge 8 commits intoKaggle:cifrom
gastondana627 wants to merge 8 commits intoKaggle:cifrom
Conversation
Adds a kaggle-bench CLI with two subcommands: - run: publish and run a local benchmark script on Kaggle - fork: pull an existing Kaggle benchmark notebook for local editing Extends the BenchmarkNotebookClient SDK from PR Kaggle#90 with a command-line interface so users can trigger benchmark runs directly from the terminal without writing Python boilerplate. Tests: 5 new unit tests covering help output, argument parsing, and correct delegation to BenchmarkNotebookClient.
This was referenced Mar 28, 2026
dolaameng
requested changes
Mar 30, 2026
Collaborator
dolaameng
left a comment
There was a problem hiding this comment.
@gastondana627 Thanks for contribution! Same as comment here, can you rebase the changes on clean ci branch?
Author
Knocking some things out right now, I'll tend to this tonight or early tomorrow, |
Member
|
Thanks for the PR, but this is too much of a change to the core library code for handling something very specific for a single client. This is not working because of a restricted region. See https://ai.google.dev/gemini-api/docs/available-regions |
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
When Kaggle's model proxy rejects a request due to geo-restriction or account eligibility, the raw
openai.PermissionDeniedErrorgives users no useful context - just a cryptic traceback. This has been reported in issues #85 and #96, where ALL 27 models across all providers became non-functional for affected users.This PR adds a thin
_LocationAwareOpenAIsubclass that intercepts the error and re-raises it with a clear, actionable message explaining:Changes
_LOCATION_ERROR_MSGconstant with actionable guidance_LocationAwareOpenAI(OpenAI)subclass that wraps_request()to catch location-basedPermissionDeniedErrorOpenAI(...)→_LocationAwareOpenAI(...)inModelProxy.__new__()(one line change)PermissionDeniedErrorerrors propagate unchangedRelated Issues
Fixes #85
Fixes #96