mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-01-29 22:02:05 +00:00
fix: correct SDK import and clear stale agent UI on stop
Changes: - Revert incorrect import from claude_code_sdk to claude_agent_sdk in agent.py (PR #50 introduced an undocumented change to a deprecated package) - Clear activeAgents and recentActivity in useWebSocket when agent stops to prevent stale UI state The claude_code_sdk package is deprecated (last updated Sep 2025) while claude_agent_sdk is the active, maintained package. The import change in PR #50 was undocumented and would have caused ImportError since only claude-agent-sdk is specified in requirements.txt. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2
agent.py
2
agent.py
@@ -14,7 +14,7 @@ from pathlib import Path
|
||||
from typing import Optional
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
from claude_code_sdk import ClaudeSDKClient
|
||||
from claude_agent_sdk import ClaudeSDKClient
|
||||
|
||||
# Fix Windows console encoding for Unicode characters (emoji, etc.)
|
||||
# Without this, print() crashes when Claude outputs emoji like ✅
|
||||
|
||||
@@ -112,6 +112,8 @@ export function useProjectWebSocket(projectName: string | null) {
|
||||
setState(prev => ({
|
||||
...prev,
|
||||
agentStatus: message.status,
|
||||
// Clear active agents when process stops to prevent stale UI
|
||||
...(message.status === 'stopped' && { activeAgents: [], recentActivity: [] }),
|
||||
}))
|
||||
break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user