Skip to content

fix: extract primary key when multiple API keys are configured#374

Open
zhangyapu1 wants to merge 1 commit into
iOfficeAI:mainfrom
zhangyapu1:fix/multi-key-primary-key
Open

fix: extract primary key when multiple API keys are configured#374
zhangyapu1 wants to merge 1 commit into
iOfficeAI:mainfrom
zhangyapu1:fix/multi-key-primary-key

Conversation

@zhangyapu1
Copy link
Copy Markdown

fix: extract primary key when multiple API keys are configured

When multiple API keys are stored as comma-separated string (e.g., "key1,key2"),
the model fetcher and aionrs agent now extract the first valid key instead of
passing the entire string as a single API key.

Changes

  • crates/aionui-system/src/model_fetcher/fetchers.rs: Add primary_key() helper function to extract first valid key from comma/newline-separated string. Use it in fetch_for_platform for all platform fetchers.
  • crates/aionui-ai-agent/src/manager/aionrs/agent.rs: Extract first valid key when initializing the aionrs engine.

Related

This is the backend fix for the multi-key rotation issue. The frontend fix is in AionUi#3139.

When multiple API keys are stored as comma-separated string (e.g., "key1,key2"),
the model fetcher and aionrs agent now extract the first valid key instead of
passing the entire string as a single API key.

- Add primary_key() helper in fetchers.rs to extract first valid key
- Use primary_key in fetch_for_platform for all platform fetchers
- Extract first valid key in aionrs agent initialization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant