Skip to content

fix: let Codex plugin tools recognize direct Control UI input - #208252

Merged
daniel-lxs merged 2 commits into
mainfrom
openclaw/codex-tool-input-provenance-3b10aa
Nov 29, 2026
Merged

daniel-lxs merged 2 commits into
mainfrom
openclaw/codex-tool-input-provenance-3b10aa

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #208201

What Problem This Solves

A plugin that requires direct user input can stay disabled on an owner-authenticated Control UI turn. The Gateway records the input as external_user, but the Codex tool factory gets no origin for that same run.

User Impact

The factory receives the origin without guessing from the owner bit. No configuration or migration is required. Input provenance is not consent to perform an action.

Why This Change Was Made

I kept the producer’s origin before transcript hooks can rewrite the message and passed it to the factory only as a fallback for the current user attempt. Explicit origins take precedence. Internal retries and unattributed inputs do not acquire the original user’s stamp.

I found no decision to withhold this metadata from factories. #179816 introduced it as information for plugins. #120366 deliberately distinguishes absent provenance when capturing scheduled MCP authority. I left that policy unchanged. #203467 addresses prompt hooks, not factories.

Evidence

I built main and the published head on Crabbox AWS. On each, I paired a browser as the owner of an isolated Gateway, sent from the Control UI composer in a fresh non-main session, and received the requested live OpenAI reply through native Codex. I matched the browser’s send ID to the stored user input and both invocations of an optional v2 factory that returned null.

Same-run observation Main 8cc7a2cbe4df Published head ade044a0a762
Stored input origin external_user external_user
Factory input origin, both calls absent external_user
Stored owner, factory owner, live invocation guard all present all present
Live reply received yes yes

The regression failed on main with expected undefined to be 'external_user'. I ran 147 tests across six focused files on 55199753a8a5; all passed. Coverage included explicit system input, unattributed input, internal retry, scheduled MCP authority and prompt-prefix stability. Core and harness-test typechecks, targeted lint and formatting passed. I verified the published commit has the identical Git tree and rebuilt and reran the live browser proof on that exact commit. I did not test the reporter’s third-party integration or other harnesses.

Contributor: @daniel-lxs

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

🦞 Made with OpenClaw

roboclaw-bot and others added 2 commits November 29, 2026 10:45
Worked on by:
- @daniel-lxs

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 51b50c8e-e0a5-4a28-a3fc-e8db09b8ad43
@clawsweeper

clawsweeper Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: S labels Nov 29, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. labels Nov 29, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 29, 2026 10:55
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 29, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 29, 2026
@clawsweeper

clawsweeper Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

Preserves producer-supplied input provenance and forwards it to plugin tool factories on direct user attempts.

Example: An owner sends “hello” through Control UI to a native Codex session.

  • Before: The stored input has external_user provenance, but the plugin factory receives no origin.
  • After: The plugin factory receives external_user while core tool-policy provenance remains unchanged.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Reported exact-head shipped-path proof and focused regression controls support this narrow repair; hosted CI remains in progress.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The public before/after table reports an isolated owner-paired Control UI send through native Codex on the published head, matching stored input and both factory observations by send/run identity; other harnesses and the reporter's third-party integration were not exercised.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Plugins requiring direct-user provenance can remain disabled despite an authenticated Control UI user submitting the current input.
Reason: Restores documented factory metadata through existing owners, with direction established by maintainer authorship and no new setting or permission.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR repairs a current-main metadata gap, and the pinned diff has no blocking findings.

Reviewed head: ade044a0a7622faa938c56eb2962504a93b6faa4

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Gateway stamps user input, the transcript recorder retains its producer facts, and the harness host supplies those facts to plugin tool construction.

flowchart LR
  A[Control UI input] --> B[Gateway input producer]
  B --> C[Transcript recorder]
  C --> D[Harness host]
  D --> E[Plugin context mapper]
  E --> F[Plugin tool factory]
