Repository navigation
Conversation
…turn An ordinary Control UI turn stamps external_user on its admitted message but leaves the run without an explicit origin, so a v2 plugin tool factory observed no inputProvenance while senderIsOwner was true. Codex tool construction now falls back to the origin the admitted input already recorded; an explicit producer origin keeps precedence, and a turn with neither fact still constructs tools without one so plugin policy keeps failing closed. Fixes openclaw#208201
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. |
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded by #208252, which addresses the same tool-factory provenance gap with live Control UI/Codex proof while preserving tool-policy inputs. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Consolidate the repair in #208252 and retain the original report until that fix merges. The same work is tracked in #208252. ClawSweeper will close this if the final checks pass. Please continue the discussion there. Review detailsBest possible solution: Consolidate the repair in #208252 and retain the original report until that fix merges. Do we have a high-confidence way to reproduce the issue? The admitted-message producer and current-main factory forwarding establish the missing-field path, supported by the reporter’s official-build observation and contributor-reported red/green regression; this review executed no target code. Is this the best way to solve the issue? The replacement repairs the same observable problem at the host metadata boundary while retaining explicit provenance precedence and existing tool-policy inputs. Security review: Security review cleared: No concrete unauthorized effect or supply-chain regression was established. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning medium; reviewed against 39d230cc35fc. |
|
Follow-up pass on head 1. This PR is superseded by #208252, which is now merged — no further work here. #208252 landed in main as That is the same observable behavior this branch produced extension-locally in 2. The red On Same shape on the other cross-repository (fork) PRs opened today — #208265 and #208267 both have 0 CI lane checks — while PRs whose head branch lives in |
AI-assisted: yes
Closes #208201
What Problem This Solves
provenance.kind = "external_user"on the admitted message, but acontextVersion: 2tool factory in a Codex run observedctx.inputProvenance === undefinedwhilectx.senderIsOwnerwastrue. Their integration stays disabled instead of mistaking the gap for a non-user origin.before_prompt_buildhooks only; this PR covers the tool-construction boundary and does not touch that file. ClawSweeper review on the issue: "current main recordsexternal_useron ordinary WebChat input but omits it from the run context consumed by plugin tool factories", next step "preserve admitted input provenance before Codex tool factories run".Why This Change Was Made
resolveCodexAdmittedInputProvenancekeeps an explicit producer origin (internal_system,inter_session) authoritative and otherwise falls back to the admitted user message (userTurnTranscriptRecorder.message, then its staged pending input), which is wherechat.sendstampsexternal_userfor a non-synthetic client.params.inputProvenancefrom the run and keep theirundefinedtest, so they are untouched.createOpenClawCodingToolsAsyncalso feeds requester tool policy, wherehasExternalRequestertreatskind === "external_user"like a present sender field.User Impact
ctx.inputProvenance.kind === "external_user"for the same run whose stored input carries that provenance; an explicit system origin still arrives unchanged; missing provenance stays absent.extensions/codex/src/app-server/turn-params.ts(resolveCodexAdmittedInputProvenance, next to the existingreadCodexCurrentSenderrecorder read) and its single use inextensions/codex/src/app-server/dynamic-tool-build.ts. Regression fixtures:constructs tools with the admitted origin of an ordinary WebChat turn,... of an explicit system origin, andconstructs tools without an origin when the turn recorded noneinextensions/codex/src/app-server/dynamic-tool-build.provenance.test.ts.Evidence
aispace/worktrees/issue-208201at base03cdb2cef17, real Codex extension tool construction throughbuildDynamicTools.# GREEN + format/lint/typecheck after the fix bash skills/fix-pr/scripts/validate.sh \ extensions/codex/src/app-server/dynamic-tool-build.ts \ extensions/codex/src/app-server/turn-params.ts \ extensions/codex/src/app-server/dynamic-tool-build.provenance.test.ts{ kind: "external_user", sourceChannel: "webchat" }for an admitted Control UI turn that carries no explicit run origin, and{ kind: "internal_system", sourceTool: "restart" }is still passed through verbatim when the run supplies one.dynamic-tool-build.test.ts, then moved to the sibling file above because the repo's line-cap ratchet forbids growing that baseline file) fail withAssertionError: expected undefined to deeply equal { kind: 'external_user', sourceChannel: 'webchat' }—Tests 1 failed | 2 passed | 77 skipped (80). The two control cases already passed on base, which pins the change to the missing-fallback path.