Skip to content

fix(tools): forward senderIsOwner to embedded runner so owner-only tools work#22296

Merged
obviyus merged 3 commits intoopenclaw:mainfrom
hcoj:fix/sender-is-owner-forwarding
Feb 21, 2026
Merged

fix(tools): forward senderIsOwner to embedded runner so owner-only tools work#22296
obviyus merged 3 commits intoopenclaw:mainfrom
hcoj:fix/sender-is-owner-forwarding

Conversation

@hcoj
Copy link
Copy Markdown
Contributor

@hcoj hcoj commented Feb 21, 2026

Summary

  • senderIsOwner was dropped when forwarding parameters to runEmbeddedPiAgent, causing owner-only tools (cron, gateway) to be stripped from every agent run
  • Added the missing property forwarding in three locations

Details

resolveCommandAuthorization() correctly determines senderIsOwner and get-reply-run.ts stores it in followupRun.run. However, the helper functions that construct parameters for runEmbeddedPiAgent omitted it:

  1. agent-runner-utils.ts:buildEmbeddedRunBaseParams() — did not include senderIsOwner
  2. followup-runner.ts — same omission in the direct runEmbeddedPiAgent call
  3. queue/types.ts:FollowupRun["run"] — type was missing senderIsOwner

Because senderIsOwner arrived as undefined, the guard options?.senderIsOwner === true in pi-tools.ts evaluated to false, and applyOwnerOnlyToolPolicy stripped all owner-only tools.

Fixes #22295

Test plan

  • Verify owner-only tools (cron, gateway) are available when sender matches commands.ownerAllowFrom
  • Verify owner-only tools are still stripped for non-owner senders
  • Verify followup/queued runs also preserve senderIsOwner

🤖 Generated with Claude Code

Greptile Summary

Adds the missing senderIsOwner property forwarding in three locations where parameters are constructed for runEmbeddedPiAgent, fixing a bug where owner-only tools (cron, gateway) were incorrectly stripped from all embedded agent runs.

Changes made:

  • agent-runner-utils.ts:buildEmbeddedRunBaseParams() — now forwards senderIsOwner from params.run
  • followup-runner.ts — now includes senderIsOwner when calling runEmbeddedPiAgent for queued runs
  • queue/types.ts:FollowupRun["run"] — added senderIsOwner?: boolean to the type definition

The fix ensures that authorization context determined by resolveCommandAuthorization() is properly propagated through the entire embedded agent execution pipeline, so applyOwnerOnlyToolPolicy in pi-tools.ts correctly evaluates options?.senderIsOwner === true.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are straightforward property forwarding fixes that restore intended functionality. All three changes add the same missing property (senderIsOwner) in parallel code paths, with consistent typing. The fix aligns with the existing authorization infrastructure and doesn't introduce new logic or side effects.
  • No files require special attention

Last reviewed commit: 29c23f7

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@HenryLoenwind
Copy link
Copy Markdown
Contributor

Is this a recent regression? If so, put "regression" into your title. This makes it more visible as stuff that just broke is more important than things that never worked.

@obviyus obviyus self-assigned this Feb 21, 2026
@obviyus obviyus force-pushed the fix/sender-is-owner-forwarding branch from 29c23f7 to 68f97ec Compare February 21, 2026 03:01
hcoj and others added 3 commits February 21, 2026 08:32
…ols work

senderIsOwner was correctly computed by resolveCommandAuthorization() and
stored in followupRun.run, but buildEmbeddedRunBaseParams() and the
followup runner omitted it when forwarding parameters to
runEmbeddedPiAgent(). This caused senderIsOwner to arrive as undefined,
which applyOwnerOnlyToolPolicy() treated as false, stripping owner-only
tools (cron, gateway) from every agent run.

Fixes openclaw#22295

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@obviyus obviyus force-pushed the fix/sender-is-owner-forwarding branch from 68f97ec to 0baca5c Compare February 21, 2026 03:03
@obviyus obviyus merged commit 5dae5e6 into openclaw:main Feb 21, 2026
13 checks passed
@obviyus
Copy link
Copy Markdown
Contributor

obviyus commented Feb 21, 2026

Merged via squash.

Thanks @hcoj!

mmyyfirstb pushed a commit to mmyyfirstb/openclaw that referenced this pull request Feb 21, 2026
…ols work (openclaw#22296)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 0baca5c
Co-authored-by: hcoj <1169805+hcoj@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
mreedr pushed a commit to mreedr/openclaw-custom that referenced this pull request Feb 24, 2026
…ols work (openclaw#22296)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 0baca5c
Co-authored-by: hcoj <1169805+hcoj@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…ols work (openclaw#22296)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 0baca5c
Co-authored-by: hcoj <1169805+hcoj@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…ols work (openclaw#22296)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 0baca5c
Co-authored-by: hcoj <1169805+hcoj@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
…ols work (openclaw#22296)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 0baca5c
Co-authored-by: hcoj <1169805+hcoj@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…ols work (openclaw#22296)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 0baca5c
Co-authored-by: hcoj <1169805+hcoj@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

senderIsOwner dropped in agent-runner, owner-only tools (cron, gateway) always unavailable

3 participants