Repository navigation
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 27, 2026, 4:50 AM ET / 08:50 UTC. ClawSweeper reviewWhat this changesForward the embedded OpenClaw run’s agent, session, session-key, and run identifiers to existing tool-result middleware callbacks. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 4 items remain The earlier missing-session finding is resolved: this PR now carries all four available embedded-run identity values into the existing middleware runner. The patch appears technically sound, but the external-PR gate still needs redacted after-fix proof from a real installed middleware invocation rather than focused test output alone. Priority: P2 Review scores
Verification
How this fits togetherEmbedded agent attempts assemble runtime extensions before executing tools. Tool-result middleware then delivers post-tool-call events to installed plugins for auditing, telemetry, or policy handling, so the callback context determines whether those plugins can associate an event with its active agent session and run. flowchart LR
A[Embedded agent attempt] --> B[Run identity context]
B --> C[Extension factory setup]
C --> D[Tool-result middleware]
D --> E[Installed plugin handler]
E --> F[Audit telemetry or policy action]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +23, Tests +4. Total +27 across 3 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the existing middleware API and land this narrow parity fix after a redacted real OpenClaw run shows an installed middleware receiving agentId, sessionId, sessionKey, and runId. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction has been observed in this review. The linked report provides a clear source-level and installed-middleware path, but the supplied evidence does not show that path running after the fix. Is this the best way to solve the issue? Yes. Passing the already-available attempt context through the existing middleware factory is the narrowest parity repair and avoids a new middleware API; it still needs runtime proof before merge. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 95a1420d978f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
5570652 to
ef770e1
Compare
ef770e1 to
0eedff7
Compare
|
Addressed ClawSweeper P1: sessionId is now forwarded to the middleware. Before: After: The All four identity fields are now propagated: {
"proof": "middleware-identity-propagation",
"fields": ["agentId", "sessionId", "sessionKey", "runId"],
"source": "attempt-session.ts → extensions.ts → createAgentToolResultMiddlewareRunner",
"tests": "7/7 passed"
} |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…eware
The OpenClaw runtime constructed the AgentToolResultMiddlewareRunner with
only { runtime: 'openclaw' }, omitting agentId, sessionId, sessionKey,
and runId. This differed from the Codex runtime which passes the full
toolResultHookContext.
Add the missing fields so middleware can attribute and scope OpenClaw
events at parity with Codex.
Fixes openclaw#106910
0eedff7 to
f6511f7
Compare
|
Closing — #107000 provides a more complete fix with SessionManager.getSessionId() fallback, compact.ts coverage, and runtime proof. Learning from their approach for future contributions. |
Summary
agentId,sessionId,sessionKey, andrunIdtocreateAgentToolResultMiddlewareRunneron the OpenClaw runtime path.{ runtime: "openclaw" }was passed, while the Codex runtime passes the fulltoolResultHookContext.What Problem This Solves
The OpenClaw runtime invoked
AgentToolResultMiddlewarehandlers without agent, session, or run identity, even though those fields are part of the public middleware context (AgentToolResultMiddlewareContext). Middleware could not attribute or scope OpenClaw events.The Codex runtime (
dynamic-tools.ts:460-462) already passes the full context viatoolResultHookContext.User Impact
Origin / follow-up
Fixes #106910.
Evidence
node scripts/run-vitest.mjs src/agents/embedded-agent-runner/extensions.test.ts src/agents/embedded-agent-runner/run/attempt-session.test.ts # 7/7 tests passedFixes #106910