[PR #14] [MERGED] fix: pass selected model to backend when invoking agent #27

Closed
opened 2026-02-16 09:17:50 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/openwork/pull/14
Author: @MohtashamMurshid
Created: 1/17/2026
Status: Merged
Merged: 1/17/2026
Merged by: @hntrl

Base: mainHead: fix/pass-selected-model-to-backend


📝 Commits (1)

  • 05e59aa fix: pass selected model to backend when invoking agent

📊 Changes

4 files changed (+29 additions, -20 deletions)

View changed files

📝 src/main/ipc/agent.ts (+9 -7)
📝 src/preload/index.ts (+7 -5)
📝 src/renderer/src/components/chat/ChatContainer.tsx (+6 -3)
📝 src/renderer/src/lib/electron-transport.ts (+7 -5)

📄 Description

Summary

  • Fixes the bug where selecting a Gemini (or OpenAI) model in the UI still resulted in "Anthropic API key not configured" error
  • The selected model was stored in UI state but never passed through the IPC chain to the backend

Changes

The fix passes modelId through the entire IPC chain:

  1. ChatContainer.tsx - Include model_id in stream.submit() config
  2. electron-transport.ts - Extract model_id from config and pass to streamAgent()
  3. preload/index.ts - Forward modelId in IPC messages to main process
  4. agent.ts - Extract modelId and pass to createAgentRuntime()

Test plan

  • Select a Gemini model in the model switcher
  • Configure only a Google API key (no Anthropic key)
  • Send a message
  • Verify the agent uses the Gemini model instead of erroring about missing Anthropic key

Fixes #12


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/openwork/pull/14 **Author:** [@MohtashamMurshid](https://github.com/MohtashamMurshid) **Created:** 1/17/2026 **Status:** ✅ Merged **Merged:** 1/17/2026 **Merged by:** [@hntrl](https://github.com/hntrl) **Base:** `main` ← **Head:** `fix/pass-selected-model-to-backend` --- ### 📝 Commits (1) - [`05e59aa`](https://github.com/langchain-ai/openwork/commit/05e59aa1e089ec99ab782b900895669018b8db07) fix: pass selected model to backend when invoking agent ### 📊 Changes **4 files changed** (+29 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `src/main/ipc/agent.ts` (+9 -7) 📝 `src/preload/index.ts` (+7 -5) 📝 `src/renderer/src/components/chat/ChatContainer.tsx` (+6 -3) 📝 `src/renderer/src/lib/electron-transport.ts` (+7 -5) </details> ### 📄 Description ## Summary - Fixes the bug where selecting a Gemini (or OpenAI) model in the UI still resulted in "Anthropic API key not configured" error - The selected model was stored in UI state but never passed through the IPC chain to the backend ## Changes The fix passes `modelId` through the entire IPC chain: 1. **ChatContainer.tsx** - Include `model_id` in `stream.submit()` config 2. **electron-transport.ts** - Extract `model_id` from config and pass to `streamAgent()` 3. **preload/index.ts** - Forward `modelId` in IPC messages to main process 4. **agent.ts** - Extract `modelId` and pass to `createAgentRuntime()` ## Test plan - [x] Select a Gemini model in the model switcher - [x] Configure only a Google API key (no Anthropic key) - [x] Send a message - [x] Verify the agent uses the Gemini model instead of erroring about missing Anthropic key Fixes #12 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 09:17:50 -05:00
yindo closed this issue 2026-02-16 09:17:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/openwork#27