Repository navigation
refactor: consolidate provider streams and plugin feature internals - #167227
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. Reviewed October 8, 2026, 8:33 AM ET / 12:33 UTC. ClawSweeper reviewWhat this changesThis PR consolidates provider streaming, OpenAI auth setup, Policy diagnostics, and Workboard lifecycle helpers while preserving existing behavior. Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep open: this is useful, maintainer-authored consolidation, and no concrete introduced defect was found. Current main still contains the duplication this PR removes. Priority: P3 Before mergeNone. FindingsNone. Provenance
Tests
Agent review detailsHow this fits togetherProvider adapters turn model requests into streamed replies. Policy evaluates operator requirements, while Workboard manages task cards and their execution records. flowchart TD
A[User and operator inputs] --> B[Provider stream adapters]
A --> C[Policy checks and repairs]
A --> D[Workboard actions and storage]
B --> E[Streamed model replies]
C --> F[Diagnostics and repair recommendations]
D --> G[Updated task cards and notifications]
Technical reviewBest possible solution: Keep shared mechanics with their existing owners while preserving provider-specific transport decisions, Policy repair classifications, and Workboard settlement contracts. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes behavior-preserving consolidation rather than a reported user-facing defect. Is this the best way to solve the issue? Yes: the reviewed changes reuse existing owners and remove duplicate mechanics without introducing a competing public API or configuration path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b3196dfda335. Provenance checked
TestingProof path: unit tests only. Added test files: 0. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -1208, Other 0. Total -1208 across 66 files. View PR surface stats
Stored data modelPersistent data-model change detected: LabelsLabel changes:
Label justifications:
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 |
Regenerate the manifest after #167227 changed Workboard browser code. Refresh controlUi.entry and controlUi.styles to the current immutable bundle hash so the build-artifacts generated-assets check matches source again. Only generated metadata changes; plugin behavior and assertions are intact.
…penclaw#167227) * refactor: consolidate provider streams and plugin feature internals * refactor: isolate Google provider stream construction * refactor: keep response state updates explicit * refactor: preserve image logging and auth descriptor copies * refactor: distinguish Workboard mutation bindings
Regenerate the manifest after openclaw#167227 changed Workboard browser code. Refresh controlUi.entry and controlUi.styles to the current immutable bundle hash so the build-artifacts generated-assets check matches source again. Only generated metadata changes; plugin behavior and assertions are intact.
What Problem This Solves
Provider streams, Policy checks, and Workboard actions repeat lifecycle and validation logic that must stay consistent across variants.
User Impact
No user-visible change. Provider requests, model IDs, authentication precedence, configuration, diagnostic text, and persisted Workboard records remain unchanged.
Why This Change Was Made
Provider adapters share stream construction and content-event handling while keeping transport-specific acceptance, errors, and recovery explicit. Google stream construction sits above its shared request/lifecycle contracts. OpenAI image generation shares auth setup, and route policy removes plumbing for endpoints already rejected by its classifier.
Policy reuses ordered shape validation, finding construction, and check/fix metadata. Workboard shares mutation lifetime, run settlement, notification construction, and bounded string-list validation. Existing owners still control authority checks, write settlement, and cleanup.
Net production LOC: −1,208 across 65 source files (AI −293, OpenAI −123, Workboard −130, Policy −662). Tests, fixtures, test support, generated files, and declarations are excluded. Permanent tests are unchanged; the assertion baseline only shrinks for removed casts.
Evidence
Exact-head hosted CI 37776924956 passed at
4bcab20b29faa67cd886d7409c954a2543c3d1ce, including extension typed lint. The complete check-run census contained no failing or canceled checks, and the CI/security gate passed. ClawSweeper completed its review of that head with no findings.no-shadow, scoped types, full browser tests, and independent review passing afterward.a889961d886f→ed25f4f84778found no API changes; the final Workboard local-binding rename does not change that surface.A local changed-gate failure was inherited from main: both production and full-tree Knip report
SessionPendingInputStatere-exported fromsrc/config/sessions/session-accessor.sqlite-pending-inputs.ts. A fresh, clean main checkout at8bacf4fe0cb70318567bb7d8bb3a44325af71205, with a frozen install, reproduced both findings. The file's Git blob is identical in main and this candidate (256c9c8c76ee84a26599a352650bb8e548504dc4); this PR does not touch that owner.Local OpenAI runs initially had seven timing failures involving socket pacing, oversized-error aborts, and speech deadlines. Focused and clean-main investigation retained those failures rather than changing assertions or budgets. Every initially failing case passed in the complete Linux run; this is environment-specific passing evidence, not a claim that the local failures were fixed. Local SDK declaration preparation exceeded its unchanged five-minute deadline; Linux preparation completed successfully.
Independent reviews completed. Three findings were rejected with parent-source and entry-point proof: official HTTP endpoints are rejected before route normalization; the sole Anthropic cache marker remains on the tool-result fallback; and the parent already permits browser-session subscription auth with a broker while retaining separate Platform-only provider readiness. All 32 browser-readiness predicate combinations match, and the unchanged broker-session test passes. Reviews of the Google module boundary and the final lint repairs found no actionable P2-or-higher findings.