Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
aisbf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
aisbf
Commits
44e9fb65
Commit
44e9fb65
authored
Apr 21, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use 404 status code for missing user providers/rotations/autoselects
parent
42e514c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
main.py
main.py
+16
-9
No files found.
main.py
View file @
44e9fb65
...
...
@@ -8714,10 +8714,10 @@ async def v1_chat_completions(request: Request, body: ChatCompletionRequest):
# PATH 1: Direct provider model (format: {provider}/{model})
if
provider_id
not
in
config
.
providers
:
raise
HTTPException
(
status_code
=
400
,
detail
=
f
"Provider '{provider_id}' not found. Available providers: {list(config.providers.keys())}, or use 'rotation/name' or 'autoselect/name'
"
)
raise
HTTPException
(
status_code
=
404
,
detail
=
f
"User autoselect '{actual_model}' not found. Available: {list(handler.user_autoselects.keys())}
"
)
# Validate kiro credentials before processing request
provider_config
=
config
.
get_provider
(
provider_id
)
...
...
@@ -9212,10 +9212,10 @@ async def rotation_chat_completions(request: Request, body: ChatCompletionReques
if
body
.
model
not
in
config
.
rotations
:
logger
.
error
(
f
"Model '{body.model}' not found in rotations"
)
logger
.
error
(
f
"Available rotations: {list(config.rotations.keys())}"
)
raise
HTTPException
(
status_code
=
400
,
detail
=
f
"Model '{body.model}' not found. Available rotations: {list(config
.rotations.keys())}"
)
raise
HTTPException
(
status_code
=
404
,
detail
=
f
"User rotation '{actual_model}' not found. Available: {list(handler
.rotations.keys())}"
)
logger
.
info
(
f
"Model '{body.model}' found in rotations"
)
logger
.
debug
(
"Handling rotation request"
)
...
...
@@ -11487,7 +11487,7 @@ async def user_chat_completions_by_username(request: Request, username: str, bod
if
provider_name
not
in
handler
.
user_providers
:
raise
HTTPException
(
status_code
=
40
0
,
status_code
=
40
4
,
detail
=
f
"User provider '{provider_name}' not found. Available: {list(handler.user_providers.keys())}"
)
...
...
@@ -11507,6 +11507,13 @@ async def user_chat_completions_by_username(request: Request, username: str, bod
# Keep original model name if no slash
body_dict
[
'model'
]
=
actual_model
# If no model specified, return error
if
not
body_dict
.
get
(
'model'
):
raise
HTTPException
(
status_code
=
400
,
detail
=
"Model name is required in format 'provider/model' or 'model'"
)
if
body
.
stream
:
return
await
handler
.
handle_streaming_chat_completion
(
request
,
provider_name
,
body_dict
)
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment