Repository navigation
refactor(auth): isolate provider auth data contracts - #190544
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR moves four provider-auth data types into an existing import-free module while preserving their declarations and public facade exports. Example: Noninteractive onboarding resolves EXAMPLE_API_KEY to an environment-backed credential.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored draft open: it makes a coherent, narrowly scoped dependency cut, and source review found no introduced defect. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherProvider-auth contracts connect onboarding and provider setup to host credential orchestration; this change separates plain input/result types from configuration, runtime, and persistence contracts. flowchart TD
A[Onboarding commands] --> B[Provider auth helpers]
A --> C[Auth data contracts]
B --> C
D[Host authentication contracts] --> C
E[Stable plugin facade] --> C
E --> D
Technical reviewBest possible solution: Keep the existing leaf module as the sole definition owner, retain the stable facade exports, and validate the affected type and onboarding contracts before landing. Do we have a high-confidence way to reproduce the issue? This PR reports no runtime bug; source inspection confirms the dependency coupling and unchanged declaration bodies without executing target code. Is this the best way to solve the issue? The extraction is the smallest complete change: it reuses an existing owner, removes the former definitions, migrates affected imports, and preserves the public surface without compatibility wrappers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bcf8f7b74556. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests 0. Total 0 across 10 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 1, 2026, 12:25 PM ET / 17:25 UTC. |
|
Merged via squash.
|
Related: #188252
What Problem This Solves
Provider authentication data declarations live alongside host configuration and credential orchestration contracts, giving data-only consumers those type dependencies.
User Impact
No intended behavior or public API change. Credential provenance, optional fields, mutable metadata, live authentication contexts, callbacks and permissions remain unchanged. No runtime, CPU or code-size improvement is claimed.
Why This Change Was Made
Move the four existing declarations verbatim into the existing import-free
provider-auth-typesowner and retarget their internal production and parity-support consumers. Keep the four explicit exports through the established plugin facade and the existingSecretInputModeSDK export. No private compatibility forwarder or new facade export is added.The patch remains ten files, production +49/-49 LF and one test-support import replacement. No test cases, assertions, allocations, API baselines or dependency changes are added. Runtime and support bodies are byte-identical after removing type-only imports; the two live auth-context declarations are also byte-identical. The newer mainline self-hosted token-limit calculation is outside this import-only patch.
Evidence
Complete tracked-repository retired-symbol/export census: four declaration bodies unchanged, destination import-free, exactly four facade exports, no new
SecretInputModefacade export and no remaining retired private declaration/forwarder.Normal native review passed 165 tests across 12 owning auth, API-key, noninteractive onboarding, provider, self-hosted and parity files, including all three parity-support consumers.
Single-worker parity measurements: 9/15/15 tests passed, command wall 28.082s/7.836s/7.334s and Vitest duration 24.81s/5.63s/5.33s. The first run is dominated by transformation. Hosted CI wall interval was 721s; these are not runtime-performance measurements.
Targeted ten-file lint/format, core types, whitespace and test-line ratchet passed with zero test-line growth.
Normal full build passed in 199s, including SDK export/declaration and built public-consumer checks. SDK export registration and canonical API comparison are recorded separately below.
An actual public auth-context consumer compiled with
strict: true,skipLibCheck: false, NodeNext and no source-path aliases. Its file list resolvesdist/plugin-sdk/provider-auth.d.ts; it consumes option bags, key provenance, resolver parameters, mutable credential metadata and existing callbacks through public types.Fresh independent full-range review covered all ten files and the complete commit through
853f131be5e663f7e6e2dbc8028f930c981cbfa0, with no actionable correctness or security finding. The published source head is unchanged.plugin-sdk:check-exportspassed. Canonical base/head API comparison exited 0: no added/removed entrypoints; all 167 reported public root declarations and kinds are identical. Four unique reachable declaration diffs are the verbatim four-type relocation and import/export regrouping (digestf1e960552e923833329907680a4de26cff5f7ad966d2662a0ce5f55c04c8c099). No API baseline or acknowledgement was changed.Current State
Local proof and fresh source review passed at the unchanged published head
853f131be5e663f7e6e2dbc8028f930c981cbfa0. Normal preparation completed at the same head and publication transport was skipped because hosted equals prepared HEAD. The PR is ready for review. Exact-head CI 42657650202 completed successfully, including openclaw/ci-gate (38 successful jobs; 29 scope skips are not claimed as passing jobs). Normal native admission passed and the exact head was squash-merged ascf1ae7bb6a729a7f13a28ca2ef9d6f108c00566f. Uncached remote MERGED and native COMPLETE receiptd692d870a2f8d773d6cdc1c58d9a53a93cdb64c9were verified. The newer self-hosted token-limit helper is present in the landed tree. The first native request was refused before dispatch while the historical draft ci-gate was skipped; no merge was submitted then.