Loading

Technical review

Best possible solution:

Land the shared-host metadata repair after required checks pass and reconcile the overlapping factory proposal.

Do we have a high-confidence way to reproduce the issue?

Current source establishes the recorder-to-factory mismatch, and the PR reports a matching live before/after reproduction; this read-only review did not execute it.

Is this the best way to solve the issue?

Using the existing recorder owner and shared harness host repairs factory metadata while preserving explicit origins, retry behavior, and separate tool-policy inputs.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2a428f218211.

Provenance checked

  • Plugin factory input provenance keeps the original intent (f6ee991: Expose run identity and input origin so plugins can recognize background completions while keeping those facts separate from authority.)
  • Host-owned construction facts keeps the original intent (refactor(agents): unify tool availability and plugin work ownership #152073: Make the prepared host own publication availability rather than mutable harness options.)
  • Scheduled configured-MCP authority keeps the original intent (a345ede: Keep scheduled tool authority bounded by the creator's captured executable surface and preserve distinct provenance-sensitive authority handling.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 164bd67 adds src/agents/harness/host-requester.ts:4 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 164bd6756af1; files: src/agents/harness/host-requester.ts)
  • Vito Cappello: Raw commit f6ee991 adds src/agents/openclaw-tools.plugin-context.ts:109 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f6ee99166170; files: src/agents/openclaw-tools.plugin-context.ts)

PR surface

Source +33, Tests +43, Docs +4. Total +80 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 40 7 +33
Tests 1 43 0 +43
Docs 1 5 1 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 88 8 +80

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Root-cause cluster

Relationship: same_root_cause
Canonical: #208201
Summary: Two open PRs address the reported factory-origin gap; the prompt-hook repair covers a separate consumer.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: Third-party factories that previously observed absent provenance on direct user turns will now receive external_user; this maintainer-authored repair restores the documented optional metadata contract without changing core authority.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • merge-risk: 🚨 compatibility: Third-party factories that previously observed absent provenance on direct user turns will now receive external_user; this maintainer-authored repair restores the documented optional metadata contract without changing core authority.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 29, 2026, 6:00 AM ET / 11:00 UTC.

@daniel-lxs
daniel-lxs merged commit 767c517 into main Nov 29, 2026
228 checks passed
@daniel-lxs
daniel-lxs deleted the openclaw/codex-tool-input-provenance-3b10aa branch November 29, 2026 11:23
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
* fix: show Claude CLI document uploads only once in chat

* fix: show Claude CLI document uploads only once in chat

OpenClaw-Publication: 4555cb04-bff2-43b3-aff8-ec271d6567b2

* fix: keep Claude document uploads on the message that sent them

* fix: preserve the released message queue result contract

Release adaptation: Use an optional accepted-input observer instead of widening
queueMessage's released Promise<void> contract. Reuse the stable steering and
transcript-rewrite handlers; leave source admission, native image steering,
config, and all SQLite schemas unchanged. The existing history index columns
also carry exact document correlation. Keep the released model-hook test layout.

Companion audit through be407a4: no later #203866 reference. PRs #208535
(Claude compacted fork summaries), #206158 (native subagent status), and
#205663 (image dimensions) are separate. PRs #208252 (Codex source), #207022
(embedded prompt dispatch), #206969 (fallback), #205963 (Copilot question
policy), and 50a7368 (snooze) do not own this path. SHA mentions in
#204700 and #204685 are update/qualification records, not follow-ups.

(cherry picked from commit 269f884)

Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 30, 2026
…aw#208252)

Pass the input origin recorded by the Gateway to plugin tool factories on direct user attempts. Preserve explicit origins and the separate provenance used for scheduled MCP authority.

Closes openclaw#208201

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 51b50c8e-e0a5-4a28-a3fc-e8db09b8ad43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Codex plugin tool factory does not receive external_user provenance on authenticated Control UI turns

2 participants