Skip to content

refactor(ui): use native agent roster and file inventory reads - #179532

Merged
steipete merged 9 commits into
mainfrom
solid2/w-s2-agent-owner-reads
Oct 22, 2026
Merged

steipete merged 9 commits into
mainfrom
solid2/w-s2-agent-owner-reads

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor
Family Files base→head Production LOC base→head 1 handlers 2 lifecycle 3 reads C/E/U/N base→head 4 commands C/E/U/N base→head 5 lazy 6 collections 7 JSX 8 context 9 Reveal 10 owner APIs
Agents editor / non-memory 24→25 5,759→5,798 0→0 0→0 6C/0E/0U/6N→4C/0E/0U/8N 4C/0E/0U/3N→4C/0E/0U/3N 0→0 0→0 0→0 0→0 0→0 0→0
Agents memory 12→12 2,844→2,844 0→0 0→0 0C/0E/0U/5N→0C/0E/0U/5N 1C/1E/0U/1N→1C/1E/0U/1N 0→0 0→0 0→0 0→0 0→0 0→0
Config Appearance / shared 14→14 4,116→4,116 0→0 0→0 2C/1E/0U/5N→2C/1E/0U/5N 3C/1E/0U/1N→3C/1E/0U/1N 0→0 0→0 0→0 0→0 0→0 0→0
Config other 34→34 5,602→5,602 0→0 0→0 2C/0E/0U/2N→2C/0E/0U/2N 2C/1E/0U/2N→2C/1E/0U/2N 0→0 0→0 0→0 0→0 0→0 0→0
Config health 3→3 1,352→1,352 0→0 0→0 1C/0E/0U/0N→1C/0E/0U/0N 0C/0E/0U/1N→0C/0E/0U/1N 0→0 0→0 0→0 0→0 0→0 0→0
Config memory 5→5 1,319→1,319 0→0 0→0 0C/1E/0U/1N→0C/1E/0U/1N 2C/0E/0U/0N→2C/0E/0U/0N 0→0 0→0 0→0 0→0 0→0 0→0
Config Talk 4→4 1,471→1,471 0→0 0→0 1C/0E/0U/2N→1C/0E/0U/2N 2C/0E/0U/0N→2C/0E/0U/0N 0→0 0→0 0→0 0→0 0→0 0→0
Sessions 22→22 4,021→4,021 0→0 0→0 1C/0E/0U/3N→1C/0E/0U/3N 8C/0E/0U/0N→8C/0E/0U/0N 0→0 0→0 0→0 0→0 0→0 0→0
Total 118→119 26,484→26,523 0→0 0→0 13C/2E/0U/24N→11C/2E/0U/26N 22C/3E/0U/8N→22C/3E/0U/8N 0→0 0→0 0→0 0→0 0→0 0→0

Actual base 89145639779249bfd7d1459cc564cb8aa178ac1b; reviewed candidate 1cbea11e4d581af23892928534a58a986df9221a. Base reuses the exact qualified d920/891 whole-scope census. Two fresh and seven exactly matching reused native AST blobs qualify five changed/added scoped production files with zero syntax diagnostics; all 17 authored paths have independently pinned Git hashes. Only Agent roster and Agent file list receive proposed C→N credit; selected file content remains a candidate and all command classifications remain unchanged. No pending PR receives merged credit.

Touched sources Before LOC After LOC Delta
Production (7 files) 2,442 2,507 +65
Tests/support (10 files) 4,965 5,196 +231

Items 1, 2, 5–10 retain zero eligible sites under the existing named lower-level exceptions. Read status comes from owner receipts via async memo, Loading/Errored and isPending/latest; no independent loading/error authority is introduced. Coupled domain files stay plain TypeScript. Exact base/head budget comparison is owned by the source lane; this source census does not claim build evidence. Production LOC includes two coupled domain files in addition to the five scoped page files.

All 118 base production Git blob IDs match the qualified891 manifest. Candidate has 119 files / 26,523 LOC (+39). scope-manifest.json binds every file family/LOC/blob/SHA256; qualification.json binds the two fresh and seven reused native AST records and all17 touched paths. Coupled plain owner production is 477→503 LOC; it is included in touched production and excluded from scope totals. 33 candidates remain on this proposed head; no merged credit.

C/E/U/N = eligible candidate / named allowed exception / unresolved / native.

What Problem This Solves

Refreshing the Agent roster or workspace file inventory copied loading and error presentation beside the synchronous capability. Native async memos now consume the admitted completion beneath Loading and Errored; isPending drives the controls, and latest distinguishes an initial unresolved receipt from a retired read. Only the notice is keyed, so the picker, editor, Refresh controls and drafts retain their DOM identity.

A failed forced inventory refresh previously triggered a content reread whose success erased the inventory error. Content refresh now follows only successful inventory results. The failed receipt stays visible beside the cached editor, including first-load failure, until explicit retry or owner retirement. The capability retains synchronous admission, access, cache and retirement authority. Its legacy loading getters derive from the active request, and existing nonthrowing public results remain available to other consumers. The separate file-request map and unused inventory-error copy are removed.

The unchanged default-agent and identity commands now live in lib/agents/mutations.ts, imported directly by their two lazy Agents callers. The module remains plain TypeScript and has no eager re-export; its source appears in the Agents page chunk. This keeps mutation code behind its existing lazy boundary.

The final integration is a normal merge of main 89145639779249bfd7d1459cc564cb8aa178ac1b; candidate 1cbea11e4d581af23892928534a58a986df9221a. It preserves the landed Skills and memory work and main’s accessible error announcement in the native notice. The authored diff stays focused on roster/file-inventory presentation and owner contracts.

Evidence

Proof Result
Frozen install / pnpm tsgo:ui Passed on integrated rc.16 candidate
Focused status, lifecycle and page tests 46 passed across three directly changed files, default pinned Bun, one worker
Coupled owner proof Owner source and owner test are byte-identical to the prior proved head; prior owner-test proof retained
Targeted type-aware lint / format Passed for all 17 authored paths, including three coupled owner files
Independent review Complete 17-file diff scoped-clean P0–P2, final source verification complete; reviewer assessed the complete diff with unchanged-source context unavailable in its sandbox
Production Knip Passed required production files/dependencies command
Canonical builds / strict paired performance Both passed; strict head comparison has zero warnings/violations. Fixed identical release metadata, host, toolchain and plugin fixtures. Startup 325,086 → 325,010 B gzip (−76); raw startup 973,790 → 973,640 B. CSS 40,912 B / 1 request unchanged. Chat 1,441,551 → 1,441,550 B (−1); New Session 1,019,319 → 1,019,292 B (−27). Every locale pair is under 307,200 B. Startup is above the 325,000 B campaign cap on both sides and shrinks here.
Exact-head full CI Fresh exact-head ci:full run 39712861630 passed. The old Subagents attribution is retired.

Touched production LOC: 2,442 → 2,507 (+65); tests/support: 4,965 → 5,196 (+231). The growth exposes admitted read receipts and native status boundaries while removing the competing request map and copied error state. Selected-file content remains in its separate focused PR. Host tags, classes, routes, selectors and lazy boundaries are preserved.

Allowed exceptions: System Info feeds visibility-paced observer models without a local loading/error presenter; memory-schema readiness remains advisory while edits stay available; appearance/preferences writes apply synchronously to the application owner; notification permission hands off to the OS; clipboard copy publishes its existing copied/failed receipt without a saving/rollback presenter. The named imperative preview flush commits a parked preview before the dialog moves focus.

Screenshots

All captures are inspected synthetic data at 1440×1000 in dark mode. Both successful retries completed with no page errors or failed requests. The baseline inventory-error capture intentionally shows the bug: the old content reload had already erased the notice.

State Before After
Roster refresh pending Before: roster refresh pending After: roster refresh pending
Roster refresh failure Before: roster refresh failure After: roster refresh failure
File inventory pending Before: file inventory pending After: file inventory pending
File inventory failure Before: the inventory error disappeared After: file inventory error stays visible

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

