Skip to content

refactor(control-ui): simplify mention Inbox request ownership - #137375

Merged
steipete merged 1 commit into
mainfrom
codex/mentions-loc-reduction
Sep 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/mentions-loc-reduction

Conversation

@steipete

@steipete steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Related: #135853

What Problem This Solves

Maintainer-requested, behavior-preserving cleanup of the Control UI mention Inbox. Refresh and dismissal duplicated request/error handling, and each connection retained a full response solely to read its revision.

Why This Change Was Made

Both operations now use one connection-owned request path with the same pre-dispatch and post-response ownership checks, revision fences, and access-revocation handling. Store only the accepted revision and simplify refresh cleanup without changing invalidation coalescing or dismissal semantics.

Production: +46/-57 (net -11). Tests: unchanged. No database/schema, migration, configuration, dependency, public RPC, visual, or lazy-loading changes.

User Impact

No intended user-visible change. Stale reads still cannot restore dismissed or revoked Inbox items; profile changes and disposal still retire in-flight work.

Evidence

  • 72 existing tests passed across application mentions, connection bootstrap, sidebar attention/store, and Gateway method permissions.
  • UI TypeScript check, targeted Oxlint, Oxfmt, and git diff --check passed on the final source.
  • The broader Blacksmith Testbox changed gate (run 33765155076) passed early guards and localization, then was deliberately stopped during core-test typechecking. It is not claimed as a completed gate; the PR's exact-head CI remains required.
  • Direct source review of the controller, Gateway permission helper, bootstrap coordinator, sidebar callers, and existing race/lifecycle coverage. No additional review agents were used, per the maintainer's explicit request.
  • No new test needed: existing tests cover invalidation coalescing, late responses, revocation, profile/connection changes, bootstrap, and disposal. No separate live/browser rerun for this behavior-neutral internal refactor.

@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Sep 3, 2026
@steipete steipete self-assigned this Sep 3, 2026
@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 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 11:38 AM ET / 15:38 UTC.

ClawSweeper review

What this changes

The PR consolidates Control UI mention Inbox list and dismissal requests into one connection-owned snapshot path while retaining revision and ownership fencing.

Merge readiness

✅ Ready for maintainer review

Patch is correct: the shared snapshot path preserves the existing ownership, revision, and access-revocation checks. Current main still contains the duplicated paths, so this maintainer-owned cleanup remains useful.

Priority: P3
Reviewed head: 67034f53e4dfa7c3d137b26b3f2bad6b54166368

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused net-negative refactor with direct lifecycle and Gateway-contract evidence and no identified correctness defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-owned PR is a behavior-preserving internal request-lifecycle refactor with no changed visible UI flow; the existing lifecycle tests directly cover the retained behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-owned PR is a behavior-preserving internal request-lifecycle refactor with no changed visible UI flow; the existing lifecycle tests directly cover the retained behavior.
Evidence reviewed 5 items Current-main baseline: Current main retains separate result and error handlers plus the dedicated refresh request path, so the central cleanup is not already implemented there.
Introduced behavior: The verified test merge against current main changes only the mention capability, and the introduced helper retains the former dispatch, response fencing, and error behavior for both Gateway methods.
Lifecycle coverage: Existing tests cover invalidation coalescing, stale-list fencing after dismissal, list and dismiss error handling, revocation, connection/profile changes, and disposal; the refactor leaves those tests unchanged.
Findings None None.
Security None None.

How this fits together

The Control UI’s mention Inbox requests a profile’s pending mentions from the Gateway, reacts to targeted invalidation events, and publishes state for the sidebar. Dismissals use the same connection and must not allow stale responses to restore removed or revoked items.

flowchart LR
  A[Gateway connection] --> B[Mention Inbox capability]
  C[Inbox invalidation event] --> B
  B --> D[Owned snapshot request]
  D --> E[Profile and revision checks]
  E --> F[Sidebar Inbox state]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -11. Total -11 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 46 57 -11
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 46 57 -11

