Repository navigation
refactor: fold single-use internals into existing owners - #181608
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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"; |
There was a problem hiding this comment.
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 👍 / 👎.
|
Merged via squash auto-merge.
|
…1608) * refactor: localize private single-use contracts * refactor: fold internal details into their callers
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)` 分岐は本コミットが既に削除済みで、重複は残っていない。
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
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.