Files
openclaw/extensions/twitch
Tyler Yust 8d2f98fb01 Fix subagent announce failover race (always emit lifecycle end + treat timeout=0 as no-timeout) (#6621)
* Fix subagent announce race and timeout handling

Bug 1: Subagent announce fires before model failover retries finish
- Problem: CLI provider emitted lifecycle error on each attempt, causing
  subagent registry to prematurely call beginSubagentCleanup() and announce
  with incorrect status before failover retries completed
- Fix: Removed lifecycle error emission from CLI provider's attempt-level
  .catch() in agent-runner-execution.ts. Errors still propagate to
  runWithModelFallback for retry, but no intermediate lifecycle events
  are emitted. Only the final outcome (after all retries) emits lifecycle
  events.

Bug 2: Hard 600s per-prompt timeout ignores runTimeoutSeconds=0
- Problem: When runTimeoutSeconds=0 (meaning 'no timeout'), the code
  returned the default 600s timeout instead of respecting the 0 setting
- Fix: Modified resolveAgentTimeoutMs() to treat 0 as 'no timeout' and
  return a very large timeout value (30 days) instead of the default.
  This avoids setTimeout issues with Infinity while effectively providing
  unlimited time for long-running tasks.

* fix: emit lifecycle:error for CLI failures (#6621) (thanks @tyler6204)

* chore: satisfy format/lint gates (#6621) (thanks @tyler6204)

* fix: restore build after upstream type changes (#6621) (thanks @tyler6204)

* test: fix createSystemPromptOverride tests to match new return type (#6621) (thanks @tyler6204)
2026-02-02 02:06:14 -08:00
..
2026-01-26 13:48:10 -06:00
2026-02-02 08:51:54 +00:00
2026-01-30 03:16:21 +01:00

@openclaw/twitch

Twitch channel plugin for OpenClaw.

Install (local checkout)

openclaw plugins install ./extensions/twitch

Install (npm)

openclaw plugins install @openclaw/twitch

Onboarding: select Twitch and confirm the install prompt to fetch the plugin automatically.

Config

Minimal config (simplified single-account):

⚠️ Important: requireMention defaults to true. Add access control (allowFrom or allowedRoles) to prevent unauthorized users from triggering the bot.

{
  channels: {
    twitch: {
      enabled: true,
      username: "openclaw",
      accessToken: "oauth:abc123...", // OAuth Access Token (add oauth: prefix)
      clientId: "xyz789...", // Client ID from Token Generator
      channel: "vevisk", // Channel to join (required)
      allowFrom: ["123456789"], // (recommended) Your Twitch user ID only (Convert your twitch username to ID at https://www.streamweasels.com/tools/convert-twitch-username-%20to-user-id/)
    },
  },
}

Access control options:

  • requireMention: false - Disable the default mention requirement to respond to all messages
  • allowFrom: ["your_user_id"] - Restrict to your Twitch user ID only (find your ID at https://www.twitchangles.com/xqc or similar)
  • allowedRoles: ["moderator", "vip", "subscriber"] - Restrict to specific roles

Multi-account config (advanced):

{
  channels: {
    twitch: {
      enabled: true,
      accounts: {
        default: {
          username: "openclaw",
          accessToken: "oauth:abc123...",
          clientId: "xyz789...",
          channel: "vevisk",
        },
        channel2: {
          username: "openclaw",
          accessToken: "oauth:def456...",
          clientId: "uvw012...",
          channel: "secondchannel",
        },
      },
    },
  },
}

Setup

  1. Create a dedicated Twitch account for the bot, then generate credentials: Twitch Token Generator
    • Select Bot Token
    • Verify scopes chat:read and chat:write are selected
    • Copy the Access Token to token property
    • Copy the Client ID to clientId property
  2. Start the gateway

Full documentation

See https://docs.openclaw.ai/channels/twitch for:

  • Token refresh setup
  • Access control patterns
  • Multi-account configuration
  • Troubleshooting
  • Capabilities & limits