Skip to content

Commit 16ddbd7

Browse files
Fix API key usage: use agentServerApiKey for agent server authentication
- Changed ConversationManager to use settings.agentServerApiKey instead of settings.apiKey - Updated useEffect dependency to watch for agentServerApiKey changes - Keeps settings.apiKey for LLM authentication in agent creation - Resolves issue where x-session-api-key header was incorrectly set with LLM key This ensures proper separation between: - agentServerApiKey: for authenticating with the OpenHands agent server - apiKey: for LLM API calls within agent configurations
1 parent 394ca3a commit 16ddbd7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

example/src/components/ConversationManager.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ export const ConversationManager: React.FC = () => {
3333
if (settings.agentServerUrl) {
3434
const conversationManager = new SDKConversationManager({
3535
host: settings.agentServerUrl,
36-
apiKey: settings.apiKey
36+
apiKey: settings.agentServerApiKey
3737
});
3838
setManager(conversationManager);
3939
loadConversations(conversationManager);
4040
}
41-
}, [settings.agentServerUrl, settings.apiKey]);
41+
}, [settings.agentServerUrl, settings.agentServerApiKey]);
4242

4343
const loadConversations = async (conversationManager?: SDKConversationManager) => {
4444
const mgr = conversationManager || manager;

0 commit comments

Comments
 (0)