Skip to content

refactor(ui): share channel status type definitions - #140331

Merged
steipete merged 1 commit into
mainfrom
steipete/deletion-ui-channel-status-types
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/deletion-ui-channel-status-types

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Related: #135868

What Problem This Solves

The Control UI repeats the same lifecycle and probe fields across six channel status types. This creates avoidable maintenance debt in the maintainer-directed deletion campaign following the #135868 split.

Why This Change Was Made

Share the common lifecycle/probe definitions and the identical Slack bot/team identity shape. Keep all six exported channel types and every existing field, requiredness, nullability, and channel-specific probe detail. The types are actively read through the detail renderer's computed channel key, so none of those runtime projections are removed.

User Impact

No user-visible change. This removes 77 production lines (+21/−98) from one file, with no test, tooling, or documentation delta. No tests or coverage are removed. UI rendering, styles, requests, and emitted JavaScript are unchanged.

Evidence

  • TypeScript-checker comparison recursively expanded all six before/after status types, including nested property keys, primitive unions, optional and readonly flags: identical.
  • Full-file before/after JavaScript transpilation: byte-identical.
  • node scripts/run-vitest.mjs --config ui/vitest.config.ts ui/src/pages/channels ui/src/lib/channels: 8 files, 120 tests passed. Existing localized status/probe cases remain in ui/src/pages/channels/view.test.ts:507; missing-status distinctions remain at :557.
  • node scripts/check-changed.mjs: passed the full selected gate (core-test types, UI types, i18n, dead exports, lint).
  • Independent Codex P0–P2 autoreview: scoped-clean, no accepted/actionable findings.
  • No visual change; this is erased type-only source, so screenshots would show identical output. No build, published API, packaging, or lazy boundary changed.

Resolved CI blocker

The first head exposed an unrelated main failure in test/scripts/docs-sync-publish.test.ts:377, where the route guard rejected release subpages from #140319. The separate repair #140337 is now merged. Landing this unchanged type refactor requires fresh exact-head CI against the repaired main.

ClawSweeper reviewed the original type patch with no actionable findings, before-merge requests, or rank-up moves. The rebased patch remains identical. All 120 focused channel tests and the 10 docs-sync tests pass on the repaired-main branch.

@clawsweeper

clawsweeper Bot commented Sep 6, 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 app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 17:33
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 2:09 PM ET / 18:09 UTC.

ClawSweeper review

What this changes

The PR shares common Control UI channel status and probe types while preserving all six exported channel shapes and their existing fields.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful, maintainer-directed cleanup absent from fetched main. No actionable correctness or security findings were identified.

Priority: P3
Reviewed head: 411d3808f03e92c7223dad324396284c70c83620

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, structurally equivalent refactor with useful reported validation and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR only reorganizes erased UI status types; the captured equivalence and transpilation checks support unchanged behavior, and no authority boundary changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR only reorganizes erased UI status types; the captured equivalence and transpilation checks support unchanged behavior, and no authority boundary changes.
Evidence reviewed 6 items Introduced type-only change: The complete pinned diff preserves requiredness, nullability, channel-specific fields, numeric Telegram IDs, string Discord IDs, and iMessage's narrower probe. No executable statements, imports, configuration, or dependencies change.
Still distinct from main: Fetched main retains the repeated declarations for all six channel types; this consolidation is not already implemented there. The supplied related PRs cover automatic recovery and docs navigation, not this cleanup. Inspection of the latest release's file was unavailable, so no release implementation claim is made.
Active consumer and implementation boundary: The renderer selects data[standardKey] and reads lifecycle and probe fields. The Gateway schema leaves channel-specific status as unknown, so these local projections remain useful rather than duplicating an existing typed protocol contract.
Findings None None.
Security None None.

How this fits together

The Control UI receives channel status snapshots from the Gateway and projects them into channel-specific types. The channel detail renderer uses those projections to display lifecycle status, probe results, and configuration details.

flowchart LR
  A[Gateway channel status] --> B[UI snapshot request]
  B --> C[Channel status types]
  C --> D[Select channel details]
  D --> E[Lifecycle and probe display]
  D --> F[Channel configuration details]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -77. Total -77 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 21 98 -77
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 21 98 -77

Review metrics

None.

Technical review

Best possible solution:

Retain the shared local type definitions and unchanged channel-specific projections without adding runtime abstractions or compatibility machinery.

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

