Skip to content

refactor: fold single-use internals into existing owners - #181608

Merged
steipete merged 2 commits into
mainfrom
deslop/z25-129-single-use-surface-20261015
Oct 23, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/z25-129-single-use-surface-20261015

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Several internal operations carry a separate module, callback bag, or private type name for a single consumer.

User Impact

No user-visible change is intended. Public SDK, CLI, config, protocol, persisted data, lazy imports, and standalone session-memory behavior remain unchanged.

Why This Change Was Made

Keep registration in the session-group catalog, annotation Undo in the pane action, archive discovery in confirmation, sidebar reconciliation in the zone builder, and Agents URL resolution in its route. Inline single-use private type annotations without changing their structural contracts. Move helper-only tests to those existing production entry points.

Net production reduction: 164 lines (416 added, 580 removed; 42 production paths). Tests grow by 58 lines across seven paths to exercise existing owner boundaries. The database-worker inventory is regenerated, not hand-edited: 2,323 call expressions remain; the registration donor is absorbed, and existing telemetry retirement/line-offset drift is reflected too.

Best-effort tradeoffs accepted

None. This removes internal framing, not guards: transaction/commit admission, current ownership, annotation limits and payload cleanup, archive ancestry and deepest-first settlement, personal pin authority, URL validation, and effect authorization remain intact.

Evidence

  • Targeted native typechecks, typed lint, formatting, and line caps pass for every selected packet.
  • Registration: 33 cases across three files pass; the migrated direct case also passed before the fold.
  • UI: 77 cases across eight files pass, including pane Undo, sidebar, route, and pre-fold public archive tests. Post-fold archive/consumer proof: 62 cases across three files pass.
  • ACP/package/CLI packet: 65 cases across seven files pass, including agent-tool prompt-prefix stability. Additional CLI contracts: 68 cases across eight files plus 19 selected metadata/status/compaction/restart cases pass.
  • Existing private UI contracts, Mattermost durable ingress, and strict/non-strict plugin cleanup focused packets pass. No tests are weakened; unrelated cases are filtered, not newly skipped.
  • Suppression suite: 14 pass. Assertion/mock ratchets, wrapper/eager-import closure, line caps, and Control UI controller guards pass; runtime and static cycles are both zero.
  • Local proof is serial, single-worker, low-priority, and state-isolated. Changed UI tests finish in the combined 7.66-second runner wall; archive post-fold proof takes 4.42 seconds. Existing registration suites take 64.18 seconds wall; no waits or timeouts were added. Hosted CI timings remain pending.
  • Fresh independent review is scoped-clean at P0–P2 for the signed initial slice and all five evidence partitions of the complete remaining candidate; no actionable findings remain.

PR CI is the broad proof. No local broad build, whole-graph typecheck, E2E, live-provider, or device verification is claimed. There are no JSX, style, copy, or visual changes.

@clawsweeper

clawsweeper Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review October 23, 2026 11:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 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-23T11:45:52.198516Z 1919c8d 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: mattermost Channel integration: mattermost app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling size: XL labels Oct 23, 2026

@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: 1919c8db88

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

import { t } from "../../i18n/index.ts";
import type { ChatAttachment } from "../../lib/chat/chat-types.ts";
import { removeBrowserAnnotationWithUndo } from "./browser-annotation-removal.ts";
import { showToast } from "../../lib/toast.ts";

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.

P2 Badge Regenerate the boot-module manifest after module folds

The fold deletes browser-annotation-removal.ts, but ui/config/control-ui-boot-modules.json still lists that module in the chat capture; the same stale inventory also retains the deleted sidebar-zone.ts and Agents route-location.ts. Release chunk assignment reads this generated file, so subsequent builds and chunking changes start from a boot graph containing unreachable modules. Please run pnpm ui:boot-manifest:gen followed by pnpm ui:build and commit the regenerated manifest.

AGENTS.md reference: ui/AGENTS.md:L76-L79

Useful? React with 👍 / 👎.

@steipete
steipete enabled auto-merge (squash) October 23, 2026 11:50
@steipete
steipete merged commit c268b9d into main Oct 23, 2026
233 of 242 checks passed
@steipete
steipete deleted the deslop/z25-129-single-use-surface-20261015 branch October 23, 2026 11:53
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 24, 2026
…1608)

* refactor: localize private single-use contracts

* refactor: fold internal details into their callers
NEXTAltair added a commit to NEXTAltair/openclaw that referenced this pull request Nov 10, 2026
rebase 時のコンフリクト解決 (onto 92635da, 元コミット 119f95fdaa6):
- 上流 openclaw#143905/openclaw#147242 で safe RPC restart 分岐に
  assertGatewayServiceFallbackAllowed("safe RPC restart") が追加された。
  本コミットは safe 分岐を external-supervisor 判定より前へ移し暗黙 safe 判定を
  足しているため、移動先の分岐に上流のガードを取り込み、旧位置の重複分岐は削除

rebase 時のコンフリクト解決 (onto 57fd13e, 元コミット 21f40bf994c):
- 上流 8b680f3 (openclaw#178163) が createSafeGatewayRestartPreflight の
  inspectors 引数と SafeRestartInspectors 型を削除。引数なしの形に合わせ、
  session admission / mutation を 0 に固定するスタブだけを外して実数で数える
- 上流 c268b9d (openclaw#181608) が SafeRestartTarget 型を引数へインライン化。
  インライン型のまま transport 引数を追加
- 上流がテストを describe なしのトップレベル it と、実モジュールの spy による
  カウンタ差し替えに書き直したため、両テストファイルは上流版を基に
  本コミットのケースを追加。restart-coordinator.test.ts は
  session-controller.lifecycle.js を spy して admitted turn を 1 件にする

rebase 時の調整 (onto 258d034, 元コミット 76c4af4b6cc):
- restart-suspension.test.ts: 上流 36e277d (openclaw#175837) が
  session-lifecycle-admission.js を session controller へ統合して削除し、
  上流 f27df1d (openclaw#165330) が scheduleGatewayRestart の skipCooldown を
  削除していた。どちらも前回のベース (57fd13e) より前の変更で、
  このファイルは読み込みに失敗し上流分を含む全テストが動いていなかった。
  後継の beginSessionEffect / getSessionControllerWorkCount
  (session-controller.lifecycle.js) へ置き換え、skipCooldown を外した。
  クールダウンは直前に再起動を発信した場合だけ掛かるため、外しても挙動は同じ

rebase 時のコンフリクト解決 (onto 638a185, 元コミット a06162363f5):
- 上流が lifecycle-safe-restart.ts に restartFlagConflictError / assertNativeRestartFlags
  を追加し、runDaemonRestart の冒頭で呼ぶ形にした (--preserve-definition と --safe、
  --skip-deferral の組み合わせ検査)。上流の2関数と呼び出しを残したまま
  shouldUseImplicitSafeRestart と requestSafeGatewayRestartIfNeeded の呼び出しを
  その直後に並べた (フラグ検査 → 暗黙 safe 判定 → external-supervisor の順)。
  旧位置の `if (opts.safe)` 分岐は本コミットが既に削除済みで、重複は残っていない。
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: mattermost Channel integration: mattermost cli CLI command changes commands Command implementations docker Docker and sandbox tooling docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant