Skip to content

fix: preserve outbound provider policy when the current target is missing - #147939

Merged
steipete merged 5 commits into
mainfrom
codex/outbound-provider-context
Sep 14, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/outbound-provider-context

Conversation

@steipete

@steipete steipete commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes cross-provider message actions bypassing the configured policy when a turn retains its source provider but has no current conversation target.

User Impact

Provider restrictions apply consistently to ordinary, restarted, and requester-settle turns. Existing global and per-agent opt-ins retain their meaning, and genuinely unbound CLI requests remain unbound. No configuration or data migration is required. After upgrading, targetless cross-provider actions that previously bypassed the check are denied unless explicitly permitted; this intentionally enforces the documented default.

Why This Change Was Made

Provider mismatch is checked before target-dependent policy. Exact correlated recovery claims retain their source provider independently of complete delivery authority; a missing target does not grant an address, sender identity, or source-turn authority. Requester-settle already forwards channel-only origins and now has regression coverage.

The Gateway also stops treating an internal delivery fallback as a WebChat source for an unbound request. Tests cover real delivery planning, execution dispatch, command-context resolution, and Gateway RPCs. Genuine WebChat clients and explicit or remembered provider context retain their binding, while session/image forwarding, requested delivery, response ordering, and replay remain covered.

Evidence

Earlier full outbound validation passed 1,921 tests across 109 files; requester-settle delivery passed 308 tests. The final RPC, handler, execution-owner, and delivery follow-up suites passed 456 tests. The original implementation failed the missing-target and recovery regressions, and the unbound CLI cases failed before the compatibility correction. Existing global and per-agent opt-ins are covered with synthetic transports.

Changed-file checks passed, including core/test typechecks, lint, formatting, and repository guards. Independent Codex reviews through P2 have no unresolved actionable findings.

The broader hosted fallback reproduced a 6 GiB SDK-report heap failure and a mocked-UI cloud-reconciliation timeout. Both also occur on the unrelated test-only #148038 (baseline run); the UI scenario replaces Gateway WebSocket calls in the browser and does not execute the changed backend modules. These are recorded separately from this repair. Final regular PR CI passed on the exact published head, including the required aggregate gate (CI run).

Validation uses isolated state and synthetic transports. No live messaging, deployments, restarts, or configuration changes were performed.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review blocked

Automated review did not run, so no review verdict was produced.

Reason: The input-safety check could not safely complete for this revision.

ClawSweeper will not retry this unchanged revision.

Next step: No contributor action is requested. Maintainers should inspect the linked workflow run.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 14, 2026 05:26
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 14, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 14, 2026, 5:46 AM ET / 09:46 UTC (Revision 5).

ClawSweeper review

What this changes

Preserves cross-provider messaging restrictions during targetless continuations and recovery, keeps unbound CLI turns unbound, and updates regression tests, upgrade documentation, and a Docker fixture assertion.

Merge readiness

⛔ Blocked before merge - 1 item remains

The fix remains necessary: current main and the latest release still bypass provider policy when the current target is missing. No actionable introduced defect was found. The discussion resolves the earlier upgrade-policy concern.

Priority: P2
Reviewed head: d5ae12fb4cc57f746ce5e41a1ea19fd3a4c8ed6c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful regression coverage, explicit upgrade intent, and no actionable correctness findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied maintainer classification exempts ordinary contributor proof. Coverage exercises Gateway context propagation and outbound denial/opt-in behavior using synthetic transports; it is not live messaging evidence. The authority pass found no material unresolved introduced violation requiring additional final-effect proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied maintainer classification exempts ordinary contributor proof. Coverage exercises Gateway context propagation and outbound denial/opt-in behavior using synthetic transports; it is not live messaging evidence. The authority pass found no material unresolved introduced violation requiring additional final-effect proof.
Evidence reviewed 8 items Current main still contains the defect: The current-main policy returns immediately when both current target fields are missing, before evaluating a source-provider mismatch.
Latest-release check: The same target-dependent early return exists in v2026.9.4. GitHub’s contents API supplied the release source after the local historical blob was unavailable.
Introduced policy repair: The pinned merge-base-to-head patch moves target-dependent handling after provider denial. Existing routing invokes this policy before external target resolution and adapter dispatch.
Findings None None.
Security None None.

How this fits together

The Gateway carries a turn’s source provider into agent execution. Shared outbound routing uses that context and configured messaging policy to decide whether a message action may reach a channel transport.

flowchart TD
  A[Incoming turn or recovery] --> B[Gateway source context]
  B --> C[Agent message action]
  C --> D[Outbound provider policy]
  E[Global and agent settings] --> D
  D -->|Denied| F[Policy error]
  D -->|Allowed| G[Channel transport]
