Skip to content

refactor: keep private media preparation in its owners - #178002

Merged
steipete merged 2 commits into
mainfrom
deslop/z25-52-private-media-owners-20261015
Oct 20, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/z25-52-private-media-owners-20261015

Conversation

@steipete

@steipete steipete commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Private one-consumer modules and argument packets separate internal operations from the callers that already own their context. Direct helper tests also retain otherwise unnecessary production exports.

What Changed

Fold video capability overlays, status assembly, TTS readiness/configuration, media reader/playback/store/parsing/probe handoffs and PTY invocation preparation into their existing owners. Keep provider-specific request, voice discovery, workflow and decode packets in their actual operations. Fold the internal terminal display leaf into its sole renderer, retain public SDK APIs while simplifying their private request preparation, and keep worker dispatch and Markdown HTML annotation in their existing callers. Public-boundary tests replace the retired overlay/formatter entry points.

Strict production delta: +1,635 / -2,140 = 505 net lines removed. Tests, fixtures, test-support, generated files and declarations excluded. The source/test packet spans32 paths; the QA scenario also drops its obsolete reference to the folded overlay module, with the runtime owner already retained. Exactly two obsolete assertion-baseline rows are deleted.

User Impact

No intended capability, configuration, CLI/protocol, public SDK/package, dependency, persisted-format or schema change. Preserve all security and live-authority checks, byte/resource limits, exact prompt/wire bytes, source precedence, lazy imports, ordinary concurrency, cancellation, filesystem integrity, durability, cleanup and write-capable settlement. Standalone Phase E session memory and its factory/registry/expiry/federation machinery and tests are untouched.

Best-effort tradeoffs accepted

  • No speculative-race, security, durability, concurrency or settlement guard is removed. The retired surfaces are private forwarding, not user capabilities.
  • Internal helper signatures are not public contracts. Overlay and home-formatting tests enter existing public owners without replacement production test seams; native Windows coverage stays platform-specific.
  • Inlined asynchronous operations keep the original value snapshots and disposal scopes. Full Deepgram recordings remain file-backed, playback cache readers close before the next authority check, worker transfer preparation remains outside transfer timing, and Google speech prompt bytes remain unchanged.

Evidence

  • Complete affected production owners and changed public-boundary tests personally inspected; census/provenance and current activation dependencies qualified. Foundation fallback capability, real lazy boundaries, shared helpers, public package entries and Phase E remain KEEP.
  • Author simplification pass and canonical formatting/whitespace checks pass. Independent full-packet P0-P2 review completed. Its two unused-symbol findings were rejected after checking the actual surviving references: Comfy's dispatcher aliases still type the shared readJsonResponse request, and DeepInfra's GeneratedVideoAsset still types parseVideoDataUrl. Deleting them would break retained code.
  • Targeted native core/extension imported graphs and syntax lint pass. All serial focused owner groups pass except the speech-provider group: one observed CLI-TTS malformed-audio case expected unknown format but received the existing 1000ms subprocess timeout. Its exact-case replay passes without edits (343ms case,17.49s Vitest/23.95s wrapper). The original timeout remains unexplained; this is not a proven repair, green initial run or inherited-CI claim. Assertions, timeouts, retries and source skips are unchanged.
  • Core typed lint36.42s, extension typed lint66.39s, extension boundary guards, line caps, mock exports, suppression14, wrapper/import closure4, runtime cycles0 and Madge cycles0 pass. The assertion ratchet correctly requested deleting two now-obsolete rows after their assertions disappeared; exactly those rows are removed. Canonical formatting corrected one folded CLI-TTS file without a behavior change. Final confirmation passes: assertion ratchet (37.78s), suppression audit (14 tests; 31.18s wrapper), and formatting of all28 retained TypeScript paths.

Broad proof is hosted CI on the exact pushed head. Local commands use isolated HOME/OpenClaw/XDG state, nice10, focused one-worker Vitest and targeted native type graphs. No local broad suites, whole-graph typecheck, build, E2E, vendor/device or operator-state proof is claimed. The real-decoder long-recording test is retained but not claimed as locally executed.

Review follow-up: the initial e7c6fca head completed hosted CI successfully, but review correctly identified the stale QA codeRef. Its one-line removal retains the scenario's objectives, success criteria, execution and existing runtime reference. The actual catalog reference test passes (1 case, 1.31s test / 10.39s wrapper; the other cases were selected out, not newly skipped). The repaired head requires its own CI; initial-head green is not claimed as repaired-head proof.

@clawsweeper

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T03:48:43.393421Z e7c6fca 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e7c6fca690

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -1,157 +0,0 @@
import type { OpenClawConfig } from "../config/types.openclaw.js";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove the deleted overlay from QA codeRefs

Deleting this module without updating qa/scenarios/media/video-generation-invocation.yaml:26 leaves that scenario pointing at a nonexistent file. extensions/qa-lab/src/scenario-catalog.test.ts:24-36 resolves every codeRefs entry and asserts that it exists, so the QA Lab catalog test now deterministically fails; replace or remove the stale reference as part of the cutover.

AGENTS.md reference: AGENTS.md:L46-L51

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 20, 2026
@steipete
steipete merged commit 329a56d into main Oct 20, 2026
160 of 162 checks passed
@steipete
steipete deleted the deslop/z25-52-private-media-owners-20261015 branch October 20, 2026 04:13
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
* refactor: keep private media preparation in its owners

* test(qa): remove folded video overlay reference
steipete added a commit that referenced this pull request Oct 20, 2026
Keep provider option tags and PCM byte accounting local after #178002 and #178011 removed their external consumers. Keep the V1 TypeSafe evaluator local after #158565 moved registration to V2; exercise its retained cancellation and sanitized-error contract through the existing V2 fixture adapter.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
Keep provider option tags and PCM byte accounting local after openclaw#178002 and openclaw#178011 removed their external consumers. Keep the V1 TypeSafe evaluator local after openclaw#158565 moved registration to V2; exercise its retained cancellation and sanitized-error contract through the existing V2 fixture adapter.
NEXTAltair added a commit to NEXTAltair/openclaw that referenced this pull request Nov 10, 2026
目的:
プラグインがプロバイダーに合わせた発話ガイダンスを組めるよう、
現在有効な一次 TTS プロバイダー・モデル・ペルソナを合成せずに取得する。

変更:
api.runtime.tts.prepareSpeechPromptContext を追加する。通常の TTS と同じ
ユーザー設定、agent / channel / account 層、ペルソナ binding、
モデル解決を使い、auto オフ・テキスト上書き不許可・一次 binding 不可は
ready: false を返す。合成、fallback、credential、音声ファイル、
テキスト書き換えは行わず、プロバイダー設定や秘密情報も返さない。
runtime facade は選択中 registry とプラグインの寿命に束縛する。

検証:
tts-prompt-context と registry.runtime-config のテストが通過。

rebase 時のコンフリクト解決 (onto 57fd13e, 元コミット 89d6eb7578c):
- 上流 329a56d (openclaw#178002) が resolveReadySpeechProvider を単一呼び出しとして
  フォールバックループ内のクロージャへ畳み込んだ。本コミットで
  tts-prompt-context.ts が2つ目の呼び出し元になるため、export した関数として
  1か所に戻し、ループ側のクロージャはその呼び出しに置き換えた。
  畳み込みで外れていた VoiceModelRef の import も戻した
- 上流 b3d00c9 (openclaw#183424) が types-core.ts の TTS 型エイリアスを
  TtsRuntimeApi[...] の直接参照へ畳んだ。エイリアスは復活させず、
  prepareSpeechPromptContext も同じ直接参照の形で追加

rebase 時のコンフリクト解決 (onto 258d034, 元コミット 892cff4dd4d):
- 上流 00ebec0 (openclaw#188280) が getResolvedSpeechProviderConfigForVoiceModel の
  引数を providerId から provider (SpeechProviderPlugin) へ変えた。export 済みの
  resolveReadySpeechProvider をその形へ合わせ、ループ側は本コミットの呼び出しを採用
- 上流 e1f1a79 (openclaw#188398) が prepareTtsRequest を runtime-api.ts から外し、
  loadTtsRequestRuntime の読み込み先を tts-request.js へ変えて、knip の
  動的 consumer 追跡に lazy TTS メソッドを登録した。そのままでは
  prepareSpeechPromptContext が tts-request.js に無く実行時に解決できないため、
  同じ方式で tts-prompt-context.js 専用の lazy loader / binder を足し、
  型も typeof import(tts-prompt-context.js) の直接参照にし、
  knip-dynamic-consumers.mjs に consumer を登録した。runtime-api.ts からの
  再 export は上流の方針どおり置かず、test-support は直接 import する
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant