Repository navigation
refactor(skills-tui): deslop skills, TUI, and onboarding - #157765
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: blocked before merge. Reviewed September 25, 2026, 3:43 AM ET / 07:43 UTC (Revision 9). ClawSweeper reviewWhat this changesThe branch consolidates skill installation, discovery and security helpers, terminal chat handling, and onboarding logic, while removing redundant wrappers and adding a migration snapshot test. Merge readiness⛔ Blocked before merge - 4 items remain Current main still uses the older skill tracking and publication paths, so this PR remains useful. I found no definite introduced defect. The remaining merge concern is whether a published updater preserves skills and generated links in an existing installation. Priority: P3 Review scores
Verification
How this fits togetherSkill sources and existing tracking state feed installation and discovery before skills reach agent sessions. Onboarding writes Gateway configuration, while the terminal UI sends chat through a Gateway or local backend. flowchart LR
A[Skill sources and stored state] --> B[Skill installation and tracking]
B --> C[Skill discovery]
C --> D[Agent sessions]
E[Setup choices] --> F[Onboarding wizard]
F --> G[Gateway configuration]
G --> D
H[Terminal chat] --> D
Before merge
Agent review detailsSecurityNone. PR surfaceSource -1139, Tests -9, Other -4. Total -1152 across 65 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the simplified owners once an upgrade from a published installation preserves existing skill tracking and plugin-link discoverability. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving refactor and the PR claims no separate product bug. Is this the best way to solve the issue? Unclear pending upgrade proof: the consolidation follows existing owners and no definite regression was found, but fresh-state checks do not establish the existing-installation outcome. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 932abb0a841b. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
1f316ed to
0b17dc3
Compare
dde68b4 to
b60523a
Compare
Share repeated installation, discovery, environment, TUI, and wizard flows at their existing owners while preserving their behavior contracts. Remove unused forwarding layers and derive types from their owners. Validated on Linux Blacksmith Testbox: scoped changed-check continuation, 4,839 subsystem/importer tests, 109 real PTY tests, full build, and isolated classic onboarding plus skill install/list/info/check. The inherited workspace.test.ts line-cap failure is owned by PR #157750. No intended user-visible change.
b60523a to
210a104
Compare
|
Merged via squash.
|
…7765) Share repeated installation, discovery, environment, TUI, and wizard flows at their existing owners while preserving their behavior contracts. Remove unused forwarding layers and derive types from their owners. Validated on Linux Blacksmith Testbox: scoped changed-check continuation, 4,839 subsystem/importer tests, 109 real PTY tests, full build, and isolated classic onboarding plus skill install/list/info/check. The inherited workspace.test.ts line-cap failure is owned by PR openclaw#157750. No intended user-visible change.
What Problem This Solves
This is the maintainer-requested l40 cleanup deliverable. Skills, the terminal UI, and onboarding had repeated validation, result projection, and lifecycle plumbing that made their existing contracts harder to follow.
User Impact
No intended user-visible change. Skill discovery, precedence, eligibility, complete instruction text, prompt ordering/bounds, install and Workshop behavior, TUI rendering/keybindings/protocol use, and onboarding prompts/defaults/config/exit behavior stay the same. No schema, configuration, protocol, or dependency changes.
Why This Change Was Made
This subsystem sweep read all production modules, starting with the largest files, and followed their callers across core, plugins, packages, tooling, apps, and UI. It removes 1,139 net production lines (772 added / 1,911 removed), with each simplification staying at its existing owner:
Fixes found along the way
No separate product bug or flaky-test fix is claimed. The new migration test protects the source-referent versus target-link snapshot boundary during the refactor. Removed helper-only TUI tests retain stronger coverage at the real PTY signal entry point, shutdown owner, chat-log coalescer, and command admission boundary.
Evidence
Current head
210a1043f93537002123047561a7868308fb0944targets main505652e88d7421fd757cee71950511f0a203ea48; treef1cb6bb8d5266dc77fc4962f1cb030d6d410c1fa. This rebase includes the merged hosted-tail assertion fix449fc2e6c5700ead4e9ac5eaa59a2850e210c8aeand is patch-identical to the approved mechanical resolution31a9013384f. The production-filtered patch is byte-for-byte identical: 59 files, +772 / -1,911, 1,139 net lines removed, SHA-256bf8d5eb78efaf9443ff2f72191d45a81cb01406854cb8ecb77dc36564625f238. Overall: 65 files, +811 / -1,963. Exact-head CI run 36108256808 passed: 177 jobs terminal, zero failures. Native review and preparation are complete on this unchanged head.Fresh focused proof on this exact head used Blacksmith Testbox
tbx_01m3bpzxd5xx3cmxsj4jq75fs7, run 36107147510: 14 TUI/Gateway/importer files, 525 tests passed (101.99s wrapper wall), followed by a passing coretsgocheck. The wrapper verified the source SHA/tree; affected source bytes matched before and after. The command completed in 4m25.496s, and the lease is stopped. Commands:node scripts/run-vitest.mjsfor all gateway-chat tests plus the picker, TUI, Gateway wire/upload, CLI resume and system-agent backend consumers;node scripts/run-tsgo.mjs -p tsconfig.core.json.Blacksmith Testbox
tbx_01m3bcgt89sff52qe8m1bzjx2r, run 36093856823, validated sourced861cdcc/ tree2a65dbd309fd4c2010857e4f6581c9427ac7ea98. The wrapper verified source identity and selected file bytes were checked before and after execution. All phases passed; the lease is stopped.node scripts/check-changed.mjs --base 82e95b6512b0d58e413903989c864836885428f8: passed, 1,962s. Core types, all 25 test-type graphs, all three dead-export scans, complete core/script lint, formatting, ratchets, import-cycle and remaining boundary checks passed.node scripts/run-vitest.mjsover all skills/TUI/wizard tests plus changed-export importers: 218 files, 4,934 tests passed; one existing skip; 386s. Coverage spans Gateway, embedded agents, CLI/commands, plugin contracts, security, Claw and file-transfer consumers, including current-main watcher and command-authority tests.node scripts/run-vitest.mjs run --config test/vitest/vitest.tui-pty.config.ts: 9 files, 109 tests passed; one existing skip; 151s, including actual SIGTERM handling and foreground auth-child exit.pnpm build: passed, 498s. It printed existing UI bundle-budget advisories; no UI budget or baseline was changed here.pnpm openclaw onboard --classic --flow quickstart --auth-choice skipran under a PTY with isolated HOME/state/config/workspace, answered telemetry and first-agent prompts, and exited zero. Loopback/token/tailscale-off defaults, selected workspace and port were preserved. Real skill install/list/info/check passed and installed SKILL.md bytes matched the complete synthetic source. 19s; isolated state removed. No daemon or provider inference was started.server.config-patch.test.tsfile, original order and two-worker setting: 81/81 passed, 118.56s Vitest / 166s phase including setup. The temporary bounded, redacted logger was removed and the clean-main worktree was deleted. This is non-reproduction evidence, not a claimed fix for the earlier unexplained reload failure.Changed-test single-worker costs (
pnpm test <file> --maxWorkers=1):tui.test.ts15.96s / 87 tests,tui-session-actions.test.ts17.58s / 103 tests, andsetup.migration-import.test.ts19.97s / 11 tests. These include startup/worker preparation; no speedup claim. Hosted per-file durations were unavailable from recovered complete Node logs, so job times and case sums are not substituted.All 109 production files over 200 lines were read and individually recorded, plus smaller modules. Changed-export tracing covered 293 names across src, extensions, packages, test, scripts, ui and apps; no references remain to the removed TUI wrappers.
Main's fs-safe, cold-session read, command-authority and watcher-recovery changes are preserved. The only final conflict resolution consolidated ordinary watcher fanout while retaining main's per-callback retirement guard and observation-root error argument. Retirement notifications remain at their owner. Fresh managed Codex review of this exact file returned scoped-clean through P2. Earlier full-patch review dispositions are below; no accepted/actionable finding remains. The final rebase is patch-identical and required no new resolution.
Independent review disposition
AutoReview completed at P2. Its regression candidates were checked against the complete owner source; none was accepted:
src/skills/runtime/env-overrides.ts, acquisition and release).runBtwTurnbranch emitschat.side_result, terminalizes, and returns before normal completion (src/tui/embedded-backend.ts)."invalid-request" | "unavailable"; the deleted mapping was the identity function (src/skills/lifecycle/workspace-types.ts).src/tui/components/searchable-select-list.ts).{ key: string; agentId: string }on every path and canonicalizes empty input (src/tui/tui.ts).getAgentWorkspaceAccess(workspace, "loadSkills")itself returns undefined when that capability is absent (src/agents/workspace-access.ts).src/skills/discovery/status.ts).src/tui/tui-command-handlers.ts).The fresh rebase review added two candidates, both rejected against the complete function bodies:
hasTrackedAbortTarget()is exactlyBoolean(state.activeChatRunId || hasPendingSubmit(state)), identical to the removed localbusyexpression. Keeping both checked the same state twice without an await.if (isBtw)branch handles its separate tracker and returns before the normal ACK block. Terminal BTW acknowledgements also return earlier.The automated overall verdict reported findings; this is an explicit source-backed rejection, not a claim that the service returned a clean verdict.
CI failures investigated
Earlier CI failures in import cycles, native-worker admission, test-helper placement, schema-fixture index ordering, bundle planning, extracted PR-wrapper inventory and line caps are repaired by existing main commits
818b0092d2e,cb3e6df6567,af545bf3b6a, and573babfd75d. The earlier update/restart filesystem fixture failure was repaired by691d2e5cd48. No suppression or duplicate repair is added here.The last pre-refresh CI run 36093855708 failed two substantive jobs. Both fixes are now incorporated:
63d299c31b0routes the unchanged proof to the existing isolated infra-fork owner and protects that assignment with a routing regression.a759f770a9dreplaces the forwarding import with canonical typed Kysely queries and preserves the existing actual-bundle regression. The duplicate repair PR was closed after that direct-main fix landed.The PR metadata check briefly failed after the validation section was renamed; restoring the template's Evidence heading passed. Source CI failures were not retried away.
An earlier numeric-key config.patch failure did not reproduce in the clean-main 81-test replay. Main includes
71cc18ae186, restoring retry after an uncommitted plugin-secret rollback, but no captured evidence attributes that historical failure to this cause. The uncertainty remains explicit.Separate focused repair #157809 removes the redundant diagnostic npm-version process for normal toolchain installs while preserving real packing and existing fallback behavior. Its baseline regression failed for the intended reason, 21 full tarball-file iterations and three Linux shard replays passed, changed checks/build/review passed, and exact-head native Windows CI passed all 101 tarball cases. That PR merged as
c1051da16eff2f3aee394b4490969d4540b0135e, and ancestry on fresh main was verified.Resolved queued-collector CI failure
The previous exact-head run failed the real queued-collector preaccept cancellation test: cancellation completed, but failed-launch cleanup could delete its provisional session before publication, producing a misleading session-generation error. The owning repair landed directly on main as
d65bc76d60daaa16078748bd2f2a9c090564d2ee; its draft PR #157927 was then closed. This rebase includes that fix.The repair retains an exact-entry publication barrier in the existing retirement owner. Failed-launch cleanup waits for publication to finish, including failure, before the scheduler hold can await cleanup. Existing generation, session, successor, FIFO and current-authority checks remain intact. The existing regression now forces the original ordering failure without extra timers or test cases. No duplicate repair or weakened check is added by this deslop PR.
Clean-base attribution of the latest CI failure
Job
107967649864(checks-node-compact-small-43) failedtest/scripts/ci-node-test-plan-hosted-tail.test.ts:24: 71 total planned rows were compared with the 70-row Node limit. The job executed GitHub merge416445a3b883e9182174280b135fbff85de8fbe5, whose parents were main823f86c8a4650b632667136043721e75eb2fe428and PR headb60523a3a213608200f6bbfaad4424fe69c23aed.Clean checkouts of both the exact main parent and the CI merge were tested serially on Blacksmith Testbox
tbx_01m3bmfe8zfg05g6hmgy1nvct7, run 36103636118, using frozen dependencies, Node 24.19.0 and pnpm 12.4.2. Command:OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs test/scripts/ci-node-test-plan-hosted-tail.test.ts --reporter=verbose. Neither checkout was modified.823f86c8a465416445a3b883This establishes an inherited assertion failure. Dist rows are outside the 70-row Node budget and inside the 90-row compact budget (
docs/ci/capacity.md). Main now contains449fc2e6c5700ead4e9ac5eaa59a2850e210c8ae, which checks those two limits separately; #157981 was closed as superseded by that fix. No cap, assertion, or planner source was changed in this lane.Separately, main advanced with the nonblocking TUI model-picker change. Its conflict with this PR was resolved mechanically in the local continuation: all 58 other production-file deltas remained identical, and
gateway-chat.tsretains the new catalog behavior while using the already-approved canonical TUI types. That continuation has 59 production files, +772 / -1,911 (the same 1,139 net reduction; one additional type-alias replacement). Fourteen focused TUI/Gateway/importer files passed all 525 tests, and the core typecheck passed on the same lease. Both temporary A/B checkouts were removed and the lease was stopped. Landing subsequently resumed after the merged owner fix was verified; the approved mechanical resolution was rebased without further conflicts, rerun remotely, and published as the current head above.