Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 18, 2026, 6:52 PM ET / 22:52 UTC. Summary PR surface: Source +32, Tests +60, Other +104. Total +196 across 6 files. Reproducibility: yes. at source level: the linked report identifies the runner being created without identity fields, and the PR’s terminal proof observes those fields at a registered middleware handler after the change. I did not independently execute the reproduction in this read-only review. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Retain the prepared-facts forwarding design, complete the direct Codex sibling-contract comparison, and then merge the focused fix so installed OpenClaw middleware receives the same available identity context as the Codex path. Do we have a high-confidence way to reproduce the issue? Yes, at source level: the linked report identifies the runner being created without identity fields, and the PR’s terminal proof observes those fields at a registered middleware handler after the change. I did not independently execute the reproduction in this read-only review. Is this the best way to solve the issue? Yes, subject to the required sibling Codex contract check: forwarding already-prepared attempt and compaction facts into the existing middleware runner is the narrowest maintainable repair and avoids a new API or state path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 556a2ee276f0. Label changesLabel justifications:
Evidence reviewedPR surface: Source +32, Tests +60, Other +104. Total +196 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (17 earlier review cycles; latest 8 shown)
|
fd981e4 to
9183426
Compare
|
Note on That file is not in this PR. The diff only touches middleware identity wiring under
|
16b5b44 to
d2b7a0f
Compare
d2b7a0f to
d7e5276
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Rebased onto current main and closed the compact sibling gap:
$ pnpm exec vitest run src/agents/embedded-agent-runner/extensions.test.ts
Test Files 2 passed (2)
Tests 14 passed (14) |
d7e5276 to
6fe3995
Compare
…ware
The OpenClaw embedded path constructed createAgentToolResultMiddlewareRunner
with only { runtime: "openclaw" }, so installed AgentToolResultMiddleware
handlers never saw agentId, sessionId, sessionKey, or runId. Pass those
fields from the attempt path and the compact sibling path. No CHANGELOG
edit (release-owned).
Closes openclaw#106910
Signed-off-by: Sebastien Tardif <[email protected]>
Exercise buildEmbeddedExtensionFactories with a registered plugin middleware and a tool_result event so agent/session/run identity is observed at the installed-handler boundary. Signed-off-by: Sebastien Tardif <[email protected]>
6fe3995 to
ad8cfcf
Compare
Signed-off-by: Sebastien Tardif <[email protected]>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Prevent deadcode:unused-files failure on scripts/proof-tool-result-middleware-identity.mjs. Signed-off-by: Sebastien Tardif <[email protected]>
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]>
|
Thank you, @SebTardif. Your reviewed fix for #106910 has now landed in maintainer PR #115821 as bed7014, with your original The original branch was no longer mergeable against current main because compaction factory ownership moved to We independently reproduced both missing identities through a real installed plugin and actual extension tool-result event (red before, green after), verified all 588 owner/Codex/plugin regressions, full type and changed gates, all three official hard-zero dead-export scans, fresh xhigh autoreview, and the exact-head hosted Issue #106910 is now actually closed as completed. Closing this superseded original only after independently confirming the credited merge and issue closure. Thank you for the fix! |
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]>
Closes #106910
What Problem This Solves
Fixes an issue where installed
AgentToolResultMiddlewarehandlers on theOpenClaw embedded runtime never received
agentId,sessionId,sessionKey, orrunId, even though those fields are part of the publicmiddleware context and the Codex path already forwards them. Middleware
used for audit, telemetry, or session-scoped policy therefore could not
attribute OpenClaw tool-result events.
Why This Change Was Made
buildAgentToolResultMiddlewareFactoryconstructedcreateAgentToolResultMiddlewareRunner({ runtime: "openclaw" })only.Pass agent/session/run identity from the embedded attempt (and compact)
call sites into that runner, matching the Codex
toToolResultHookContextshape. Fall back to
SessionManager.getSessionId()when an explicitsession id is not provided.
User Impact
Installed middleware that declares OpenClaw runtime support can now see
the same agent/session/run identity fields on OpenClaw tool results that
it already receives on Codex.
Evidence
Installed middleware observed identity fields during an embedded OpenClaw
tool_result event (production buildEmbeddedExtensionFactories path):
Factory-level regression tests still cover explicit context construction and
SessionManager sessionId fallback.
Real behavior proof
Behavior addressed: Installed AgentToolResultMiddleware handlers on the OpenClaw embedded runtime never received agentId/sessionId/sessionKey/runId; they now receive the same identity fields as Codex.
Real environment tested: macOS darwin arm64, worktree /tmp/oc-proof-107000 on branch fix/tool-result-middleware-context rebased onto current upstream/main, Node via node --import tsx.
Exact steps or command run after this patch:
cd /tmp/oc-proof-107000 CI=true pnpm install --frozen-lockfile node --import tsx scripts/proof-tool-result-middleware-identity.mjsEvidence after fix: terminal output copied below.
Observed result after fix: The installed plugin middleware handler received runtime=openclaw, agentId=main, sessionId=session-proof-107000, sessionKey=agent:main:chat, runId=run-proof-107000 for a real tool_result event dispatched through the embedded extension factory.
What was not tested: Full gateway Discord/WhatsApp turn with a published marketplace middleware package (plugin registry path was exercised via createEmptyPluginRegistry + setActivePluginRegistry).
Summary
prepareEmbeddedAttemptAgentSessionand compact