Skip to content

refactor(runtime): fold private status and channel owner surfaces - #177290

Merged
steipete merged 1 commit into
mainfrom
deslop/z25-37-status-owners-20261015
Oct 19, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/z25-37-status-owners-20261015

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Status commands and bundled channel runtimes forward caller-owned facts through private modules with one production consumer. Direct helper tests keep some of those surfaces exported.

User Impact

No intended user-visible change, migration or operator action. Status JSON/text, channel feedback, Browser results, Telegram delivery and ClickClack command menus keep their existing behavior. Public SDK/package exports, protocol, config and persisted shapes remain unchanged. Phase E is untouched.

Why This Change Was Made

Keep service summaries in their shared status runtime, JSON composition in the JSON command, Gateway warning selection in its command, token summaries in the channel account loop, and diagnosis rendering in status --all. Keep Browser actions in their dispatcher and Telegram processing in its existing inbound pipeline. Keep Discord acknowledgement and typing feedback in their runtime owners, action dispatch in its existing dispatcher, and ClickClack command-menu synchronization in Gateway startup.

Remove the single-consumer modules and argument packets. Retained private helpers stay local; no replacement production export, test seam, dependency or public contract is added. Existing leaf coverage moves through the actual commands, action dispatcher and Gateway startup fixture. The status-all fixture is shared only by tests, keeping both owner suites within their existing limits. Exact obsolete baseline rows only shrink.

Best-effort tradeoffs accepted

  • Discord typing always receives the existing feedback REST client from its sole caller. The optional fallback came through the typing helper extraction (fix(discord): suppress typing when hooks silently handle a turn #108449; later refactor: simplify runtime adapters and remove obsolete code #152277/refactor(discord): consolidate shared transport and lifecycle paths #166626); source inspection finds no production call without that client or caller using the timing overrides. Remove that unreachable client-construction alternative and unused options. Lazy allocation after admission, conditional keepalive, the 20-minute bound and cleanup remain; client construction failures stay with the existing owner rather than triggering another construction path.
  • Discord presence's internal unknown-helper-action branch disappears because the sole dispatcher selects only setPresence (private action surface consolidated in refactor(discord): consolidate shared transport and lifecycle paths #166626/refactor(discord): consolidate repeated account and transport paths #166974). It guarded direct invalid helper invocation, not a reachable public action. Unknown public actions still fail at the dispatcher. External status validation remains explicit, with unchanged error text and no assertion allowance transfer.
  • No security, current-authority, durability, settlement, retry, resource bound or real concurrency guard is removed. Discord retains independent feedback/delivery clients, record-before-ack and tracked reaction rebinding. Telegram retains authorization, processing-thread distinction, dedupe settlement, album/forward/control ordering, and hydration retries. Browser retains trust wrappers, URL/upload validation, cancellation, caps and stale-tab recovery.
  • JSON retains update-status collection before composition and database then backup then publication ordering. Service inspection retains degraded-systemd behavior and optional-enrichment failure isolation. ClickClack retains command normalization, aliases, first-duplicate ordering, Unicode limits, the 100-command cap, empty overwrites, and best-effort 403/404/network messages without stopping startup.
  • Tests enter their real owners rather than exported private helpers. This accepts some additional collection cost without adding production test seams, retries, skips or timeout changes.

Net LOC

Final formatted measurement: 545 net production lines removed (+1828/-2373) across 26 production paths. Tests, fixtures/support, declarations/generated files and shrink-only metadata are excluded.

Evidence

Complete retired-owner and caller inspection, importer/provenance census, and author simplification are complete. The sole CLI importer of status-json remains dynamic and is not folded. Private runtime imports that remain lazy stay at their original effect points. Frozen/prefer-offline setup, canonical formatting, cap-sensitive syntax lint and whitespace pass; no budget increased.

Initial focused proof passed Browser (97 cases), Discord (187), Telegram (25 database-worker plus 13 ordinary), ClickClack (22), and the retained helper/health/daemon/command siblings. It found owned fixture type/collection issues and an install-guidance test relying on the operator account home. Repairs retain a synthetic temporary home, mock the OS account identity using the established daemon-test pattern, use valid presence/health facts, and separate the hoisted declaration from its export. Assertions, guards and production behavior remain unchanged.

Fresh whole-candidate independent P0–P2 review after those repairs completed scoped-clean with final source verification; its status and report were inspected. Repaired runtime proof passed all four affected owner suites: 69 cases. The mock ratchet passed (8,383 grandfathered factories); repaired-file typed lint passed. Runtime and Madge cycle checks report zero; script lint, extension syntax lint and whitespace pass. Final 29-root native typecheck passes after supplying the fixture's required text field; the affected Gateway fixture's final runtime proof passes all 27 cases, and its typed lint passes. Unchanged-input proof is reused rather than rerunning the other owner suites.

The first commit attempt correctly refused growth of an already oversized Windows startup suite. A shared test-only fixture now supplies the same three spies and real status-summary entry point to both existing suites; the Windows file stays at its previous size, with no allowance increase or production test seam. The final whole-candidate independent P0–P2 review is scoped-clean with final source verification. Targeted 29-root native types and the two fixture consumers pass (37 Windows startup and 6 service-summary cases); no retained assertion was removed.

On the initial head, the suppression suite passed 13 cases and failed the listed main-only MCP/provider inventory assertion (98 versus 97, scheduled main 39218528567). That failure was retained rather than relabeled green; this lane changed none of its sources or allowances.

GitHub then reported CONFLICTING. The authorized rebase onto 9509fc2 preserves main's report-data table/local-overview cleanup from #177097 and its channel-note owner. The shared report fixture remains, with main's cases and assertions intact; two orphan imports are removed. The signed repaired head is 6ed2bcc, with the same 545 net production reduction. Frozen setup and the 29-root native typecheck pass. All five affected focused suites pass: 21 diagnosis, 39 report/channel and 14 suppression cases. Main's ab76239 inventory reconciliation and #177150 MCP cleanup explain why the old inventory signature is no longer present on this revision; no allowance was expanded by this PR. Affected-file typed lint passes; runtime and Madge cycle checks both report zero. Whitespace is clean. The mechanical conflict adaptation reuses the unchanged-input independent review above.

Exact-head CI 39248309794 completed successfully on 6ed2bcc; its effective openclaw/ci-gate check 118052914239 succeeded. The exact-head watcher reports GREEN. Cancelled administrative context check 118045528326 is superseded by same-head success 118045581778; no failed or pending check remains. No CI rerun or re-push for green occurred. No local broad suite, build, E2E, whole-graph typecheck or operator-state access is claimed. Prior-head proof is reused only for unchanged inputs; hosted evidence above is for the repaired exact head.

Merged through the ordinary native workflow as 6266041. Fresh fetched main 972c9ff contains that squash commit (git merge-base --is-ancestor passed). Native closeout completed, including ownership-checked managed worktree/branch cleanup and the completion comment.

@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: telegram Channel integration: telegram gateway Gateway runtime commands Command implementations extensions: browser extensions: clickclack size: XL labels Oct 19, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR moves private status and bundled plugin helpers into their existing callers and migrates tests to those owners.

Example: Run openclaw gateway status --json against two URLs reporting gateway-instance-1.

  • Before: The private output module suppresses the duplicate Gateway warning.
  • After: The command performs the same identity comparison and suppresses the same warning.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Source review supports the consolidation and reported focused tests exercise real owners with mocked boundaries; shipped-entry-point behavior and broad exact-head CI are not established.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored internal refactor is outside the ordinary contributor proof gate; the body reports focused owner-suite validation, while the inspected prepared screenshots show unrelated CSS parity.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No user-visible defect is claimed; private forwarding modules split maintenance of operations already owned by their callers.
Reason: The maintainer-authored direction removes redundant internal surfaces, preserves public behavior and moves existing coverage to the command, dispatcher and startup boundaries.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: it provides useful, maintainer-directed consolidation, and no introduced correctness or security defect was found; GitHub reports conflicts and the PR remains draft.

Priority: P3
Reviewed head: 4969bcfcccbb23b630ac7f85b70d0026a75d0917

Before merge

  • Complete next step - Resolve GitHub's reported conflicts, preserving main's channel-account notes consolidation, and mark the PR ready when preparation is complete.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped-entry-point run of this refactor is supplied; the ordinary contributor proof gate does not apply to this maintainer-authored PR.
Agent review details

How this fits together

Status commands consume configuration, service and Gateway facts to produce reports; bundled plugin runtimes consume actions and inbound messages to produce browser results, channel feedback and command menus.

flowchart TD
  A[CLI requests] --> B[Status command owners]
  C[Service and Gateway facts] --> B
  B --> D[Text and JSON reports]
  E[Plugin actions and messages] --> F[Existing plugin runtime owners]
  F --> G[Browser and channel transports]
Loading

Technical review

Best possible solution:

Retain the owner consolidation while resolving conflicts without discarding current main's channel-account notes changes.

Do we have a high-confidence way to reproduce the issue?

This is a behavior-preserving refactor, so there is no reported failing user scenario to reproduce; review compared the pinned original implementations with their destination owners.

Is this the best way to solve the issue?

The consolidation follows existing ownership, removes superseded forwarding paths, and preserves the inspected contracts without replacement production machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b28c930d1596.

Provenance checked

  • Status reports, JSON composition and service summaries keeps the original intent (72dcf94: Status helpers centralized reporting; degraded-systemd handling preserved usable service evidence, and refactor(status): keep report assembly with command owners #175578 subsequently moved report assembly toward command owners.)
  • Browser action helpers keeps the original intent (197510f: Browser runtime packaging separated action handling; subsequent fixes established trust wrapping, cancellation, timeout and tab-lifecycle behavior that remain in the dispatcher.)
  • Telegram inbound processing keeps the original intent (4a84117: refactor(telegram): split bot handler runtime #106324 split a large handler by responsibility; this PR consolidates processing into its existing inbound pipeline while preserving authorization and buffer lifecycles.)
  • Discord typing and private action dispatch changes intended behavior with a stated reason (fix(discord): suppress typing when hooks silently handle a turn #108449: Typing must begin after reply admission; the PR documents why unused construction options and an unreachable private presence-action branch can disappear without changing that behavior.)
  • ClickClack command menus keeps the original intent (1fada80: feat: sync ClickClack command menus #107907 publishes native commands at startup without letting menu permission or transport failures stop startup.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -545, Tests -112, Other -28. Total -685 across 53 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 26 1828 2373 -545
Tests 25 1180 1292 -112
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 0 28 -28
Total 53 3008 3693 -685

Review metrics

Metric Value Why it matters
Production versus test changes Production +1828/-2373; tests and support +1179/-1291 Both categories shrink overall; added test fixtures support moving existing coverage to production owners without adding production test seams.

Labels

Label changes:

  • add P3: This is internal maintenance with no intended change to user behavior and no demonstrated urgent regression.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is internal maintenance with no intended change to user behavior and no demonstrated urgent regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 19, 2026, 7:52 AM ET / 11:52 UTC.

@steipete
steipete force-pushed the deslop/z25-37-status-owners-20261015 branch from 4969bcf to 6ed2bcc Compare October 19, 2026 11:56
@steipete
steipete marked this pull request as ready for review October 19, 2026 11:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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-19T12:03:01.923613Z 6ed2bcc 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.

@steipete
steipete merged commit 6266041 into main Oct 19, 2026
275 of 276 checks passed
@steipete
steipete deleted the deslop/z25-37-status-owners-20261015 branch October 19, 2026 12:21
@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
amittell added a commit to amittell/openclaw that referenced this pull request Oct 21, 2026
Merges upstream main at b90b2cf.

- extensions/telegram/src/bot-handlers.inbound-processing.ts: main deleted it in openclaw#177290, which moved Telegram inbound processing into bot-handlers.inbound-pipeline.ts. Take the deletion.
- extensions/telegram/src/bot-handlers.inbound-pipeline.ts: the singleton media ref built after the deferred download carries fileUniqueId again, the one line this branch had added in the deleted file. The diff against main stays 6 files, +394/-3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: telegram Channel integration: telegram commands Command implementations extensions: browser extensions: clickclack gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant