Skip to content

I developed a client to send messages to openclaw, but it consistently fails to send. Even using the demo's quick send feature also fails to work #112

Closed

Description

@society2012

I developed a client to send messages to openclaw, but it consistently fails to send. Even using the demo's quick send feature also fails to work

[2026-03-27 18:06:10.554] [INFO] 开打发送消息--------------{"type":"req","id":"32041c64-916b-4695-a1f9-86d3b284a7fb","method":"chat.send","params":{"sessionKey":"agent:main:main","message":"1234567890"}}
[2026-03-27 18:06:10.558] [INFO] Sent chat message (10 chars)
[2026-03-27 18:06:10.561] [INFO] [QuickSend] Message sent (10 chars)
[2026-03-27 18:06:10.561] [WARN] Gateway request failed: missing scope: operator.write

Activity

  1. added a commit that references this issue on Mar 27, 2026
    b42cf79
  2. github-actions commented on Mar 27, 2026

    @github-actions
  3. society2012 commented on Mar 29, 2026

    @society2012
    Author

    Hello, thank you for your reply. I added 'operator. write' when connecting, but sending it quickly still doesn't work,

  4. github-actions commented on Mar 30, 2026

    @github-actions
    Contributor

    🤖 This is an automated response from Repo Assist.

    Good to hear from you again, @society2012! The "sending quickly" detail is the key clue — this is a timing/sequencing issue.

    Why it still fails even with operator.write in your scopes

    The OpenClaw gateway doesn't associate scopes with a connection until it has processed your connect message and responded with hello-ok. The sequence must be:

    Client → Gateway: WebSocket upgrade (TCP connection established)
    Client → Gateway: {"type":"req","method":"connect","params":{"scopes":["operator.write",...]}}
    Gateway → Client: {"type":"hello-ok", ...}     ← scopes are now active
    Client → Gateway: {"type":"req","method":"chat.send",...}  ← this now works
    

    If your code sends chat.send before waiting for hello-ok, the gateway hasn't registered your scopes yet — so it rejects the request with missing scope: operator.write even though you declared it.

    Fix: wait for the hello-ok message before sending any requests:

    // Pseudocode — wait for hello-ok before sending
    ws.onmessage = (event) => {
        const msg = JSON.parse(event.data);
        if (msg.type === 'hello-ok') {
            // Connection is now fully established — safe to send
            sendChatMessage("hello!");
        }
    };

    Also: check the sessionKey parameter

    Your original log showed:

    {"method":"chat.send","params":{"sessionKey":"agent:main:main","message":"1234567890"}}

    The built-in QuickSend sends chat.send without a sessionKey. Depending on your gateway version, an unrecognised or incorrect sessionKey value could also cause the request to be rejected. Try removing it and just sending {"params":{"message":"..."}} to isolate whether that's contributing.

    PR #113

    The built-in QuickSend in OpenClaw itself will be fixed once PR #113 is merged — that adds operator.write to the built-in connect handshake. If you're also seeing the demo's own QuickSend fail, that's why.

    Let us know if this helps!

    Generated by Repo Assist · ◷

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@cbb46ab386962aa371045839fc9998ee4e97ca64
    
  5. locked as resolved and limited conversation to collaborators on May 29, 2026
  6. added a commit that references this issue on Aug 16, 2026
    91fff8d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds investigation

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions