Skip to content

fix: remove stale internal export paths - #196862

Merged
steipete merged 2 commits into
mainfrom
fix/knip-canonical-owner-exports
Nov 11, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/knip-canonical-owner-exports

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Related: #192954

What problem this solves

Hourly full CI reports stale internal exports after production consumers moved to their canonical owners. Remove the redundant facade paths, and make the tests consume the same owners as production. Published SDK entrypoints and active compatibility constructors are preserved.

This continues @vincentkoc's original repair. Main has since supplied production consumers for four of the five key-file exports in the original qualification hold. The remaining helper, createKeyFile, is now private; its fixture callers use the existing loadOrCreateEndpointKey operation. Main's corrected OAuth fixture is retained when resolving the integration conflict.

Changes and behavior

Provider/session/model/OOM tests now import their actual owners. MCP-directory tests exercise assembled output while preserving Unicode sanitization, truncation, deterministic ordering, and the independent 4096-byte contract. The billing-warning reply implementation moves unchanged to a leaf shared by runtime and tests. No dependencies, overrides, runtime configuration, schema, or scanner exemption are added.

The change removes 49 net production lines. Test/helper growth is 20 lines; the canonical test ratchet counts 21, covered by the separate exact allocation for provider hook scope/receiver and MCP output contracts. The shared scalar and inherited debt are unchanged.

Validation

  • Focused Node 26.12.1: 20 files, 239 passed, 18 skipped, zero failures.
  • Same focused suite on the pinned OpenClaw Bun: 20 files, 239 passed, 18 skipped, zero failures.
  • Skips: thirteen native Iroh cases lack the native binding; one config.openFile xdg-open case and four OOM/Bash cases require Linux. The key-file and staging owners pass, as does unavailable-transport handling.
  • Independent Codex review: no actionable P0–P2 findings.
  • pnpm check:changed --staged --base 8ae6b3852f9775007478e69692068828e3c7fc14: all 35 other selected checks pass; exit 1 solely for the attributed inherited export findings below. This is a scoped green repair with a retained failing overall check, not a claim that main dependency CI is green.

The exact main parent has 57 production and 32 full-tree findings. The candidate removes 28 production and 7 full-tree findings, leaving exactly 29 production and 25 full-tree inherited signatures; scripts remain 0. There are no new findings or resolution errors. Full check:changed completed in 550.31s, with only the inherited export scan failing. Older-head skipped CI is not passing proof. The exact-head CI watcher is green for run 43053047481, with no pending current-head checks. This does not substitute for the next hourly full-main run. ClawSweeper reviewed final head dea8997cae1c080452dd761047860f6b1d780cfd with no findings or open checklist items (review).

Release-note context

Internal export-owner cleanup restores dependency-check signal without changing product behavior. Original repair by @vincentkoc; contributor credit is preserved.

All 18 conditional skips in both local runtime proofs

src/gateway/openclaw-id/tunnel-child/tunnel-child.test.ts (13; native Iroh unavailable):

  • creates a private endpoint key and reports K_srv
  • refuses a peer that is not admitted before any stream
  • proxies HTTP with ingress facts and strips client identity headers
  • passes gzip responses through byte for byte
  • proxies WebSocket messages both ways
  • serves at most 64 streams at once and queues the rest
  • resets a stream with a malformed HEAD
  • closes a live connection with revoked when membership drops the key
  • exits 0 by itself after disconnect
  • exits 0 by itself after SIGTERM
  • serves on the key file that holds the bound K_srv
  • promotes a staged K_srv that the binding names
  • stays off without creating a key when the bound K_srv is gone

src/gateway/server-methods/config.test.ts (1; Linux only): returns actionable headless environment error when xdg-open is missing.

src/process/linux-oom-score.test.ts (4; Linux only): sets the child OOM score while preserving argv0 and parent score (undefined and /opt/shims/claude); protects Bash-as-sh imported functions (both prepareOomScoreAdjustedSpawnPreservingExecEnv and prepareOomScoreAdjustedSpawn).

Introducing changes and author attribution
Obsolete path Introducing change Author
Models/client-cap/session/OOM facades #192552 (625945b7ae01) @vincentkoc
Provider auth/catalog facades #190205 (f63e5cd0f6d3) @vincentkoc
Provider failover/external-profile facades #132716 (964fa991c0af) @steipete
External-auth forwarding module #139911 (071f606eae77) @steipete
Modern-model-ref facade #129184 (33d8f24c9926) @steipete
Provider hook-runtime facade direct commit a7436c8b4a93 @vincentkoc
Provider auth type facades #190544 (cf1ae7bb6a72) @vincentkoc
Compaction heading helper #196207 (c7152f3bda8e) @aniruddhaadak80
MCP directory constants/sanitizer #196252 (80ba593b8b14) @roboclaw-bot
Billing-warning reply helper #191326 (56617cd00086) @etzelm
Key creation helper #196380 (37a3b162a0c5) @jalehman

Remaining inherited export failures on the exact main parent

These are unresolved main regressions, not noise or newly introduced findings. Each is present in the exact parent 8ae6b3852f9775007478e69692068828e3c7fc14 scan and the candidate residual set. Separate coherent repairs are linked; their final status is tracked on those PRs.

Owner / residual count (production/full-tree) Introducing change Author Separate repair
Knowledge projections 23/21 #196767 (9b7dcdc7a66dc1bbcb0767b8109e798eb826954e) @jalehman #197260
Telegram widget contracts 2/1 #196991 (b22f35f7ed76552778bc185cc65a6177e8ad8b02) @obviyus #197271
Session lease diagnostic projection 1/0 #196724 (2c4e34a72f490c710bc155319fcabf872f482b3e) @fuller-stack-dev #197271
Rebind contracts 3/3 #196388 (5f2f21a7ee193fdd4aa8ac42a407eefc04905255) @jalehman #197271

Exact staged test-budget gate passed: 6,659,880 LF-counted test lines against 6,659,881 ceiling (1 line of existing slack). The separate 21-line allocation covers only this change.

@vincentkoc vincentkoc self-assigned this Nov 10, 2026
@clawsweeper

clawsweeper Bot commented Nov 10, 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 gateway Gateway runtime agents Agent runtime and tooling size: M labels Nov 10, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR removes unused internal exports and redirects tests to the existing implementation owners.

Example: An MCP tool description contains Unicode separators and full-width characters.

  • Before: Tests check sanitization through an exported helper.
  • After: Tests check the assembled tool directory for the same sanitized output, including “A b c d A”.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused cleanup is coherent and has no actionable findings; available execution evidence is test-based, and exact-head CI remains pending.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored internal cleanup is outside the ordinary contributor proof gate; supplied evidence reports focused Node and pinned-Bun tests, with native-transport and platform skips explicitly identified, rather than a live product demonstration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Hourly dependency checks report stale internal exports after production callers moved to canonical owners.
Reason: Maintainer direction is established, and the cleanup removes redundant internal surfaces without adding runtime policy, configuration, or public API changes.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored cleanup removes stale internal export paths, and review found no actionable correctness or security defects.

Priority: P3
Reviewed head: dea8997cae1c080452dd761047860f6b1d780cfd

Before merge

None.

Findings

None.

Agent review details

How this fits together

Agent, provider, process, and Gateway modules expose internal operations consumed by runtime callers and tests; this change removes redundant forwarding paths while retaining their implementation owners and published entry points.

flowchart LR
  A[Runtime callers] --> B[Canonical implementation owners]
  C[Focused tests] --> B
  D[Published SDK entry points] --> B
  B --> E[Provider and Gateway behavior]
  F[Export scanner] --> B
Loading

Technical review

Best possible solution:

Land the focused owner cleanup through the normal exact-head CI gates while preserving published SDK entry points and active compatibility constructors.

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

Fetched main contains the redundant exports, and caller searches confirm the migrated ownership paths; scanner results are reported in the maintainer evidence and were not rerun during this read-only review.

Is this the best way to solve the issue?

The patch follows the smallest complete fix: remove redundant exports, migrate their test consumers, and retain the existing runtime implementations and supported public boundaries.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Model, session, client-capability, and OOM forwarding paths keeps the original intent (625945b: Cold-start isolation separated implementation owners while preserving facades; current production callers already use those owners, and active compatibility constructors remain.)
  • Provider auth and catalog aggregate exports changes intended behavior with a stated reason (f63e5cd: The earlier repair routed execution through existing auth and catalog owners while retaining aggregate exports; this PR explains their subsequent retirement after caller migration.)
  • Provider external-auth forwarding module keeps the original intent (071f606: Native bindings compose external-auth operations at the loader boundary; production now consumes that binding directly, leaving the forwarding module redundant.)
  • Provider auth type facade changes intended behavior with a stated reason (cf1ae7b: The type relocation retained four facade exports while moving consumers to the import-free data owner; this cleanup removes those unused internal exports while preserving public reachable contracts.)
  • Live model policy hook keeps the original intent (a33caab: Provider plugins own modern-model policy; the test-owned consumer now invokes the same resolved plugin hook with its scope, receiver, context, and exact-true semantics preserved.)
  • MCP directory sanitization and size contract keeps the original intent (80ba593: The directory bounds and sanitizes untrusted MCP descriptions; only helper visibility changes, and tests now assert assembled output against independent limits.)
  • Billing-warning responses keeps the original intent (56617cd: Successful config writes return and log billing-route warnings; the implementation is relocated unchanged and remains called by the write owner.)
  • Linked-claw key-file handling keeps the original intent (37a3b16: Linked claws must use their bound keys without minting replacements; this PR preserves that behavior and makes the lower-level creation helper private.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit 625945b adds src/agents/models-config.ts:14 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 625945b7ae01; files: src/agents/models-config.ts)

PR surface

Source -49, Tests +20, Other -2. Total -31 across 42 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 13 34 83 -49
Tests 27 144 124 +20
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 2 4 -2
Total 42 180 211 -31

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.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: Internal export cleanup improves dependency-check signal without changing user-facing behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-10T21:07:02.923Z sha 645a4a5 :: needs maintainer review before merge. :: none

Reviewed November 11, 2026, 11:01 AM ET / 16:01 UTC (Revision 2).

Integrate main's OAuth fixture correction while preserving the original export-owner repair. Keep key creation private and route fresh-key fixtures through the existing load-or-create owner.

The exact +21 test-line allocation preserves scoped provider hook receiver semantics and assembled MCP output contracts without changing the shared scalar or inherited debt.

Co-authored-by: Vincent Koc <[email protected]>
@steipete
steipete marked this pull request as ready for review November 11, 2026 15:54
@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

Updated head: dea8997cae1c080452dd761047860f6b1d780cfd. The previous review had no open checklist findings. The old draft qualification hold is addressed: main supplies four of its five remaining key-file consumers, and this head makes the remaining createKeyFile helper private while fixture callers use loadOrCreateEndpointKey. The main integration conflict retains the corrected OAuth fixture; contributor ancestry and credit are preserved.

Both focused runtime proofs passed 239 tests across 20 files (18 conditional skips explicitly listed in the body). All 35 other selected check:changed gates pass. Canonical export scans remove 28 production and 7 full-tree findings, with zero new findings; remaining 29/25 signatures match exact main parent 8ae6b3852f9775007478e69692068828e3c7fc14 and are attributed in the updated body with separate repair PRs. The test-budget guard and independent Codex review also pass. Overall check:changed remains red for those inherited exports; no skipped or older-head CI is claimed green.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T15:57:21.388569Z dea8997 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: dea8997cae1c080452dd761047860f6b1d780cfd
  • Maintainer: @vincentkoc
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/sessions/auth-storage.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 11, 2026
@steipete
steipete merged commit 5d8c251 into main Nov 11, 2026
237 of 238 checks passed
@steipete
steipete deleted the fix/knip-canonical-owner-exports branch November 11, 2026 17:02
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed 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.

2 participants