Repository navigation
fix(agents): preserve tool-result middleware identity - #115821
Merged
Merged
Conversation
Fixes #106910. Preserve the contributor design from #107000 while updating both the normal and current compaction owner paths. Co-authored-by: Sebastien Tardif <[email protected]>
Contributor
Author
|
Merged via squash.
|
pull Bot
pushed a commit
to yann0001/openclaw
that referenced
this pull request
Jul 29, 2026
* origin/main: fix(codex): restore connected apps for token-authenticated runs (openclaw#115075) fix(codex): classify hosted search timeouts (openclaw#115837) fix(msteams): keep attachment replies in channel threads (openclaw#94348) fix(telegram): linkPreview:false is ignored on streamed replies (openclaw#114125) fix(protocol): make Swift model checks non-mutating (openclaw#115793) fix(searxng): avoid duplicating search endpoint (openclaw#113661) fix(agents): preserve tool-result middleware identity (openclaw#115821) refactor(meetings): consolidate runtime facades (openclaw#115819)
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 30, 2026
Fixes openclaw#106910. Preserve the contributor design from openclaw#107000 while updating both the normal and current compaction owner paths. Co-authored-by: Sebastien Tardif <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 30, 2026
* origin/main: fix(codex): restore connected apps for token-authenticated runs (openclaw#115075) fix(codex): classify hosted search timeouts (openclaw#115837) fix(msteams): keep attachment replies in channel threads (openclaw#94348) fix(telegram): linkPreview:false is ignored on streamed replies (openclaw#114125) fix(protocol): make Swift model checks non-mutating (openclaw#115793) fix(searxng): avoid duplicating search endpoint (openclaw#113661) fix(agents): preserve tool-result middleware identity (openclaw#115821) refactor(meetings): consolidate runtime facades (openclaw#115819)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #106910
Supersedes #107000. Preserves @SebTardif's original design and Git co-author credit.
AI-assisted: yes; the behavior, current owner paths, regression evidence, and exact upstream Codex contracts were independently reviewed.
What Problem This Solves
Fixes an issue where plugins using installed agent-tool-result middleware could not identify which OpenClaw agent, session, or run executed a tool. Per-session auditing, telemetry, and policy therefore received only
runtime: "openclaw", even though the corresponding Codex integration already carries the prepared execution identity.Why This Change Was Made
Capture the already prepared agent ID, session ID, session key, and run ID once when building the existing middleware runner. Thread the effective identity through both current owner call sites: ordinary embedded attempts and the current compaction-session execution path. Resolve the session-manager fallback once at factory construction, never in the tool-result hot path.
The original contributor PR #107000 is no longer mergeable against current
main: compaction factory ownership has moved from its oldcompact.tscall site intocompaction-session-execution.ts. This maintainer successor carries forward @SebTardif's fix without adding a product proof script, changing Knip configuration, or preserving stale ownership.User Impact
Installed plugins receive the same available agent, session, and run identity for OpenClaw tool results that Codex tool-result middleware already receives. Ordinary runs and compaction runs retain their correct prepared owner, and all existing tool-result mutation, error, messaging, safeguard, and cross-runtime behavior is preserved.
Evidence
ExtensionRunner, and an actualtool_resultevent on Blacksmith Testboxtbx_01kypjr5vcysqs573z8y6660t2.{ runtime: "openclaw" }; all 13 existing controls pass.openai/codex@fe01054a28fa4bd04716d9ceadb410f2443a50ce:codex-rs/app-server-protocol/src/protocol/v2/item.rs,codex-rs/app-server/src/bespoke_event_handling.rs, andcodex-rs/protocol/src/dynamic_tools.rs.pnpm check:test-types, the exact four-filepnpm check:changed -- ..., and all three official hard-zeropnpm deadcode:exportsKnip scans: production exports, full-tree exports, and script exports.gpt-5.6-solstructured autoreview atxhigh: no accepted or actionable findings.