fix(cmd): add --user flag to agent chat for user_id authentication#714
Open
stanleykao72 wants to merge 1 commit intonextlevelbuilder:mainfrom
Open
fix(cmd): add --user flag to agent chat for user_id authentication#714stanleykao72 wants to merge 1 commit intonextlevelbuilder:mainfrom
stanleykao72 wants to merge 1 commit intonextlevelbuilder:mainfrom
Conversation
The CLI agent chat command connects via WebSocket but never sends user_id in the connect params. The gateway requires user_id for chat.send, making the CLI unusable for any agent interaction. All other clients (browser, Telegram, LINE, etc.) send user_id during connect. The CLI was the only channel missing it. Adds --user / -u flag that passes user_id in the connect frame. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
goclaw agent chatnever sendsuser_idin the WebSocket connect frameuser_idforchat.send, so the CLI always fails withuser_id is requireduser_idduring connect — CLI is the only channel missing itChanges
cmd/agent_chat.go: Add--user/-uflagcmd/agent_chat_client.go: Passuser_idin connect paramsUsage
Test plan
goclaw agent chat --name default --user testuser -m "hello"→ agent responds (nouser_id is requirederror)goclaw agent chat --name default -m "hello"(no--user) → still fails withuser_id is required(backward compatible, no silent default)--userflag → works across multiple messages in same session🤖 Generated with Claude Code