Back to home

Fixing approval replay in OpenClaw

Diagnosed and fixed a Gateway bug where commands users had already approved were refused on replay — in one of the most-starred open-source AI agents on GitHub.

390k+
Repository stars
#161980
Merged pull request
Oct 2026
Merged upstream

Contributed a bug fix to OpenClaw — “The AI that really does things” — one of the most-starred open-source AI agent projects on GitHub (390k+ ⭐).

The Problem

Before an agent runs a command on a node, OpenClaw records a user approval and later replays that approval to execute the command. A node’s prepared command plan could omit the Gateway session key: approval creation filled that identity into the approval binding, but left it missing in the stored plan. At replay time the two identities no longer matched, so commands the user had already approved were refused (issue #151622).

The Fix

When recording an approval, the missing working directory, agent, and session metadata are now completed in the plan itself, using the same request fallbacks as the binding — while explicitly prepared values keep precedence. Replay consumes one consistent stored plan, and all approval-equality and authority checks stay unchanged.

  • A minimal, targeted production change (+9 / −4 lines) with new regression tests
  • No protocol, permission, or storage-schema changes
  • Maintainers credited the diagnosis and original repair
  • Merged upstream on 11 October 2026
  1. View pull request

    github.com/openclaw/openclaw/pull/161980

  2. Repository

    github.com/openclaw/openclaw