Skip to content

fix(subagents): preserve requester agent for inline announces#55998

Merged
vincentkoc merged 3 commits into
mainfrom
fix/subagent-announce-requester
Mar 29, 2026
Merged

fix(subagents): preserve requester agent for inline announces#55998
vincentkoc merged 3 commits into
mainfrom
fix/subagent-announce-requester

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Mar 27, 2026

Copy link
Copy Markdown
Member

Summary

  • preserve requesterAgentIdOverride when inline deterministic tool actions create OpenClaw tools
  • cover the named-agent spawn path with a regression test
  • add unreleased changelog credit for the original reporter and maintainer follow-up

Validation

  • pnpm test -- src/auto-reply/reply/get-reply-inline-actions.skip-when-config-empty.test.ts
  • pnpm build

Fixes #55437

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Mar 27, 2026
@vincentkoc vincentkoc self-assigned this Mar 27, 2026
@vincentkoc vincentkoc marked this pull request as ready for review March 29, 2026 07:54
@greptile-apps

greptile-apps Bot commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a regression where named subagents without channel bindings would lose their requester identity when inline deterministic tool actions (e.g. a dispatch: { kind: "tool" } skill command) created OpenClaw tools. The fix is a single-line addition of requesterAgentIdOverride: agentId to the createOpenClawTools call in get-reply-inline-actions.ts, mirroring the identical pattern already used in pi-tools.ts.

  • Core fix (get-reply-inline-actions.ts line 229): requesterAgentIdOverride: agentId is now forwarded to createOpenClawTools, ensuring tools like sessions_spawn can correctly identify the owning agent session when announcing completions.
  • Regression test (*.test.ts): A new test covers the named-agent spawn path end-to-end, verifying that createOpenClawTools receives the override and that the tool execute callback is invoked. The mock infrastructure is correctly wired into loadFreshInlineActionsModuleForTest and reset in beforeEach.
  • CHANGELOG: The primary fix entry (#55437 Thanks @kAIborg24) is well-formed. A second "Maintainer follow-up" entry on the next line (Thanks @vincentkoc) is self-referential — the PR author is thanking themselves — which departs from the established convention where Thanks @<handle> credits an external reporter.

Confidence Score: 5/5

Safe to merge — the code change is minimal, correct, and covered by a targeted regression test; the only finding is a P2 changelog style concern.

The one-line source fix is straightforward and consistent with the pattern used elsewhere in the codebase (pi-tools.ts). The new test properly mocks the dependency, resets state in beforeEach, and directly asserts the regression is covered. No P0 or P1 issues were found.

CHANGELOG.md — the self-referential "Maintainer follow-up" entry on line 67 should be removed or merged into the preceding entry.

Important Files Changed

Filename Overview
src/auto-reply/reply/get-reply-inline-actions.ts Minimal one-line fix: passes requesterAgentIdOverride: agentId to createOpenClawTools so named agents retain their identity when inline deterministic tool dispatches create OpenClaw tools. Correctly mirrors the pattern already used in pi-tools.ts.
src/auto-reply/reply/get-reply-inline-actions.skip-when-config-empty.test.ts Regression test added for the named-agent spawn path. Mock for createOpenClawTools is properly registered and reset in beforeEach. The new test verifies requesterAgentIdOverride is forwarded and the tool is actually executed.
CHANGELOG.md Two new entries added under Fixes. The first correctly documents the bug fix and credits the original reporter. The second 'Maintainer follow-up' entry is self-referential (author thanks themselves), which diverges from the established convention.

Comments Outside Diff (1)

  1. CHANGELOG.md, line 67 (link)

    P2 Self-referential "Maintainer follow-up" changelog entry

    Line 67 adds a second changelog entry that thanks @vincentkoc — the same author as this PR. Every other Thanks @<handle> in the changelog credits an external reporter or contributor, not the person who wrote the fix. The actual bug report credit is already captured on line 66 (Thanks @kAIborg24). This second entry appears redundant and doesn't fit the established convention.

    Consider removing it, or folding the "mainline path" detail into line 66 if it adds meaningful context:

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: CHANGELOG.md
    Line: 67
    
    Comment:
    **Self-referential "Maintainer follow-up" changelog entry**
    
    Line 67 adds a second changelog entry that thanks `@vincentkoc` — the same author as this PR. Every other `Thanks @<handle>` in the changelog credits an _external_ reporter or contributor, not the person who wrote the fix. The actual bug report credit is already captured on line 66 (`Thanks @kAIborg24`). This second entry appears redundant and doesn't fit the established convention.
    
    Consider removing it, or folding the "mainline path" detail into line 66 if it adds meaningful context:
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix All With AI
This is a comment left during a code review.
Path: CHANGELOG.md
Line: 67

Comment:
**Self-referential "Maintainer follow-up" changelog entry**

Line 67 adds a second changelog entry that thanks `@vincentkoc` — the same author as this PR. Every other `Thanks @<handle>` in the changelog credits an _external_ reporter or contributor, not the person who wrote the fix. The actual bug report credit is already captured on line 66 (`Thanks @kAIborg24`). This second entry appears redundant and doesn't fit the established convention.

Consider removing it, or folding the "mainline path" detail into line 66 if it adds meaningful context:

```suggestion
- Subagents/announcements: preserve the requester agent id for inline deterministic tool spawns so named agents without channel bindings can still announce completions through the correct owner session. (#55437) Thanks @kAIborg24.
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Merge branch 'main' into fix/subagent-an..." | Re-trigger Greptile

@vincentkoc vincentkoc force-pushed the fix/subagent-announce-requester branch from 8496964 to b329b5f Compare March 29, 2026 07:57
@vincentkoc vincentkoc merged commit 9777781 into main Mar 29, 2026
4 checks passed
@vincentkoc vincentkoc deleted the fix/subagent-announce-requester branch March 29, 2026 08:00
Alix-007 pushed a commit to Alix-007/openclaw that referenced this pull request Mar 30, 2026
…aw#55998)

* fix(subagents): preserve requester agent on inline announce

* docs(changelog): remove maintainer follow-up entry
alexjiang1 pushed a commit to alexjiang1/openclaw that referenced this pull request Mar 31, 2026
…aw#55998)

* fix(subagents): preserve requester agent on inline announce

* docs(changelog): remove maintainer follow-up entry
pgondhi987 pushed a commit to pgondhi987/openclaw that referenced this pull request Mar 31, 2026
…aw#55998)

* fix(subagents): preserve requester agent on inline announce

* docs(changelog): remove maintainer follow-up entry
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…aw#55998)

* fix(subagents): preserve requester agent on inline announce

* docs(changelog): remove maintainer follow-up entry
Tardisyuan pushed a commit to Tardisyuan/openclaw that referenced this pull request Apr 30, 2026
…aw#55998)

* fix(subagents): preserve requester agent on inline announce

* docs(changelog): remove maintainer follow-up entry
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
…aw#55998)

* fix(subagents): preserve requester agent on inline announce

* docs(changelog): remove maintainer follow-up entry
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…aw#55998)

* fix(subagents): preserve requester agent on inline announce

* docs(changelog): remove maintainer follow-up entry
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
…aw#55998)

* fix(subagents): preserve requester agent on inline announce

* docs(changelog): remove maintainer follow-up entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Subagent completion announce fails with "Outbound not configured for channel" for named agents without channel bindings

1 participant