Skip to content

refactor(ui): read agent rosters from their owner - #180696

Merged
steipete merged 3 commits into
mainfrom
solid2/w-design-agent-roster
Oct 22, 2026
Merged

steipete merged 3 commits into
mainfrom
solid2/w-design-agent-roster

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem and solution

Agents route data and mutable page state each copy the roster already owned by the shared agent capability. The page also filters and clones that roster on every owner publication.

Read the canonical roster through a read-only getter. Keep route data limited to URL and selection intent, removing its roster and Gateway identity fields. The view excludes system rows when selecting a displayed agent, and identity hydration filters those rows at its existing consumer. The route still waits for initial roster loading at the same lazy boundary; selection intents, drafts, and late-result retirement keep their existing owners.

Metric Before After
Page state LOC 949 948
Route LOC 43 34
View LOC 346 349
Combined production LOC 1,338 1,331
Route import sources (static + dynamic) 7 5
Route data fields removed — 3
Writable roster assignments 3 0

Production fan-in remains page 8 / route 4 / view 1; page/view fan-out remains 38 / 24 including dynamic imports. The full-roster read contract remains because the page's domain helpers consume it, but it no longer stores or owns that roster. No new modules, exports, or reactive primitives. Existing counts remain one signal, one memo, two onSettled calls, one action, and one optimistic value; no effects, cleanup calls, untrack, flush, owner APIs, listeners, or DOM queries.

Proof

Check Result
UI typecheck Passed (tsrs)
Route, lifecycle, and rendered view cases 57 passed across three files
Targeted lint / formatting Passed
Independent autoreview through P2 Scoped clean
Production Knip Same two pre-existing unused heartbeat files
Same-machine UI builds + strict performance Passed: startup 316,749 → 315,128 B gzip (−1,621 B); 1 CSS request unchanged

The first local run exposed a static test fixture whose roster never retired on client replacement. That fixture had depended on the deleted page mirror to force a reload. The replacement matrix now uses real roster and selection owners, retaining all four lifecycle cases and the assertion that a late old model result cannot replace the current catalog. Only the affected test file was rerun. Added rendered coverage ensures a system-only roster does not expose an agent panel.

Knip reports only src/infra/heartbeat-active-hours.ts and src/infra/heartbeat-wake-policy.ts, reproduced on untouched main. Full UI CI is requested. Rendering, tags, classes, and selectors are unchanged; screenshots are not applicable.

CI repair: four additional test files supplied static roster/connection fixtures through the retired route payload. They now bind the existing roster and selection capabilities to the Gateway; snapshot-provenance assertions remain for routes that carry snapshots. All 30 cases across the affected files, UI-pages types, targeted lint/format, and independent P2 review passed. The fixture repair adds 37 test/helper lines and no production code. Final PR: 270 additions / 178 deletions (net +92); production remains -7 LOC. Current main is merged, including its Twitch test repair.

@clawsweeper

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

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 22, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 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-22T15:05:09.177528Z 39c4a7b New commits
ℹ️ 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 enabled auto-merge (squash) October 22, 2026 14:35
@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: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces Agents route and page roster copies with a read-only getter into the shared agent capability.

Example: Open /settings/agents/research/tools with Research and a system agent in the roster.

  • Before: Research displays using a filtered roster copied into route and page state.
  • After: Research displays using the canonical roster, with system agents excluded by its consumers.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation is focused and source-supported, with meaningful in-process coverage; validation confidence remains limited by unresolved CI diagnostics.
Proof confidence 🦐 gold shrimp (3/6) The supplied maintainer-authored classification exempts ordinary contributor proof; inspected supporting tests exercise the production page and capability owners with synthetic transport responses.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Agent navigation, drafts, and system-agent exclusion must retain their behavior while redundant roster ownership is removed.
Reason: The maintainer-directed change reduces competing state without adding an API, configuration option, or new owner.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR makes a useful, owner-directed simplification, and no actionable defect was found in the pinned diff.

Priority: P3
Reviewed head: aff93981a1c5eb67d93bf38deddf959b8a57dbd3

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Gateway supplies agent rosters to the shared capability; Settings selection and the Agents page consume that owner to select agents, hydrate identities, and render panels.

flowchart TD
  A[Gateway agents list] --> B[Shared agent capability]
  B --> C[Settings selection owner]
  B --> D[Page read-only getter]
  E[Route selection intent] --> C
  C --> F[Agents panels]
  D --> F
Loading

Technical review

Best possible solution:

Use the existing capability as the sole roster owner while retaining selection intent, consumer filtering, and synchronous lifecycle retirement.

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

This is a behavior-preserving refactor; source inspection confirms the duplicated roster ownership, and no failing product scenario is claimed.

Is this the best way to solve the issue?

The patch is the smallest coherent cutover: it reuses the existing owner and publication path, removes the copied data, and preserves filtering at the affected consumers.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Page roster mirror changes intended behavior with a stated reason (30469f4: The Solid port retained synchronous domain state and existing selection behavior.)
  • Route Gateway identity fields keeps the original intent (deb7faf: Source and snapshot identity prevented preloaded data from reviving obsolete connection state; the PR removes that data transfer rather than bypassing its check.)
  • System-agent filtering keeps the original intent (49ff6a4: Typed system rows remain available diagnostically but are excluded from ordinary selection and assignment surfaces.)
  • Late model-result lifecycle coverage keeps the original intent (48acc5e: Agents must observe catalog publications and reject stale reads without discarding usable choices or drafts.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 25e7d4f adds ui/src/pages/agents/agents-page-state.ts:109 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 25e7d4f34f5c; files: ui/src/pages/agents/agents-page-state.ts)
  • Patrick Erichsen: Raw commit dd52d73 adds ui/src/pages/agents/agents-page.test-support.ts:147 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: dd52d7354262; files: ui/src/pages/agents/agents-page.test-support.ts)

PR surface

Source -7, Tests +62. Total +55 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 18 25 -7
Tests 5 138 76 +62
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 156 101 +55

Review metrics

Metric Value Why it matters
Production versus test LOC Production −7 net; tests and test support +62 net. The test growth replaces static lifecycle fixtures with real roster and selection owners while preserving distinct stale-result boundaries.

Labels

Label changes:

  • add P3: This is an internal ownership cleanup with no claimed user-visible regression or intended behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is an internal ownership cleanup with no claimed user-visible regression or intended behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 22, 2026, 10:47 AM ET / 14:47 UTC.

@steipete
steipete disabled auto-merge October 22, 2026 14:56
@steipete
steipete merged commit 8727aa6 into main Oct 22, 2026
90 of 91 checks passed
@steipete
steipete deleted the solid2/w-design-agent-roster branch October 22, 2026 15:33
@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 23, 2026
* refactor(ui): read agent rosters from their owner

* test(ui): bind agent fixtures to canonical roster owners
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 ci:full Keep ordinary native-locale CI selection on the next PR run. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M 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