Skip to content

refactor: deslop provider and Discord leftovers - #167917

Merged
steipete merged 2 commits into
mainfrom
deslop/bundle6-providers-discord-20261009
Oct 9, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/bundle6-providers-discord-20261009

Conversation

@steipete

@steipete steipete commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Provider, Policy, Workboard, and Discord implementations retain duplicate routing, normalization, and action-handling paths after earlier cleanup passes.

User Impact

There is no intended user-visible change. Provider selection, streaming, approval authority, Discord permissions, thread bindings, and Workboard data/actions retain their behavior. Configuration, schemas, protocols, dependencies, and the public SDK remain unchanged.

Why This Change Was Made

Consolidate the remaining duplicate paths at their existing owners and remove private facades and redundant types. The Discord third pass (f2d4253df4b) was applied before the provider third pass (96e4a359eaf).

The landed change removes 871 net production lines across 166 files (+1,791/−2,662), excluding tests, test support, and the shrink-only assertion baseline. Overall reduction is 853 lines across 174 files.

Application was conflict-free. Two removal hunks were dropped to retain explicit groupPolicy forwarding required by the existing Discord component security regression guard; there were no conflict-related drops. Knip also identified a leftover Policy export after its consumers moved into the same module; that constant is now private.

Evidence

Merged as bd1a35b7114fcd4abf3d3f5100d69e264e8ece06 from reviewed head 22ca73d7fa9ddbd5444dc5741a506454b4709a50. The squash is verified on origin/main, and its tree exactly matches the reviewed head merged into its actual landed parent.

  • Full-diff independent review and the subsequent two-line repair review: no actionable P0–P2 findings. All 133 assertions in the five edited Discord suites are preserved.
  • Focused runtime proof: 136 files / 2,345 tests passed across AI transports, catalog/validation, Discord, OpenAI routing/authentication, Policy, and Workboard.
  • Single-worker follow-up: 12 files / 162 tests passed, covering realtime consult context/cancellation, the edited Discord suites, Workboard batch-read/rollback, lint suppressions, PR source closure, and wrapper shadowing. Wrapper wall time: 460.10 s; seven Discord files took 231.45 s. The security-guard repair additionally passed 18 tests in 52.19 s, extension production types, and targeted lint. The eight changed-extension CI jobs passed in 1,630 job-seconds total (134–322 s each, including setup). No new test cases, timeouts, retries, skips, or suppressions were added.
  • Every selected check:changed stage completed successfully, including all 27 core test-type groups, extension production/test types, ratchets, formatting, plugin boundaries, Knip, core/extension/script lint, and architecture/storage/media/pairing guards. Extension lint completed in 309.30 s, including its previously stalled declaration prerequisite.
  • Direct sequential Knip production, full-tree, and script scans all pass with zero findings after the owned unused-export fix.
  • Runtime cycles: 0; standard Madge cycles: 0. The three supplemental package components are byte-identical to clean main.
  • Native SDK comparison: 151 modules / 3,641 exports / no API changes, digest ff7b090f; both input-integrity seals passed. The subsequent repair restores two private call-site properties and changes no imports or public signatures.
  • Pinned OpenGrep reproduced the two owned findings before repair and passed the affected module afterward. The broader local scan reported zero findings with partial analysis on 10 files; the complete hosted changed-path scan passed.

Hosted CI and inherited-main exception

Final-head CI completed 94 jobs: 68 successful, 22 configured skips, and the four failures below. The exhaustive head census contained 148 terminal check runs; there were no cancelled or missing pending checks at admission. Dependency and security-sensitive review passed. All four zero-step cancelled automation jobs on the initial head were rerun serially to success.

The pinned admin squash used the posted per-job evidence:

Final failed job Attribution
UI E2E 1/9 chat-session-prefetch-gating.e2e.test.ts:73, background history count 0 instead of 1. Same failure in independent main job.
UI E2E 7/9 chat-flow.history-recovery.e2e.test.ts:348, timeout waiting for session B history. Same failure in independent main job.
UI E2E 8/9 session-prefetch.e2e.test.ts:51, background history count 0 instead of 1. Same failure in independent main job.
CI aggregate Downstream failure because the selected UI E2E lane failed. The failed openclaw/ci-gate commit status mirrors this result.

Main's b0fb3ac3321 (#167906) intentionally requires pointer or keyboard intent before warming unopened sessions; these three E2E tests still expect automatic prefetch. Their owner and test files are byte-identical on independently failing main 9ef071e98e2f53e18deddfdb629d76f84eca19df and the actual landed parent e19bcd6bd11e9c24608aadcc9cfc4b9b670351bd. This bundle changes none of those UI/harness paths, and the mocked Gateway failures occur before provider, Discord, or Workboard actions. Updating those three stale UI expectations remains a separate follow-up.

Existing local OpenAI timing failures

The two full test files reproduced the same six failures on the candidate and clean main 22e485657b286b6a740eb7083c8c70063c813374: two oversized-error cases returned the fixture's AbortError, and four ordinary/telephony speech headers/body cases exceeded their existing 2-second limits. Both runs passed the other 35 tests. No timeout or assertion changed. The touched realtime wire cases were not used for an inherited-red waiver; final hosted failures were confined to the unrelated UI tests above.

@clawsweeper

clawsweeper Bot commented Oct 9, 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.

@steipete
steipete marked this pull request as ready for review October 9, 2026 18:37
@clawsweeper clawsweeper Bot added 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. labels Oct 9, 2026
@clawsweeper

clawsweeper Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR consolidates repeated provider, Discord, Policy, and Workboard logic at existing owners without intending to change user behavior.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful consolidation with no actionable source finding, supported primarily by reported in-process validation.
Proof confidence 🦐 gold shrimp (3/6) The verified repository-admin author is outside the ordinary external-contributor proof gate. Reported tests exercise the consolidated production owners in process; inspected screenshots cover unrelated chat loading. No material authority change was identified, and storage comparison verifies a no-migration case.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: An established area owner is continuing prior consolidation work that reduces maintenance cost. The reviewed diff preserves existing product contracts and adds no user-facing capability.

Merge readiness

✅ Ready for maintainer review

Keep open: this owner-directed cleanup remains distinct from current main, and the reviewed changes reveal no concrete introduced defect. Exact-head checks are still pending.

Priority: P3
Reviewed head: 22ca73d7fa9ddbd5444dc5741a506454b4709a50

Before merge

None.

Findings

None.

Provenance

  • packages/model-catalog-core/src/model-catalog-normalize.ts: original intent not found (5891cfe: History identifies the move of model catalog normalization into its core package; reading the older commit encountered a missing promisor object.)

Tests

  • Missing end-to-end proof: The supplied validation does not demonstrate representative provider streaming, Discord command delivery, and Workboard actions through installed entry points.
Agent review details

How this fits together

Provider plugins turn model requests into streamed responses, while Discord handles channel messages and interactions. Policy produces configuration diagnostics, and Workboard stores cards and presents board actions in the browser.

flowchart TD
 A[Model requests] --> B[Provider routing and streams]
 B --> C[Model responses]
 D[Discord events] --> E[Channel authorization and delivery]
 E --> F[Chat replies and interactions]
 G[Configuration and approval rules] --> E
 G --> H[Policy diagnostics and Workboard actions]
Loading

Technical review

Best possible solution:

Keep the consolidation at existing owners while preserving public contracts, authorization, and stored formats.

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 remove private indirection and consolidate repeated logic without introducing a competing owner or new configuration surface.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 590a0257d137.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduction and follow-up: Inspected the merge-base-to-head changes. The follow-up restores explicit groupPolicy forwarding at both Discord component authorization calls; it does not change the authorization algorithm. git diff --check passed. (extensions/discord/src/monitor/agent-components-guild-auth.ts:165, 22ca73d7fa9d)
  • Cleanup remains distinct on main: Fetched main still contains the private native-command runtime facade removed by this PR. Main changes since the merge base in the reviewed areas concern separate Anthropic contract files, rather than these introduced hunks; no superseding implementation was established. (extensions/discord/src/monitor/native-command.runtime.ts:7, 590a0257d137)
  • Provider routing contract: The extracted authored-route calculation retains model/provider/environment precedence, custom-endpoint adapter defaults, and explicit ChatGPT intent. Existing tests cover these contracts. fix(openai): align auth availability with effective routes #104685 established agreement between effective routes and credentials. (extensions/openai/provider-policy-api.ts:235, 22ca73d7fa9d)
  • Storage compatibility: Workboard consolidates row decoding while retaining field values and omission of empty child collections. Discord thread metadata keeps the same JSON snapshot operation; no schema, migration, or serialized-format change was identified. (extensions/workboard/src/sqlite-store-records.ts:269, 22ca73d7fa9d)
  • Discord dependency contract: The patch imports discord-api-types constants, and the plugin pins version 0.38.56. Its tagged source confirms ManageEmojisAndStickers and ManageGuildExpressions share bit 30; voice-message and notification flags retain bits 13 and 12. (payloads/common.ts:182, 7c75edb063e5)
  • Codex transport contract: OpenAI route resolution assigns Codex runtime eligibility, making its transport contract relevant. Personally inspected the sibling source: WireApi supports Responses, and provider construction distinguishes ChatGPT and Platform endpoints. GitHub verified the sibling commit identity. (codex-rs/model-provider-info/src/lib.rs:104, a956835d0207)

Likely related people:

  • Peter Steinberger: Raw commit 89c01cd adds extensions/openai/provider-policy-api.ts:234 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 89c01cd979ef; files: extensions/openai/provider-policy-api.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal maintenance with no intended user-visible behavior change.
  • 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 need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-09T18:46:30.716Z sha d3a23be :: needs maintainer review before merge. :: none

Reviewed October 9, 2026, 3:18 PM ET / 19:18 UTC (Revision 2).

@steipete

steipete commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Pinned landing evidence for reviewed head 22ca73d7fa9ddbd5444dc5741a506454b4709a50.

The exhaustive gh api --paginate repos/openclaw/openclaw/commits/22ca73d7fa9ddbd5444dc5741a506454b4709a50/check-runs census contains 148 terminal check runs: 92 successful, 51 configured skips, 1 informational neutral, and the 4 failures below. There are no pending, running, cancelled, or timed-out check runs. The aggregate gate accepts the unselected lanes and reports only the failed UI E2E lane.

Failing check Exact failure Independent main reproduction
UI E2E 1/9 — 113983006696 chat-session-prefetch-gating.e2e.test.ts:73: “keeps queued warm-ups off the socket while the presented transcript reloads”; background chat.history count 0, expected 1. Other 354 tests pass. Main job 113970386817: same test and assertion.
UI E2E 7/9 — 113983006718 chat-flow.history-recovery.e2e.test.ts:348: “shows persisted user messages after opening History and scrolling mixed history”; timeout waiting for session B chat.history. Other 394 tests pass. Main job 113970386917: same test and timeout.
UI E2E 8/9 — 113983006772 session-prefetch.e2e.test.ts:51: “opens prefetched history immediately after an unrelated roster refresh”; background chat.history count 0, expected 1. Other 348 tests pass. Main job 113970386856: same test and assertion.
CI aggregate — 113988528487 checks-ui-e2e finished with failure (selected=true); downstream of the three failures above. Same inherited UI lane failures; no separate source defect.

Independent main run 37974737910 used 9ef071e98e2f53e18deddfdb629d76f84eca19df. The prefetch owner and all three failing tests remain byte-identical on freshly fetched main 73b9d2fe2018ca3f6747aab22051f51eb024a4ce. Main change b0fb3ac3321 (#167906) intentionally requires pointer or keyboard intent before warming unopened sessions, while these three tests still wait for automatic prefetch. Their mocked-Gateway failure paths do not execute this bundle's provider, Discord, or Workboard actions. The PR changes none of the UI prefetch owner, test files, or harness.

The owned OpenGrep findings were corrected by restoring two explicit Discord groupPolicy fields. Current-head OpenGrep job 113982005665 passes. No scanning rule, ignore, test, timeout, retry, or suppression was weakened. All four zero-step cancelled automation jobs on the initial head were rerun serially to success; the current head has no cancelled checks.

The trusted Security Review publisher completed successfully for this exact PR/head. openclaw/dependency-review and openclaw/security-sensitive-review are successful; the remaining failed openclaw/ci-gate commit status mirrors the inherited CI result above.

Local changed checks, types, focused tests, lint, cycles, sequential Knip, and SDK API comparison are complete. Full-diff and repair reviews have no actionable P0–P2 findings. Merge-tree verification against the recorded current main is conflict-free. Landing will use a squash pinned to the reviewed head under the inherited-main-failure exception.

@steipete
steipete merged commit bd1a35b into main Oct 9, 2026
146 of 151 checks passed
@steipete
steipete deleted the deslop/bundle6-providers-discord-20261009 branch October 9, 2026 19:39
steipete added a commit that referenced this pull request Oct 9, 2026
Refresh the immutable JS and CSS generation pointers after the browser refactor in #167917. Generated on Linux with pnpm plugins:assets:build and the frozen dependency lockfile.
steipete added a commit that referenced this pull request Oct 9, 2026
Pin the consolidated declarations from #167917. All 170 exported symbols, source modules, and type-only classifications are preserved; only the declaration count shrank from 27 to 25.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 10, 2026
* refactor: deslop provider and Discord leftovers

* fix(discord): retain explicit component group policy
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 10, 2026
Refresh the immutable JS and CSS generation pointers after the browser refactor in openclaw#167917. Generated on Linux with pnpm plugins:assets:build and the frozen dependency lockfile.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 10, 2026
Pin the consolidated declarations from openclaw#167917. All 170 exported symbols, source modules, and type-only classifications are preserved; only the declaration count shrank from 27 to 25.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui channel: discord Channel integration: discord extensions: openai extensions: policy P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: workboard rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL 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