Loading

Before merge

  • Resolve merge risk (P1) - The prevalence of installed workflows relying on the bypass is unknown: those targetless cross-provider actions will stop unless an existing explicit opt-in permits them. This upgrade impact is accepted and documented in the discussion.
Agent review details

Security

None.

PR surface

Source +26, Tests +295, Docs +2. Total +323 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 4 44 18 +26
Tests 8 345 50 +295
Docs 1 3 1 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 392 69 +323

Review metrics

Metric Value Why it matters
Configuration compatibility 0 new settings; 2 existing opt-in scopes covered Regression coverage exercises global and per-agent authorization without introducing a migration or parallel policy knob.

Merge-risk options

Maintainer options:

  1. Retain the accepted upgrade behavior (recommended)
    Enforce the documented provider policy for targetless actions while preserving the existing opt-ins, as explicitly accepted in the discussion.

Technical review

Best possible solution:

Keep the shared policy owner and the explicitly accepted upgrade behavior, preserving existing global and per-agent opt-ins without adding another setting.

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

Yes, from source: a guarded action with a different source provider and no current target returns before policy enforcement on current main. No tests or runtime commands were executed during this read-only review.

Is this the best way to solve the issue?

Yes. Moving provider enforcement ahead of target-dependent checks and carrying recovery source context through the existing owner repairs the gap while preserving explicit opt-ins and unbound CLI behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7c665e63e221.

Labels

Label justifications:

  • P2: This repairs a bounded messaging-policy gap in targetless continuation and recovery flows.
  • merge-risk: 🚨 compatibility: Upgraded workflows that relied on the bypass will be denied unless an existing explicit opt-in permits them.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied maintainer classification exempts ordinary contributor proof. Coverage exercises Gateway context propagation and outbound denial/opt-in behavior using synthetic transports; it is not live messaging evidence. The authority pass found no material unresolved introduced violation requiring additional final-effect proof.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-14T05:36:48.972Z sha 3f2a8bb :: blocked before merge. :: none
  • reviewed 2026-09-14T05:57:15.431Z sha 23c043d :: blocked before merge. :: none
  • reviewed 2026-09-14T06:18:36.497Z sha 23c043d :: blocked before merge. :: none
  • reviewed 2026-09-14T07:43:17.903Z sha 2efc0a6 :: blocked before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

The intended upgrade behavior is to enforce the existing provider policy consistently: successful targetless sends through the early-return gap do not retain an exception. The PR body and FAQ now state that upgraded workflows will be denied unless an existing explicit opt-in permits them.

Added compatibility coverage in 23c043d using the existing Control UI recovery-claim shape. The test reconstructs the targetless WebChat source and calls the message-action runner with either a global opt-in or a per-agent opt-in overriding global denial. Both reach only the synthetic transport and pass; the full changed send-policy suite passes 15/15. Defaults, stored schemas, and live configuration are unchanged. Independent review of the complete updated candidate remains clean through P2.

The first CI run's Control UI gzip budget failure is being checked on the updated head. The original compared trees have identical UI sources, packages, lockfile, and performance tooling; no budget or baseline exception was added.

@steipete
steipete marked this pull request as draft September 14, 2026 07:28
@steipete
steipete force-pushed the codex/outbound-provider-context branch from 2efc0a6 to c5009d0 Compare September 14, 2026 08:50
@steipete
steipete marked this pull request as ready for review September 14, 2026 08:50
Preserve correlated recovery source providers independently of complete delivery authority. Keep cross-provider defaults and explicit overrides unchanged across restart and requester-settle continuations.
The explicit WebChat route fixture depended on the missing-target policy gap. Verify both the denial without opt-in and the unchanged normal outbound route when explicitly allowed.
@steipete
steipete force-pushed the codex/outbound-provider-context branch from b136f1b to 7e4ef9c Compare September 14, 2026 11:11
@steipete
steipete merged commit a5cc207 into main Sep 14, 2026
212 of 214 checks passed
@steipete
steipete deleted the codex/outbound-provider-context branch September 14, 2026 12:28
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
…sing (openclaw#147939)

* fix: enforce outbound provider policy without a current target

Preserve correlated recovery source providers independently of complete delivery authority. Keep cross-provider defaults and explicit overrides unchanged across restart and requester-settle continuations.

* test: preserve configured cross-provider opt-ins during recovery

* test: cover provider policy on explicit source reply routes

The explicit WebChat route fixture depended on the missing-target policy gap. Verify both the denial without opt-in and the unchanged normal outbound route when explicitly allowed.

* fix: preserve unbound CLI messaging context

* test: distinguish unbound and WebChat agent requests
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 gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

1 participant