Repository navigation
refactor(ui): use native agent roster and file inventory reads - #179532
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +70, Tests +230. Total +300 across 15 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 21, 2026, 5:56 PM ET / 21:56 UTC. |
There was a problem hiding this comment.
💡 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; |
There was a problem hiding this comment.
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 👍 / 👎.
|
Merged via squash.
|
…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
Actual base
89145639779249bfd7d1459cc564cb8aa178ac1b; reviewed candidate1cbea11e4d581af23892928534a58a986df9221a. 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.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
LoadingandErrored;isPendingdrives the controls, andlatestdistinguishes 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; candidate1cbea11e4d581af23892928534a58a986df9221a. 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
pnpm tsgo:uici:fullrun 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.