Not applicable: this PR removes repeated type declarations rather than repairing a reported runtime defect.

Is this the best way to solve the issue?

Yes: private shared aliases preserve the existing structural contracts and active consumers without changing the Gateway protocol or plugin APIs.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a behavior-preserving type cleanup with no user-visible runtime change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR only reorganizes erased UI status types; the captured equivalence and transpilation checks support unchanged behavior, and no authority boundary changes.

Evidence

What I checked:

  • Introduced type-only change: The complete pinned diff preserves requiredness, nullability, channel-specific fields, numeric Telegram IDs, string Discord IDs, and iMessage's narrower probe. No executable statements, imports, configuration, or dependencies change. (ui/src/api/types.ts:101, 411d3808f03e)
  • Still distinct from main: Fetched main retains the repeated declarations for all six channel types; this consolidation is not already implemented there. The supplied related PRs cover automatic recovery and docs navigation, not this cleanup. Inspection of the latest release's file was unavailable, so no release implementation claim is made. (ui/src/api/types.ts:101, 3967d9b6df1f)
  • Active consumer and implementation boundary: The renderer selects data[standardKey] and reads lifecycle and probe fields. The Gateway schema leaves channel-specific status as unknown, so these local projections remain useful rather than duplicating an existing typed protocol contract. (ui/src/pages/channels/view.detail.ts:53, 411d3808f03e)
  • Validation and review continuity: The captured PR body reports recursive type equivalence, byte-identical JavaScript, 120 focused tests, and the selected changed-file gate passing. Existing renderer tests cover localized facts and missing-status distinctions. These checks were not rerun during this read-only review. The previous review projection contains no findings or published rank-up moves; the earlier head object was unavailable for independent comparison. (ui/src/pages/channels/view.test.ts:557, 411d3808f03e)
  • Related CI repair is incorporated: The supplied GitHub context verifies fix(test): accept release subpages in docs route shape #140337 merged as 96bf365, the pinned parent of this head. Its docs-route test repair is separate from the introduced type refactor. (96bf3652adab)
  • Area history and routing: File history identifies Peter Steinberger and Patrick Erichsen in prior channel-detail work, including status consolidation and the channel gallery. Missing historical blobs prevented exact source-line introduction verification; these remain routing candidates, not causal attribution. (ui/src/pages/channels/view.detail.ts, 411d3808f03e)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-06T17:39:19.529Z sha 4eefe2b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-06T17:45:02.753Z sha 4eefe2b :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the steipete/deletion-ui-channel-status-types branch from 4eefe2b to 411d380 Compare September 6, 2026 18:04
@steipete
steipete merged commit 7115aca into main Sep 6, 2026
124 checks passed
@steipete
steipete deleted the steipete/deletion-ui-channel-status-types branch September 6, 2026 18:17
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
* origin/main: (25 commits)
  docs(releases): keep the release-notes nav group to version routes (#140353)
  fix(ui): hide trust wrappers in imported chat history
  fix(subagents): subagent list building decodes unrelated saved prompts in large session stores (#139540)
  test(process): share relay startup fixtures (#140345)
  refactor(doctor): inline GitHub skill discovery inputs (#140343)
  refactor(ui): share channel status type definitions (#140331)
  refactor: simplify queue state and infrastructure dispatch (#140311)
  fix: require saved agent turns before update verification succeeds (#140274)
  fix(update): keep the service profile when switching to Git (#140263)
  fix(ui): prevent image avatars overlapping mobile chat (#140341)
  fix(test): accept release subpages in docs route shape (#140337)
  refactor(plugins): share uninstall mutation ownership (#140322)
  refactor(agents): use canonical tool execution arguments (#140280)
  perf(cli): keep inference metadata and domain help lazy (#140327)
  refactor(plugins): simplify self-hosted setup results (#140332)
  refactor(config): reuse parent lookup for unset operations (#140326)
  fix(plugins): preserve exact installed-index mutation receipts (#140328)
  test(agents): simplify MCP and LSP boundary fixtures (#140312)
  fix(ui): preserve literal source previews and copied whitespace (#140306)
  fix: OpenCode Go/Zen requests are missing the required x-opencode-session header (#137464)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
hartmark added a commit to hartmark/openclaw that referenced this pull request Sep 17, 2026
…prior run, seen on other unrelated PRs openclaw#140331/openclaw#133565/openclaw#133580, passes locally on current main)
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 maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant