Skip to content

refactor(transcription): separate provider host contexts - #193390

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/realtime-transcription-provider-contexts
Nov 5, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/realtime-transcription-provider-contexts

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Problem

The ordinary realtime transcription protocol/session types also owned configuration-bearing provider contexts, pulling host configuration into data-only consumers.

Change

Move the three complete host contexts into the adjacent private provider-contexts.ts owner. Keep four ordinary declarations in import-free provider-types.ts, and migrate the descriptor, existing SDK type routes and relay type import together. No forwarding shim or new public name is introduced.

Runtime bodies, callback optionality, config/auth/registration, transport ordering and cleanup stay unchanged. The relay test keeps its 635-line body and assertions. Production grows by seven lines for the boundary; test/allocation growth is zero. No performance improvement is claimed.

Validation

Validated at 17dd517de8e6d6d8dce15fa5018fcc861dbd42fa:

  • 171 tests across 12 owning suites: registered descriptor/factory loading, shared WebSocket, Talk relay, OpenAI, ElevenLabs, xAI, Deepgram, Mistral and voice-call consumers.
  • Core/source-test/extension/extension-test types; scoped typed lint, format and whitespace; line, assertion, mock and test-budget ratchets; applicable SDK boundary checks.
  • Actual production and full-tree unused-file scans: zero entries.
  • Full build passed. Existing UI size advisories and dependency warnings remain recorded; no UI or budget changes are included.
  • Strict compile-only consumer of the actual emitted public core/plugin-entry declarations covers all four provider callbacks and descriptor/factory registration (strict: true, skipLibCheck: false). The three transcription SDK subpaths remain intentionally JS-only/private-local.
  • One canonical before/after SDK/API comparison: no entrypoint additions/removals or export signature/kind changes. It reports 167 reachable-closure changes across 27 entries. All three complete declaration pairs were inspected: module/type origins change while the public structures and member ordering remain compatible. This is not a zero-diff report.
  • Fresh independent review: zero findings, confidence 0.97, three complete assessment-specific contexts with the entire declaration-pair union common. Review was source-text only and does not attest execution.

The initial native initialization preflight failed before checkout/binding; a later ordinary read and one same-route initialization succeeded. Its original cause remains unknown. That setup attempt is preserved, not presented as a candidate defect or a passing first attempt.

Normal preparation retained the exact reviewed head and skipped an unnecessary push. Exact-head CI run 42019099924, attempt 1, completed successfully, including security-fast, the core type lanes, baseline ratchets and openclaw/ci-gate. Skipped jobs are not counted as passing execution. The actual hosted merge preserves the independent music, speech and Node capability changes and all 635 relay-test lines; its first-parent delta contains only these six paths. A bounded reference census at captured main de04fbe0caa9332999bdcc28d5d4e049672afb16 found no new or removed reference rows. This snapshot does not freeze future main movement.

Normal current security/review/authority and squash-landing checks remain enforced. No CI exception, live/paid provider or Gateway workload, or performance qualification is claimed.

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

clawsweeper Bot commented Nov 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 gateway Gateway runtime size: S labels Nov 5, 2026
@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 Nov 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR separates config-bearing transcription provider contexts from ordinary session types while preserving existing SDK exports.

Example: An official transcription plugin implements createSession with providerConfig.model set to "stt-model".

  • Before: Its request type shares a module with ordinary session contracts and the host configuration import.
  • After: The request type comes from the separate context owner; the plugin receives the same configuration and callbacks.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The source change is coherent and preserves structural contracts, but executed validation is not yet supplied.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored type-only refactor is outside the ordinary contributor proof gate; its body explicitly leaves build, SDK compatibility, and focused validation pending.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction separates host context from ordinary session contracts with a small, complete cutover and preserves existing behavior.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored draft open: the focused type extraction preserves existing contracts, and source review found no actionable defect.

Priority: P3
Reviewed head: 17dd517de8e6d6d8dce15fa5018fcc861dbd42fa

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The draft supplies no executed build, supported typed-consumer, or provider/session/relay validation for the extracted contracts.
Agent review details

How this fits together

Transcription provider descriptors connect host configuration and callbacks to plugin-created sessions, which consume audio and emit transcript events through existing transport and lifecycle owners.

flowchart LR
  Host[Host configuration] --> Contexts[Provider context types]
  Contracts[Session and callback types] --> Contexts
  Contexts --> Descriptor[Provider descriptor]
  Descriptor --> Plugin[Transcription plugin]
  Plugin --> Session[Session lifecycle and transport]
  Session --> Events[Transcript events]
Loading

Technical review

Best possible solution:

Retain the focused extraction and validate the unchanged supported descriptor contracts through the existing build and SDK checks.

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

No runtime bug is claimed; source inspection confirms the original session-contract module imports host configuration and the proposed extraction removes that dependency.

Is this the best way to solve the issue?

The diff is the smallest coherent extraction: one context owner, unchanged fields, complete caller migration, preserved exports, and no compatibility shim or added test machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Transcription provider configuration contexts keeps the original intent (a23ab9b: Move realtime providers into extensions while retaining provider-owned configuration and core session contracts; the extraction preserves those responsibilities.)
  • Configuration on session creation keeps the original intent (Add OAuth-backed realtime voice controls #79138: Supply host configuration for OAuth-backed realtime transcription without requiring a direct OpenAI API key.)
  • Lightweight SDK session facade keeps the original intent (fix(talk): avoid full plugin imports during cold catalog discovery #138483: Keep session construction available without importing the host provider registry during capability catalog discovery.)
  • Capability provider descriptor ownership keeps the original intent (refactor(plugins): split plugin type contracts #108416: Split the plugin contract into focused domain modules while preserving public names and signatures.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit ab1042d adds src/gateway/talk-transcription-relay.test.ts:25 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ab1042d11582; files: src/gateway/talk-transcription-relay.test.ts)

PR surface

Source +7, Tests 0. Total +7 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 32 25 +7
Tests 1 1 1 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 33 26 +7

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:

  • add P3: This is a type-ownership cleanup with no intended runtime or user-facing behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a type-ownership cleanup with no intended runtime or user-facing behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete the declared build, supported public SDK comparison, and strict emitted-consumer validation.
  • Run the existing provider, session, and relay suites on the reviewed head.

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.

Reviewed November 5, 2026, 5:23 AM ET / 10:23 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 5, 2026 11:27
@vincentkoc
vincentkoc merged commit 89ac549 into main Nov 5, 2026
233 checks passed
@vincentkoc
vincentkoc deleted the refactor/realtime-transcription-provider-contexts branch November 5, 2026 11:50
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

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

Labels

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. size: S 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