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
5f6963f4
Commit
5f6963f4
authored
Apr 21, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix user provider config assignment - set handler.provider_config to user config
parent
01f51b97
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
12 deletions
+39
-12
__init__.py
aisbf/providers/__init__.py
+2
-1
kilo.py
aisbf/providers/kilo.py
+21
-7
qwen.py
aisbf/providers/qwen.py
+16
-4
No files found.
aisbf/providers/__init__.py
View file @
5f6963f4
...
...
@@ -124,9 +124,10 @@ def get_provider_handler(provider_id: str, api_key: Optional[str] = None, user_i
handler
.
user_id
=
user_id
# Base class already handles default error tracking and rate limit for user providers
# S
tore user provider config on the handler for later use
# S
et provider config to the user-specific config instead of loading from global config
if
user_id
is
not
None
and
provider_config
is
not
None
:
handler
.
user_provider_config
=
provider_config
handler
.
provider_config
=
provider_config
logger
.
info
(
f
"Handler created: {handler.__class__.__name__}"
)
logger
.
info
(
f
"=== get_provider_handler END ==="
)
...
...
aisbf/providers/kilo.py
View file @
5f6963f4
...
...
@@ -44,6 +44,14 @@ class KiloProviderHandler(BaseProviderHandler):
self
.
provider_config
=
config
.
get_provider
(
provider_id
)
# Unified auth config with backward compatibility
# Handle both dict (user) and object (global) config formats
if
isinstance
(
self
.
provider_config
,
dict
):
kilo_config
=
self
.
provider_config
.
get
(
'auth_config'
)
if
not
kilo_config
:
kilo_config
=
self
.
provider_config
.
get
(
'kilo_config'
)
if
not
kilo_config
:
kilo_config
=
self
.
provider_config
.
get
(
'kiro_config'
)
else
:
kilo_config
=
getattr
(
self
.
provider_config
,
'auth_config'
,
None
)
if
not
kilo_config
:
kilo_config
=
getattr
(
self
.
provider_config
,
'kilo_config'
,
None
)
...
...
@@ -55,6 +63,9 @@ class KiloProviderHandler(BaseProviderHandler):
self
.
_use_api_key_auth
=
False
# If explicit API key is provided OR provider config has API key configured, use direct API key authentication - NO OAUTH
if
isinstance
(
self
.
provider_config
,
dict
):
configured_api_key
=
self
.
provider_config
.
get
(
'api_key'
)
else
:
configured_api_key
=
getattr
(
self
.
provider_config
,
'api_key'
,
None
)
if
(
self
.
api_key
and
self
.
api_key
!=
"placeholder"
)
or
(
configured_api_key
and
configured_api_key
!=
"placeholder"
):
self
.
_use_api_key_auth
=
True
...
...
@@ -96,6 +107,9 @@ class KiloProviderHandler(BaseProviderHandler):
logger
.
info
(
f
"KiloProviderHandler.__init__: self.oauth2 type={type(self.oauth2)}, value={self.oauth2}"
)
if
isinstance
(
self
.
provider_config
,
dict
):
configured_endpoint
=
self
.
provider_config
.
get
(
'endpoint'
)
else
:
configured_endpoint
=
getattr
(
self
.
provider_config
,
'endpoint'
,
None
)
if
configured_endpoint
:
endpoint
=
configured_endpoint
.
rstrip
(
'/'
)
...
...
aisbf/providers/qwen.py
View file @
5f6963f4
...
...
@@ -76,6 +76,9 @@ class QwenProviderHandler(BaseProviderHandler):
self
.
provider_config
=
config
.
get_provider
(
provider_id
)
# Get credentials file path from config
if
isinstance
(
self
.
provider_config
,
dict
):
qwen_config
=
self
.
provider_config
.
get
(
'qwen_config'
)
else
:
qwen_config
=
getattr
(
self
.
provider_config
,
'qwen_config'
,
None
)
credentials_file
=
None
if
qwen_config
and
isinstance
(
qwen_config
,
dict
):
...
...
@@ -174,6 +177,9 @@ class QwenProviderHandler(BaseProviderHandler):
logger
=
logging
.
getLogger
(
__name__
)
# Check if API key is configured (vs OAuth2)
if
isinstance
(
self
.
provider_config
,
dict
):
qwen_config
=
self
.
provider_config
.
get
(
'qwen_config'
)
else
:
qwen_config
=
getattr
(
self
.
provider_config
,
'qwen_config'
,
None
)
api_key
=
None
if
qwen_config
and
isinstance
(
qwen_config
,
dict
):
...
...
@@ -250,6 +256,9 @@ class QwenProviderHandler(BaseProviderHandler):
logger
=
logging
.
getLogger
(
__name__
)
# Check if API key is configured (vs OAuth2)
if
isinstance
(
self
.
provider_config
,
dict
):
qwen_config
=
self
.
provider_config
.
get
(
'qwen_config'
)
else
:
qwen_config
=
getattr
(
self
.
provider_config
,
'qwen_config'
,
None
)
api_key
=
None
if
qwen_config
and
isinstance
(
qwen_config
,
dict
):
...
...
@@ -531,6 +540,9 @@ class QwenProviderHandler(BaseProviderHandler):
await
self
.
apply_rate_limit
()
# Check if API token is configured (vs OAuth2)
if
isinstance
(
self
.
provider_config
,
dict
):
qwen_config
=
self
.
provider_config
.
get
(
'qwen_config'
)
else
:
qwen_config
=
getattr
(
self
.
provider_config
,
'qwen_config'
,
None
)
using_api_key
=
qwen_config
and
isinstance
(
qwen_config
,
dict
)
and
qwen_config
.
get
(
'api_key'
)
...
...
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