🐛 Fix Save Resolution failing with hardcoded 'claude' agent fallback#4096
🐛 Fix Save Resolution failing with hardcoded 'claude' agent fallback#4096clubanderson merged 1 commit intomainfrom
Conversation
…4079) SaveResolutionDialog hardcoded `agent: 'claude'` when mission.agent was unset. The 'claude' API provider is not registered in the agent registry (only CLI-based agents are), causing "Claude provider not configured - ANTHROPIC_API_KEY not set" errors. Changed to `agent: undefined` so the backend uses its own fallback logic (session's selected agent → default agent), which always picks an available provider. Fixes #4079 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hey @clubanderson — thanks for opening this PR!
This is an automated message. |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
There was a problem hiding this comment.
Pull request overview
Fixes “Save Resolution” failures caused by a hardcoded agent: 'claude' fallback in the AI summary generation request, allowing the backend to select an actually-available default agent when mission.agent is unset.
Changes:
- Removed the hardcoded
'claude'fallback for the WebSocketchatrequest inSaveResolutionDialog. - Ensured the
agentfield is effectively omitted whenmission.agentis not set, deferring selection to backend defaults.
| ws.send(JSON.stringify({ | ||
| type: 'chat', | ||
| id: `summary-${Date.now()}`, | ||
| payload: { | ||
| prompt: prompt, | ||
| sessionId: `resolution-${mission.id}`, | ||
| agent: mission.agent || 'claude', | ||
| agent: mission.agent || undefined, | ||
| } |
There was a problem hiding this comment.
Consider adding a regression test around the WebSocket request payload in generateAISummary to ensure that when mission.agent is unset/empty the "agent" field is omitted (or otherwise does not default to a non-registered provider). This would prevent reintroducing the previous hardcoded fallback behavior.
🔄 Auto-Applying Copilot Code ReviewCopilot code review found 0 code suggestion(s) and 1 general comment(s). Also address these general comments:
Push all fixes in a single commit. Run Auto-generated by copilot-review-apply workflow. |
Summary
SaveResolutionDialog.tsxhardcodedagent: 'claude'whenmission.agentwas unset. TheclaudeAPI provider isn't registered in the agent registry (only CLI-based agents like copilot-cli, claude-cli are), so this always fails with "Claude provider not configured - ANTHROPIC_API_KEY not set".Changed to
agent: undefined— the backend's agent selection logic (GetSelectedAgent→ default agent) picks whatever provider is actually available.Fixes #4079
Test plan