Review metrics

Metric Value Why it matters
Production versus test delta production −11, tests 0 The one-file refactor removes duplicated request/error handling without expanding runtime or test surface.

Technical review

Best possible solution:

Keep one request owner for both Gateway methods and land the net-negative refactor once the normal exact-head merge gates complete.

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

Not applicable: this PR is a behavior-preserving refactor, and direct source plus existing lifecycle coverage establish the relevant paths.

Is this the best way to solve the issue?

Yes. The Gateway exposes one common result shape for listing and dismissal, and the shared helper preserves the previous lifecycle fences without creating another abstraction layer.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d2a616bdf373.

Labels

Label changes:

  • add P3: This is a small behavior-preserving Control UI cleanup with no intended user-visible change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-owned PR is a behavior-preserving internal request-lifecycle refactor with no changed visible UI flow; the existing lifecycle tests directly cover the retained behavior.

Label justifications:

  • P3: This is a small behavior-preserving Control UI cleanup with no intended user-visible 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: This maintainer-owned PR is a behavior-preserving internal request-lifecycle refactor with no changed visible UI flow; the existing lifecycle tests directly cover the retained behavior.

Evidence

What I checked:

  • Current-main baseline: Current main retains separate result and error handlers plus the dedicated refresh request path, so the central cleanup is not already implemented there. (ui/src/app/mentions.ts:75, d2a616bdf373)
  • Introduced behavior: The verified test merge against current main changes only the mention capability, and the introduced helper retains the former dispatch, response fencing, and error behavior for both Gateway methods. (ui/src/app/mentions.ts:75, 67034f53e4df)
  • Lifecycle coverage: Existing tests cover invalidation coalescing, stale-list fencing after dismissal, list and dismiss error handling, revocation, connection/profile changes, and disposal; the refactor leaves those tests unchanged. (ui/src/app/mentions.test.ts:104, d2a616bdf373)
  • Gateway contract: Both Gateway handlers return the same mention-list result shape, supporting one UI response-processing path for reads and dismissals. (src/gateway/server-methods/mentions.ts:11, 67034f53e4df)
  • Feature provenance: The mention capability and its test were introduced by the merged human-mentions feature; the current branch is the next focused change to that code. (ui/src/app/mentions.ts:80, 516fbb224bf8)

Likely related people:

  • Peter Steinberger: Raw commit 516fbb2 adds ui/src/app/mentions.ts:89 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 516fbb224bf8; files: ui/src/app/mentions.ts)

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.

@steipete
steipete merged commit 46018ec into main Sep 3, 2026
142 checks passed
@steipete
steipete deleted the codex/mentions-loc-reduction branch September 3, 2026 15:45
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 3, 2026
* refs/remotes/origin/main:
  fix(plugins): reject unverifiable pinned npm installs (#136725)
  improve(ui): lift sidebar section headers on hover and mark online owners (#136985)
  test(cron): reuse isolated run suite hooks (#137341)
  test(channels): reuse shared indexed call guards (#137350)
  fix(ui): sidebar header controls read misaligned after the + button lost its border (#137317)
  fix(qa-channel): preserve conversation kind for implicit actions (#137343)
  fix: target the source checkout in Control UI repair commands (#137354)
  chore: reduce CI job count and database test overhead (#137352)
  fix(ios): preserve chat live edge across keyboard transitions (#136660)
  refactor(control-ui): consolidate mention inbox requests (#137375)
  fix(openai): preserve ChatGPT HTTP status for retry pacing (#137146)
  fix(mcp): hide policy-denied plugin tools from ACP sessions [AI] (#136546)
  test(queue): reuse shared deferred fixtures (#137338)
  fix(gateway): repair the Gateway E2E shard (browser suite project, skill resource argv, Codex diagnostic) (#137358)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
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