Skip to content

fix(model-proxy): surface actionable error for location PermissionDeniedError#100

Closed
gastondana627 wants to merge 8 commits intoKaggle:cifrom
gastondana627:fix/location-error-handling
Closed

fix(model-proxy): surface actionable error for location PermissionDeniedError#100
gastondana627 wants to merge 8 commits intoKaggle:cifrom
gastondana627:fix/location-error-handling

Conversation

@gastondana627
Copy link
Copy Markdown

Summary

When Kaggle's model proxy rejects a request due to geo-restriction or account eligibility, the raw openai.PermissionDeniedError gives 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 _LocationAwareOpenAI subclass that intercepts the error and re-raises it with a clear, actionable message explaining:

Changes

  • Added _LOCATION_ERROR_MSG constant with actionable guidance
  • Added _LocationAwareOpenAI(OpenAI) subclass that wraps _request() to catch location-based PermissionDeniedError
  • Swapped OpenAI(...)_LocationAwareOpenAI(...) in ModelProxy.__new__() (one line change)
  • Non-location PermissionDeniedError errors propagate unchanged

Related Issues

Fixes #85
Fixes #96

dolaameng and others added 8 commits March 24, 2026 17:14
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.
Copy link
Copy Markdown
Collaborator

@dolaameng dolaameng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gastondana627 Thanks for contribution! Same as comment here, can you rebase the changes on clean ci branch?

@gastondana627
Copy link
Copy Markdown
Author

@gastondana627 Thanks for contribution! Same as comment here, can you rebase the changes on clean ci branch?

Knocking some things out right now, I'll tend to this tonight or early tomorrow,
Thx!

@neshdev
Copy link
Copy Markdown
Member

neshdev commented Mar 31, 2026

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
We updated the error message to be more descriptive such as which region is being blocked.

@neshdev neshdev closed this Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants