#lobster pipeline in openclaw

1 messages · Page 1 of 1 (latest)

meager kernel
#

Hi, I'm trying to build a simple 3-step workflow using Lobster:

Read .txt files from a local directory

  • Summarize their content using an LLM
  • Send the result to a Discord channel
  • Environment:

macOS (Apple Silicon)
OpenClaw gateway running on 127.0.0.1:18789
Lobster installed from source (github.com/openclaw/lobster), built with pnpm install
lobster binary linked to PATH
Steps taken:

First I discovered that run: llm.invoke fails because llm.invoke is not a shell command — switching to pipeline: llm.invoke fixed that error.

Then I set OPENCLAW_URL=http://127.0.0.1:18789 as required.

Current blocker — 401 Unauthorized:

Error: llm.invoke request failed: 401 Unauthorized:
{"error":{"message":"Unauthorized","type":"unauthorized"}}
Questions:

How do I obtain OPENCLAW_TOKEN for local gateway auth? Is it in ~/.openclaw/openclaw.json? Is there a CLI command to retrieve it?
Is local gateway auth required when running Lobster on the same machine as the gateway, or can it be disabled?
Is pipeline: llm.invoke --provider openclaw the correct way to invoke the gateway LLM from a workflow file?
Working workflow file so far:

name: Youtube-fetch
steps:

  • id: lire-fichiers
    run: >-
    sh -c 'set -- /path/to/files/*.txt;
    [ -f "$1" ] || { echo "No .txt files found." >&2; exit 1; };
    cat "$@"'

  • id: resumer
    pipeline: >
    llm.invoke --provider openclaw --prompt "Summarize each file..."
    stdin: $lire-fichiers.stdout

  • id: envoyer-discord
    run: >-
    openclaw.invoke --tool message --arg action=send --arg channel=discord
    --arg target=channel:CHANNEL_ID
    stdin: $resumer.stdout

Documentation gaps noticed:

The README mentions OPENCLAW_TOKEN as optional but gives no indication of where to find it or how to generate it
No complete working example of llm.invoke with provider=openclaw in the docs
The distinction between run: (shell) and pipeline: (native Lobster) is mentioned but not clearly emphasized
Thanks for any help!

manic raptorBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

wheat tundraBOT
#

Yep — the 401 is almost certainly because Lobster’s OPENCLAW_TOKEN is not set to the OpenClaw Gateway shared auth token.

Quick mapping:

  • OpenClaw config key: gateway.auth.token
  • OpenClaw env/SecretRef commonly used by the gateway: OPENCLAW_GATEWAY_TOKEN
  • Lobster env var expected by llm.invoke --provider openclaw: OPENCLAW_TOKEN

So if your OpenClaw config uses an env SecretRef like ${OPENCLAW_GATEWAY_TOKEN}, run Lobster from a shell where this is set:

export OPENCLAW_URL=http://127.0.0.1:18789
export OPENCLAW_TOKEN="$OPENCLAW_GATEWAY_TOKEN"

If the token is stored directly in ~/.openclaw/openclaw.json, it should be under:

#
gateway: { auth: { mode: "token", token: "..." } }

Note: openclaw config get gateway.auth.token currently redacts sensitive values, so it’s good for checking the path exists, not for copying the secret.

If you don’t have a token yet, generate/configure one with:

openclaw doctor --generate-gateway-token

If you need to rotate/set it manually:

openclaw config set gateway.auth.mode token
#
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart

For local-only loopback testing, auth can be disabled with:

openclaw config set gateway.auth.mode none
openclaw gateway restart

…but I’d only do that for trusted 127.0.0.1 setups. Token auth is the safer default, even locally.

And yes: this part is correct:

#
pipeline: >
  llm.invoke --provider openclaw --prompt "Summarize each file..."
stdin: $lire-fichiers.stdout

One correction to the final Discord step: openclaw.invoke wants --args-json; --arg action=send isn’t the current shape. Also stdin is not automatically turned into the message body for a non---each tool call, so wrap it in shell:

- id: envoyer-discord
  run: >-
    sh -c 'summary=$(cat);
    openclaw.invoke --tool message --action send --args-json
    "$(jq -n --arg channel discord --arg target channel:CHANNEL_ID --arg message "$summary"
      '{channel:$channel,target:$target,message:$message}')"'
  stdin: $resumer.stdout
meager kernel
#

thank you for your feedback.