chatgpt-codex-connector Bot commented Oct 21, 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-22T02:47:15.501849Z 1cbea11 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper clawsweeper Bot removed the clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. label Oct 21, 2026
@clawsweeper clawsweeper Bot removed the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Oct 21, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR exposes agent roster and file-inventory read completions to Solid loading and error boundaries while preserving cached editors.

Example: Refreshing Garden helper’s file inventory fails while AGENTS.md is open.

  • Before: A subsequent content reread can erase the inventory error.
  • After: The inventory error remains above the cached editor, with Refresh available.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, focused, and visually demonstrated, with no actionable code finding; required CI remains a separate landing gate.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected browser captures exercise roster and file-inventory pending and failed reads using synthetic Garden helper data; the after-fix inventory error remains visible above the retained AGENTS.md editor, and the body records successful retries.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: A failed workspace inventory refresh can lose its error notice while cached file content remains visible.
Reason: The maintainer-approved direction consolidates read presentation around the existing capability and repairs a visible failure without adding configuration or changing persisted contracts.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR makes a useful owner-preserving refactor and fixes disappearing inventory errors; no concrete introduced defect was found, but required checks remain unresolved.

Priority: P2
Reviewed head: f1167f8ed54eb216249d57f928d69234ba8644e5

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: A red-on-base execution of the new regression tests is not shown.
Agent review details

How this fits together

The Control UI agent capability admits Gateway roster and inventory requests, maintains scoped caches, and publishes completions consumed by Agents settings.

flowchart LR
  A[Agents settings] --> B[Agent capability]
  B --> C[Gateway RPC client]
  C --> D[Agent roster and files]
  D --> B
  B --> E[Read completion]
  E --> F[Solid status boundaries]
  B --> G[Cached editor and drafts]
Loading

Technical review

Best possible solution:

Keep synchronous request ownership in the agent capability and consume its completions through narrowly scoped Solid status boundaries.

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

Current-main source and the supplied before/after browser captures establish the inventory-error path; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The refactor preserves the existing synchronous owner, removes duplicate request bookkeeping, and limits remounting to the notice rather than the editor or controls.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 224c0bc adds ui/src/lib/agents/index.ts:215 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 224c0bcd8991; files: ui/src/lib/agents/index.ts)

PR surface

Source +70, Tests +230. Total +300 across 15 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 5 215 145 +70
Tests 10 302 72 +230
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 517 217 +300

Review metrics

Metric Value Why it matters
Production versus test growth Production +70 lines; tests and fixtures +230 lines Growth exposes admitted completions and native status rendering while removing the parallel request map; tests cover failure retention, retirement, retry, and retained controls.

Labels

Label changes:

  • add P2: Inventory failures can disappear from an otherwise usable editor; preserving their visible recovery path is a bounded UI improvement.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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:

  • P2: Inventory failures can disappear from an otherwise usable editor; preserving their visible recovery path is a bounded UI improvement.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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 21, 2026, 5:56 PM ET / 21:56 UTC.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 311bcf6d50

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

status.error = null;
status.request?.resolve({ result: status.list });
status.request = null;
status.read = null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve inventory failures across file operations

When a file-inventory refresh has failed but a cached list remains, opening an uncached file or successfully saving an existing file calls recordFile; clearing status.read here removes the settled failure even though agents.files.list was never retried. Because AgentFiles renders the inventory alert solely from this receipt, an unrelated get/set operation makes the error disappear and presents the stale inventory as healthy. Preserve the failed receipt until an inventory retry or owner retirement.

AGENTS.md reference: ui/AGENTS.md:L16-L19

Useful? React with 👍 / 👎.

@steipete
steipete merged commit b320b79 into main Oct 22, 2026
125 of 129 checks passed
@steipete
steipete deleted the solid2/w-s2-agent-owner-reads branch October 22, 2026 03:22
@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 22, 2026
…law#179532)

* refactor(ui): consume native agent roster and file inventory reads

* test(ui): exercise real agent inventory owner across reconnects

* refactor(ui): use active agent read identity for settlement

* refactor(ui): keep agent mutations behind the lazy route
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. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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