Skip to content

fix: Windows compatibility improvements#162

Open
colorwlof wants to merge 1 commit intodataelement:mainfrom
colorwlof:fix/windows-support
Open

fix: Windows compatibility improvements#162
colorwlof wants to merge 1 commit intodataelement:mainfrom
colorwlof:fix/windows-support

Conversation

@colorwlof
Copy link

Summary

Windows compatibility fixes for Clawith backend and frontend.

Backend Changes

  1. Windows subprocess support (agent_tools.py)

    • Added WindowsProactorEventLoopPolicy for Python 3.12+ on Windows
    • GBK/UTF-16LE auto-detection for subprocess output decoding
    • Fixed bash language to use PowerShell instead of bash (Windows native)
    • Fixed write_text encoding for UTF-8 (Windows GBK issue)
  2. MCP tools visibility (tools.py)

    • Removed MCP tool filter in agent tools assignment page
    • MCP tools can now be assigned to agents without existing assignments
  3. Feishu tool_call history (feishu.py)

    • Fixed tool_call message history loading for multi-round conversations
    • Previously tool_call messages were skipped, causing "No tool output found" errors
  4. httpx proxy (llm_client.py)

    • Added trust_env=False to all 4 LLM clients
    • Prevents system proxy from intercepting LLM API requests
  5. Startup fixes (main.py)

    • Removed emoji characters in logs (Windows GBK encoding)
    • Commented out seed_default_agents() to prevent overwriting custom agents
  6. Startup script (links.bat)

    • Fixed Windows venv path: .venv\Scripts\uvicorn
    • Removed --reload to avoid watchfiles subprocess issues

Frontend Changes

  1. Input performance (AgentDetail.tsx)
    • Removed all refetchInterval polling (caused input lag)
    • Changed chat input to uncontrolled mode (bypasses React state on keypress)
    • Added useCallback for sendChatMsg

Note

  • Python 3.12+ required for Windows subprocess support
  • All changes are backward compatible with Linux deployments

… optimization

- agent_tools.py: Windows event loop (ProactorEventLoop), GBK/UTF-16LE decoding, PowerShell for bash, UTF-8 file writes
- feishu.py: fix tool_call history loading for multi-round conversations
- tools.py: show MCP tools in agent tools assignment page
- main.py: remove emoji logs, disable seed_default_agents
- websocket.py: fix tool_call history building
- llm_client.py: disable httpx system proxy (trust_env=False)
- links.bat: fix Windows venv path
- frontend/AgentDetail.tsx: remove refetchInterval, uncontrolled input, useCallback
- Add CUSTOM_MODIFICATIONS.md for tracking local changes
@yaojin3616
Copy link
Collaborator

#112

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.

2 participants