Repository navigation
refactor: remove channel docking and manual session focus - #133153
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 12:37 PM ET / 16:37 UTC. ClawSweeper reviewWhat this changesThe PR removes manual channel docking and session-focus commands, retaining thread-bound session routing with an explicit Merge readinessKeep open for maintainer confirmation: the refactor is coherent, but it intentionally removes established docking and focus commands and needs an explicit compatibility decision plus Telegram command-surface proof before merge. Priority: P2 Review scores
Verification
How this fits togetherChannel messages enter command dispatch and session routing, which resolve any thread-bound agent session before delivery. This change removes commands that manually changed that routing and retains unbinding as the user-controlled exit. flowchart LR
A[Channel message] --> B[Command dispatch]
B --> C[Session routing]
C --> D[Thread-bound session]
D --> E[Agent response]
B --> F[Session unbind]
F --> C
Decision needed
Why: This is an intentional public-command compatibility decision, not a defect that code review can settle. Before merge
Agent review detailsSecurityNone. PR surfaceSource -1010, Tests -980, Docs -185, Generated 0, Other +121. Total -2054 across 72 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Obtain explicit approval for immediate command retirement and capture Telegram Test Server evidence that the new native command surface exposes the supported replacement. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR intentionally retires command workflows rather than reporting an existing defect. Is this the best way to solve the issue? Unclear: the implementation is internally coherent, but whether immediate removal is the best product path depends on maintainer acceptance of the compatibility break. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3b609ec6857c. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What 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 (1 earlier review cycle)
|
|
Landing review for head The maintainer explicitly approved immediate removal of Four independent source-review lanes, the integration audit, fresh structured Codex review, the orphan-fixture deletion review, and the workshop fixture-clock review found no actionable introduced P0–P2 findings. The latest ClawSweeper review was read at the final head: it reports no actionable code findings and accepts the Matrix behavior proof. Its compatibility decision is explicitly approved by the maintainer. Its Telegram-specific rank-up is not claimed complete: the missing Convex prerequisite and resulting surface-specific proof gap are documented below; Telegram adapter logic is unchanged, while the shared command path has direct Matrix proof. No SQLite schema or stored-ID migration occurs; generated metadata differs only in four help strings. Focused commands after the main refresh: pnpm test src/auto-reply/reply/commands-handlers.registration.test.ts src/auto-reply/reply/commands-session-lifecycle.test.ts src/auto-reply/reply/dispatch-acp-command-bypass.test.ts src/agents/subagents/spawn/acp-spawn.test.ts
pnpm config:channels:check
pnpm openclaw qa matrix --provider-mode mock-openai --scenario subagent-thread-spawn --output-dir .artifacts/qa-e2e/remove-dock-focus-merged-20260830
node --import ./scripts/tsx.mjs scripts/check-deadcode-unused-files.mts
node scripts/run-vitest.mjs src/skills/workshop/service.test.ts
node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.services.jsonResults: 134 targeted tests passed; generated metadata matches source; both unused-file scans have zero entries. The real disposable Matrix server plus isolated Gateway passed bind → bound follow-up → unbind acknowledgment → ordinary follow-up routing, preserving the child session and emitting exactly one reply in the same thread. The model was mocked. Verdict: Hosted CI run 33322547038, attempt 1, completed success for this exact head. The rollup is GREEN, with zero pending checks. Earlier dependency, timestamp-tie, and cleanup-hook type failures were repaired and revalidated; no gate was bypassed. Known proof limitation: Telegram Test Server credentials could not be leased because this environment has neither the Convex CLI nor broker settings. No credential installation, login, or unrelated credential fallback was attempted. Matrix covers the changed shared command path; this is not a claim of Telegram-specific transport verification. The pre-existing cross-channel binding-ID collision remains a separate documented ownership follow-up, not an introduced or silently fixed behavior. |
|
Merged via squash.
|
…33153) * refactor: remove channel docking and manual session focus * refactor: simplify conversation binding and command ownership * test: remove orphaned focus fixture * test: make proposal transition ordering deterministic * test: return void from fixture cleanup
What Problem This Solves
Removes channel docking (
/dock-*and/dock_*) and manual conversation attachment (/focus) from chat commands. These controls could redirect a session's saved reply route or attach an existing session to another conversation, adding an overlapping routing workflow that the maintainer explicitly requested retiring immediately, without aliases.Related: #127600 (the removed focus resolver discarded the authoritative session owner).
Why This Change Was Made
Deletes the docking and focus handlers, arbitrary session-target resolver, generated docking command/category plumbing, obsolete tests, and dead dispatch wrappers. The follow-up architecture review also collapses the built-in command builder into one factory, declares aliases beside their commands, removes a redundant native-command registry cache, and removes obsolete ACP command-list indirection.
Conversation resolution now returns its canonical fields directly. The unused source/placement hints, wrapper module, and duplicate plugin-registry scan are gone; real callers use the canonical loaded-plugin lookup. Session lifecycle updates consume the flat callback result their channel contracts already return instead of converting an impossible alternate record shape.
Consolidates the remaining non-destructive detach operation into
/session unbind, beside/session idleand/session max-age, and removes/unfocus. It preserves the existing binding-owner check and leaves the agent session intact. Generic bindings need not implement timeout controls to support detaching. Registered session commands still bypass ACP prompt dispatch.User Impact
/dock-*,/dock_*,/focus, and/unfocusare intentionally removed, with no compatibility aliases. Native command menus, help, config descriptions, and documentation stop advertising them./session unbindto detach a bound conversation without ending its session.sessions_spawn, and ACP--bind/--threadworkflows remain supported. Their binding/delivery infrastructure is independent of manual attachment.Evidence
Net diff: −2,054 lines across 72 files: production +174/−1,154 (−980), tests/scenarios +350/−1,239 (−889), docs +35/−220 (−185), generated metadata +16/−16 (0). The second pass removes another 259 production lines, including a complete unused wrapper module, while extending the existing Matrix scenario.
OPENCLAW_BUILD_PRIVATE_QA=1 pnpm buildpassed, including plugin bundles and Control UI assets.node scripts/check-changed.mjspassed before the main refresh: all core/UI/plugin/script/root-test typechecks, lint, dead-export scans, generated metadata, architecture guards, five doctor-contract tests, and zero runtime import cycles.pnpm openclaw qa matrix --provider-mode mock-openai --scenario subagent-thread-spawn --output-dir .artifacts/qa-e2e/remove-dock-focus-merged-20260830passed (1 scenario, 0 failures). A disposable real Matrix homeserver and isolated Gateway proved bound follow-up history, same-thread unbind acknowledgment, a new ordinary session for the next message, an intact child session, and exactly one same-thread reply. The model provider was mocked; no external user channel was used. Sanitized verdict:{"verdict":"PASS","boundAndUnboundSessionsDiffer":true,"childSessionPreserved":true,"detachedFollowupReplies":1}. The added flow lives inqa/scenarios/channels/subagent-thread-spawn.yaml.The first ready-for-review CI run found one orphaned 30-line test fixture whose only caller was the removed focus test. The fixture was deleted; production and full-tree unused-file scans now report zero entries, and a fresh review of the deletion passed. No runtime behavior changed in that CI repair.
A later CI shard exposed an existing skill-workshop test timing flaw: reject/quarantine could share a millisecond, so the production ID tie-break disagreed with the test’s assumed operation order. A forced tie reproduced the exact failure. The test now supplies distinct Date-only fixture times and restores the clock on completion, preserving every original assertion. All 49 tests in that file and the focused review pass; production behavior is unchanged (+8 test lines). A subsequent typecheck caught the cleanup hook returning VitestUtils; the hook now returns void, and the owning services test typecheck plus all 49 tests pass.
After GitHub reported a conflict, main at
279a12cf8b8was merged into the draft without rewriting commits. The resolution keeps main’s direct command-handler list minus dock, accepts deletion of the obsolete ordering module, and regenerates metadata. All 134 targeted dispatch/lifecycle/ACP tests passed after the refresh;pnpm config:channels:checkpassed. A structural comparison confirmed that generated metadata differs from main only in four retired-command help strings. An independent integration audit confirmed all remaining handler precedence and lazy loading are unchanged. The Matrix result above is from the refreshed candidate.Follow-up found during deep review: cross-channel binding-ID collisions
The shared binding service broadcasts ID-only
unbind/touchoperations to adapters, while some adapters construct IDs asaccountId:conversationId. A local reproduction using the real service and two synthetic channel adapters with the samedefault:room-1ID removed both bindings when requesting one; result deduplication hid the second removal. The old/unfocuspath used the same service call, so this is pre-existing, not introduced by the command move. Seesrc/infra/outbound/session-binding-service.tsandsrc/infra/outbound/account-scoped-conversation-bindings.ts.A separate repair should scope binding mutation to its owning channel/account and audit the public/persisted identity contract. This PR does not redesign that contract or silently migrate stored IDs. The Matrix proof covers ordinary single-channel detach; it does not establish collision isolation across adapters.
Maintainer explicitly requested landing after the removal and deep-review passes. Immediate command retirement without aliases is approved.
Telegram-specific proof is unavailable in this environment: no authenticated Convex CLI is installed on PATH, and neither Convex broker setting is present. No Telegram credentials were leased or live user channels touched. The disposable Matrix transport proof above exercises the changed shared binding-command path; Telegram-specific transport behavior remains a proof limitation.