Skip to content

fix(config): preserve sensitivity and URL redaction metadata - #139337

Merged
steipete merged 1 commit into
mainfrom
steipete/split-135868-config-redaction
Sep 5, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/split-135868-config-redaction

Conversation

@steipete

@steipete steipete commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Related: #135868

Independent side-Gateway stage 1 of 3 in the #135868 split: concern F, config sensitivity and URL redaction metadata.

What Problem This Solves

Fixes an issue where switching the plugin that owns a channel could expose credentials retained for another owner in Gateway config responses and system-agent reads. It also fixes config saves rejecting redacted credential-bearing URLs when their UI hint says sensitive: false.

Why This Change Was Made

Channel metadata collection now preserves every discovered owner's positive sensitivity and url-secret declarations while the selected owner still supplies the schema, labels, and other presentation. URL restoration follows the same protection rule as redaction. The existing object-restoration branches and sensitivity-classifier helpers are consolidated without changing SecretRef or wildcard behavior.

The metadata producer is the common boundary for Gateway and system-agent consumers; duplicating protection in those consumers would leave schema and write-side restoration inconsistent. The manifest documentation now explains the contract.

User Impact

Retained channel credentials stay redacted after owner changes. Public URLs remain visible, and credential-bearing URLs survive a config read/edit/save round trip. No new configuration, storage schema, dependency, or protocol changes.

Evidence

  • Reproduced on pre-fix main: all 6 metadata owner/order cases failed; both system-agent owner-switch cases exposed the inactive synthetic credential; all 3 non-sensitive URL restoration cases failed.
  • Patched owner and neighbor proof: 329 tests passed across 13 suites covering metadata/schema selection, snapshot redaction/restoration, system-agent reads, Gateway config responses, and config-method write/auth neighbors. The finalized URL suite was rerun: 61 tests passed.
  • Production: +63/-64, net -1. Tests: +216/-44, net +172, which is 16 lines smaller than this concern's source-branch test delta. Docs: +8; tooling: unchanged.
  • Full node scripts/check-changed.mjs passed, including core/test typechecking, lint, config-doc and architecture guards, and all three Knip scans with zero entries.
  • Final checkpoint/revert proof kept the committed tests and restored pre-fix production: 9 intended failures and 61 passes. Restoring the candidate returned the tree to the committed bytes.
  • Fresh local and committed-branch Codex reviews are scoped-clean with no accepted/actionable P0/P1 findings. ClawSweeper reviewed the initial head with no findings or requested pre-merge/rank-up changes (review); the subsequent main rebase has the same stable patch ID and a fresh scoped-clean Codex review. CI passed on initial head 32b40a7a44d (run); exact-head CI for rebased 5dc9f6ca2d7 passed (run).

The exact introducing commit is not established; the defects were reproduced against the task's main baseline before production changes. This PR carries only the independently useful config concern from #135868; automatic recovery and Gateway cleanup authority remain in their owning stages.

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Sep 5, 2026
@steipete
steipete marked this pull request as ready for review September 5, 2026 19:50
@steipete steipete self-assigned this Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 4:10 PM ET / 20:10 UTC.

ClawSweeper review

What this changes

Preserves channel plugins’ credential-redaction declarations across owner changes and restores redacted credential-bearing URLs correctly during config saves.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused repair: the inspected main revision still contains both defects. No actionable introduced findings were identified, and the broader recovery PR does not supersede this independent change.

Priority: P2
Reviewed head: 5dc9f6ca2d776920e2a3ff6a1ffdf80ea5269e76

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused shared-owner repair with meaningful regression coverage and no actionable introduced findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied MEMBER association exempts this PR from external-contributor proof requirements. Inspected tests exercise the metadata producer, Gateway projections, system-agent reads, and URL restoration; no live execution is claimed, and no material authority-transfer change requires 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 MEMBER association exempts this PR from external-contributor proof requirements. Inspected tests exercise the metadata producer, Gateway projections, system-agent reads, and URL restoration; no live execution is claimed, and no material authority-transfer change requires additional final-effect proof.
Evidence reviewed 9 items Introduced ownership boundary: The complete pinned merge-base-to-head patch preserves selected schema and presentation ownership while combining positive sensitive and URL-secret declarations. Base-only config-writing changes were excluded from PR attribution.
Current main still needs the repair: The three central production files are identical between fetched main and the PR merge base. Main therefore retains selected-owner-only metadata and the non-sensitive-hint URL restoration mismatch.
Latest release comparison: The supplied latest release resolves to the recorded release commit. Its restoration implementation still lets sensitive:false suppress credential-bearing URL restoration.
Findings None None.
Security None None.

How this fits together

Plugin manifests supply configuration schemas and sensitivity hints to Gateway settings responses and system-agent reads. The same hints help restore hidden credentials when edited configuration is saved.

flowchart TD
  A[Discovered plugin manifests] --> B[Select channel schema owner]
  A --> C[Combine positive redaction declarations]
  B --> D[Runtime configuration metadata]
  C --> D
  D --> E[Redacted Gateway and agent reads]
  E --> F[Edited configuration]
  F --> G[Restore original hidden credentials]
  D --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -1, Tests +172, Docs +8. Total +179 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 4 63 64 -1
Tests 4 216 44 +172
Docs 1 8 0 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 287 108 +179

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +63/-64, net -1; tests +216/-44, net +172 The shared-boundary repair adds meaningful regression coverage without net production growth.

Technical review

Best possible solution:

Keep sensitivity preservation at the shared metadata producer and maintain symmetric redaction/restoration without changing stored credentials or selected schemas.

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

Yes, from source: switching between channel owners drops the inactive owner’s sensitivity hints, and sensitive:false prevents restoration of URLs that the read path redacts. Execution was not performed in this read-only review.

Is this the best way to solve the issue?

Yes. Repairing the shared metadata producer protects both consumers; separate Gateway and system-agent guards would duplicate policy and leave restoration inconsistent.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3dd0be4132a5.

Labels

Label changes:

  • add P2: This repairs bounded credential-redaction and config-save defects without adding new capability or configuration.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER association exempts this PR from external-contributor proof requirements. Inspected tests exercise the metadata producer, Gateway projections, system-agent reads, and URL restoration; no live execution is claimed, and no material authority-transfer change requires additional final-effect proof.

Label justifications:

  • P2: This repairs bounded credential-redaction and config-save defects without adding new capability or configuration.
  • 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 MEMBER association exempts this PR from external-contributor proof requirements. Inspected tests exercise the metadata producer, Gateway projections, system-agent reads, and URL restoration; no live execution is claimed, and no material authority-transfer change requires additional final-effect proof.

Evidence

What I checked:

  • Introduced ownership boundary: The complete pinned merge-base-to-head patch preserves selected schema and presentation ownership while combining positive sensitive and URL-secret declarations. Base-only config-writing changes were excluded from PR attribution. (src/config/channel-config-metadata.ts:265, 5dc9f6ca2d77)
  • Current main still needs the repair: The three central production files are identical between fetched main and the PR merge base. Main therefore retains selected-owner-only metadata and the non-sensitive-hint URL restoration mismatch. (src/config/redact-snapshot.ts:647, 3dd0be4132a5)
  • Latest release comparison: The supplied latest release resolves to the recorded release commit. Its restoration implementation still lets sensitive:false suppress credential-bearing URL restoration. (src/config/redact-snapshot.ts:647, 3928bad9badf)
  • Read and write symmetry: The revised restore predicate matches existing URL redaction independently of name-based sensitivity. Missing-original rejection, SecretRef source/provider identity checks, array identity matching, and explicit replacement values remain intact. (src/config/redact-snapshot.ts:615, 5dc9f6ca2d77)
  • Shared consumer and dependency boundary: Runtime schema construction and system-agent redaction both consume the repaired metadata producer; Gateway config writes use the shared restoration function. URL classification comes from this repository’s net-policy package, with no dependency on the Codex runtime or protocol. (src/config/runtime-schema.ts:22, 5dc9f6ca2d77)
  • Regression coverage and reported validation: Inspected coverage checks six owner/order combinations, both system-agent switching orders, all five Gateway snapshot projections plus raw output, and three URL round trips including public URLs and missing originals. The captured PR body reports 329 passing tests and a checkpoint with nine intended pre-fix failures; these runs were not independently executed during this read-only review. (src/gateway/config-get-response.test.ts:81, 5dc9f6ca2d77)

Likely related people:

  • juyaohuidt: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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 (1 earlier review cycle)
  • reviewed 2026-09-05T19:54:42.786Z sha 32b40a7a44da655603d1540ab5f6499703d8d1b3 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the steipete/split-135868-config-redaction branch from 32b40a7 to 5dc9f6c Compare September 5, 2026 20:02
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 5, 2026
@steipete
steipete merged commit 1c7a73f into main Sep 5, 2026
192 checks passed
@steipete
steipete deleted the steipete/split-135868-config-redaction branch September 5, 2026 20:15
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
necromman pushed a commit to necromman/openclaw that referenced this pull request Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR 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