Quick Summary
WebSocket connect fail
Environment & Tools
- PicoClaw Version: v.0.2.5
- Go Version: (e.g., go 1.22)
- AI Model & Provider: (e.g., GPT-4o via OpenAI / DeepSeek via SiliconFlow)
- Operating System: (e.g., Ubuntu 22.04 / macOS / Android Termux)
- Channels: (e.g., Discord, Telegram, Feishu, ...)
📸 Steps to Reproduce
- v0.2.4 WebSocket connect ok
- set launcher_token fix to 'clawtestoken"
- v0.2.5 WebSocket connect fail
❌ Actual Behavior
PicoClaw Chrome Extension Connection Issue - Bug Report
Environment
- PicoClaw Version: 0.2.5
- Chrome Extension Version: 1.0.56
- NAS Docker: Running on local network (192.168.1.200)
- Gateway Port: 18790
- Launcher/API Port: 18800
Current Configuration
- Dashboard Token (launcher_token): clawtestoken
- Pico Token (from /api/pico/token): b9825e6b35e5a67444e795c2547a5110
- Gateway PID Token (from ~/.picoclaw/.picoclaw.pid): 5713189781afdcf865a26f273fbcf1fe
Problem Description
The Chrome extension cannot connect to the PicoClaw WebSocket server (both via Gateway port 18790 and Launcher port 18800). All authentication attempts fail with various HTTP errors.
Test Results
Test 1: Direct to Gateway (18790) - Simple Token
GET /pico/ws
Sec-Websocket-Protocol: token.b9825e6b35e5a67444e795c2547a5110
Result: 401 Unauthorized
Test 2: Direct to Gateway (18790) - Composed Token
GET /pico/ws
Sec-Websocket-Protocol: token.pico-5713189781afdcf865a26f273fbcf1feb9825e6b35e5a67444e795c2547a5110
Result: 400 Bad Request
Test 3: Via Launcher (18800) - Simple Token
GET /pico/ws
Authorization: Bearer clawtestoken
Sec-Websocket-Protocol: token.b9825e6b35e5a67444e795c2547a5110
Result: 400 Bad Request
Test 4: Via Launcher (18800) - Composed Token
GET /pico/ws
Authorization: Bearer clawtestoken
Sec-Websocket-Protocol: token.pico-5713189781afdcf865a26f273fbcf1feb9825e6b35e5a67444e795c2547a5110
Result: 403 Forbidden - "Invalid Pico token"
Test 5: Via Launcher (18800) - Dashboard Auth Only
GET /pico/ws?token=clawtestoken
Result: 302 Found (redirects to /launcher-login)
Expected Behavior
- Either direct connection to Gateway (18790) should work with the simple picoToken
- Or connection via Launcher (18800) should work when public=true is set
Code Analysis
Gateway Authentication (pkg/channels/pico/pico.go)
The authenticate() function accepts three methods:
- Authorization: Bearer
- Sec-Websocket-Protocol: token.
- Query parameter token (only if AllowTokenQuery is enabled)
But the token stored in config appears to be overwritten to pico-{pidToken}{picoToken} at gateway startup.
Launcher Proxy (web/backend/api/pico.go)
The launcher proxy validates the token via picoComposedToken() which requires:
- Client sends: token.prefix+picoToken
- Launcher looks up: gateway.picoToken
- Launcher expects: tokenPrefix + gateway.picoToken == client token
- If match, transforms to: pico.PicoTokenPrefix + gateway.pidData.Token + gateway.picoToken
Questions for PicoClaw Team
-
Authentication Scheme: What is the correct authentication method for external clients (Chrome extension) to connect to the WebSocket?
-
Token Format: Should clients use:
- Simple token:
token.{picoToken} (e.g., token.b9825e6b35e5a67444e795c2547a5110)
- Composed token:
token.pico-{pidToken}{picoToken} (e.g., token.pico-5713189781afdcf865a26f273fbcf1feb9825e6b35e5a67444e795c2547a5110)
-
Gateway vs Launcher: Should clients connect directly to Gateway (18790) or through Launcher (18800)?
-
Public Mode: When launcher is set to public: true, should /pico/ws be accessible without authentication?
-
Breaking Change: This is a breaking change from older versions where only picoToken was needed. Is this intentional?
How to Reproduce
- Start PicoClaw Docker with ports 18790 (gateway) and 18800 (launcher)
- Configure launcher with Dashboard Token
- Enable Pico channel and get picoToken via
/api/pico/token
- Attempt WebSocket connection from external client
- All authentication methods fail
Additional Notes
- The old PicoClaw version worked with just the simple picoToken
- The new version requires some additional authentication that is not clearly documented
- PID token changes on every gateway restart, making it difficult for clients to connect
✅ Expected Behavior
v0.2.4 old
💬 Additional Context
Quick Summary
WebSocket connect fail
Environment & Tools
📸 Steps to Reproduce
❌ Actual Behavior
PicoClaw Chrome Extension Connection Issue - Bug Report
Environment
Current Configuration
Problem Description
The Chrome extension cannot connect to the PicoClaw WebSocket server (both via Gateway port 18790 and Launcher port 18800). All authentication attempts fail with various HTTP errors.
Test Results
Test 1: Direct to Gateway (18790) - Simple Token
Result: 401 Unauthorized
Test 2: Direct to Gateway (18790) - Composed Token
Result: 400 Bad Request
Test 3: Via Launcher (18800) - Simple Token
Result: 400 Bad Request
Test 4: Via Launcher (18800) - Composed Token
Result: 403 Forbidden - "Invalid Pico token"
Test 5: Via Launcher (18800) - Dashboard Auth Only
Result: 302 Found (redirects to /launcher-login)
Expected Behavior
Code Analysis
Gateway Authentication (pkg/channels/pico/pico.go)
The
authenticate()function accepts three methods:But the token stored in config appears to be overwritten to
pico-{pidToken}{picoToken}at gateway startup.Launcher Proxy (web/backend/api/pico.go)
The launcher proxy validates the token via
picoComposedToken()which requires:Questions for PicoClaw Team
Authentication Scheme: What is the correct authentication method for external clients (Chrome extension) to connect to the WebSocket?
Token Format: Should clients use:
token.{picoToken}(e.g.,token.b9825e6b35e5a67444e795c2547a5110)token.pico-{pidToken}{picoToken}(e.g.,token.pico-5713189781afdcf865a26f273fbcf1feb9825e6b35e5a67444e795c2547a5110)Gateway vs Launcher: Should clients connect directly to Gateway (18790) or through Launcher (18800)?
Public Mode: When launcher is set to
public: true, should/pico/wsbe accessible without authentication?Breaking Change: This is a breaking change from older versions where only picoToken was needed. Is this intentional?
How to Reproduce
/api/pico/tokenAdditional Notes
✅ Expected Behavior
v0.2.4 old
💬 Additional Context