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
f00d8e85
Commit
f00d8e85
authored
May 10, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(studio): normalize catalog identifiers
parent
1137ae24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
studio.py
aisbf/studio.py
+9
-6
test_dashboard_studio.py
tests/routes/test_dashboard_studio.py
+6
-6
No files found.
aisbf/studio.py
View file @
f00d8e85
...
...
@@ -217,9 +217,10 @@ def build_catalog_entry(
def
_build_named_catalog_entry
(
*
,
prefix
:
str
,
kind
:
str
,
scope
:
str
,
owner_id
:
Optional
[
int
],
source_id
:
str
,
target_id
:
str
,
label
:
str
,
description
:
Optional
[
str
],
...
...
@@ -229,8 +230,8 @@ def _build_named_catalog_entry(
entry
=
build_catalog_entry
(
scope
=
scope
,
owner_id
=
owner_id
,
kind
=
prefix
,
source_id
=
prefix
,
kind
=
kind
,
source_id
=
source_id
,
target_id
=
target_id
,
label
=
label
,
description
=
description
,
...
...
@@ -239,7 +240,7 @@ def _build_named_catalog_entry(
availability_reason
=
None
,
metadata
=
metadata
,
)
entry
[
"id"
]
=
f
"{
prefix}/{prefix
}/{target_id}"
entry
[
"id"
]
=
f
"{
kind
}/{target_id}"
return
entry
...
...
@@ -345,9 +346,10 @@ def _build_rotation_entries(scope: str, owner_id: Optional[int], rotations: Dict
config_data
=
rotation_config
if
isinstance
(
rotation_config
,
dict
)
else
rotation_config
.
model_dump
()
entries
.
append
(
_build_named_catalog_entry
(
prefix
=
"rotation"
,
kind
=
"rotation"
,
scope
=
scope
,
owner_id
=
owner_id
,
source_id
=
rotation_id
,
target_id
=
rotation_id
,
label
=
config_data
.
get
(
"model_name"
)
or
rotation_id
,
description
=
config_data
.
get
(
"description"
),
...
...
@@ -368,9 +370,10 @@ def _build_autoselect_entries(scope: str, owner_id: Optional[int], autoselects:
available_models
=
config_data
.
get
(
"available_models"
)
or
[]
entries
.
append
(
_build_named_catalog_entry
(
prefix
=
"autoselect"
,
kind
=
"autoselect"
,
scope
=
scope
,
owner_id
=
owner_id
,
source_id
=
autoselect_id
,
target_id
=
autoselect_id
,
label
=
config_data
.
get
(
"model_name"
)
or
autoselect_id
,
description
=
config_data
.
get
(
"description"
),
...
...
tests/routes/test_dashboard_studio.py
View file @
f00d8e85
...
...
@@ -275,12 +275,12 @@ def test_build_studio_catalog_reuses_catalog_entry_contract_for_non_provider_res
rotation_entry
=
next
(
entry
for
entry
in
catalog
[
"entries"
]
if
entry
[
"kind"
]
==
"rotation"
)
autoselect_entry
=
next
(
entry
for
entry
in
catalog
[
"entries"
]
if
entry
[
"kind"
]
==
"autoselect"
)
assert
rotation_entry
[
"source_id"
]
==
"
rotation
"
assert
rotation_entry
[
"source_id"
]
==
"
team-default
"
assert
rotation_entry
[
"target_id"
]
==
"team-default"
assert
rotation_entry
[
"id"
]
==
"rotation/
rotation/
team-default"
assert
autoselect_entry
[
"source_id"
]
==
"
autoselect
"
assert
rotation_entry
[
"id"
]
==
"rotation/team-default"
assert
autoselect_entry
[
"source_id"
]
==
"
writer
"
assert
autoselect_entry
[
"target_id"
]
==
"writer"
assert
autoselect_entry
[
"id"
]
==
"autoselect/
autoselect/
writer"
assert
autoselect_entry
[
"id"
]
==
"autoselect/writer"
def
test_build_studio_catalog_uses_user_owned_resources_for_user_scope
():
...
...
@@ -322,8 +322,8 @@ def test_build_studio_catalog_uses_user_owned_resources_for_user_scope():
assert
all
(
entry
[
"owner_scope"
]
==
"user"
for
entry
in
catalog
[
"entries"
])
assert
{
entry
[
"id"
]
for
entry
in
catalog
[
"entries"
]}
==
{
"provider/local-openai/gpt-4o-mini"
,
"rotation/
rotation/
my-rotation"
,
"autoselect/
autoselect/
my-autoselect"
,
"rotation/my-rotation"
,
"autoselect/my-autoselect"
,
}
...
...
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