Repository navigation
refactor(ui): use native agent file read and save status - #179580
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47d9ba6f5d
ℹ️ 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".
| const version = state.agentFileEditors[name]?.version; | ||
| const resolution = operation.kind === "read" ? operation.resolution : undefined; | ||
| const completion = Promise.withResolvers<AgentFileOutcome>(); | ||
| state.agentFileOutcome = completion.promise; |
There was a problem hiding this comment.
Preserve pending write outcomes across concurrent reads
Reads and writes use different busy flags, so a user can click Save and then select another file or Refresh while that write is pending. The new read replaces this single agentFileOutcome promise; if the write later fails, its promise resolves without any rendered boundary observing it, silently dropping the save error and potentially causing the user to believe the draft was persisted. Keep read and write outcomes separate, or prevent reads while a write is pending.
AGENTS.md reference: ui/AGENTS.md:L18-L18
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15fa1b1a76
ℹ️ 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".
| const saving = () => | ||
| params.readData().agentFileSaving || | ||
| (optimisticSaving() && params.readData().agentFilesLoading); |
There was a problem hiding this comment.
Retire optimistic save state after reconnect
If a save remains unresolved across a same-client reconnect, invalidateTransientRequests() clears the owner’s saving flag but this component retains optimisticSaving(). A subsequent file refresh or tab read then sets agentFilesLoading, causing this expression to resurrect the retired operation as “Saving” and disable the Save button for the unrelated read. Scope or reset the optimistic transaction when its connection generation is invalidated instead of masking it with the loading flag.
AGENTS.md reference: ui/AGENTS.md:L17-L17
Useful? React with 👍 / 👎.
|
Codex review: needs maintainer review before merge. What this changesThis PR presents agent-file reads, errors, and saving feedback through native Solid async boundaries while retaining the existing file owner. Example: Save edited AGENTS.md instructions for Garden helper.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open. The maintainer-directed refactor resolves the prior findings, preserves file-owner responsibilities, and introduces no actionable defects found in this review. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI Agents Files panel sends read and write requests through the existing Gateway client; the synchronous file owner retains drafts, checks request generations and conflicts, and publishes results for rendering. flowchart LR
A[Agents Files panel] --> B[Selected file actions]
B --> C[Synchronous file owner]
C --> D[Gateway file RPC]
D --> C
C --> E[Completion receipts]
E --> F[Solid status and saving presentation]
G[Page retirement lifetime] --> F
Technical reviewBest possible solution: Retain the existing synchronous file owner and use its receipts and shared retirement lifetime for native Solid presentation. Do we have a high-confidence way to reproduce the issue? This is a behavior-preserving refactor; source inspection and supplied browser captures establish the affected paths without executing target code. Is this the best way to solve the issue? The change follows the existing owner-backed Solid recipe, removes manual error presentation, and preserves write admission and settlement in the established owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against de028a85f437. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +98, Tests +327. Total +425 across 17 files. Added test files: 2. 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 HistoryReview history (1 earlier review cycle)
Reviewed October 22, 2026, 4:19 AM ET / 08:19 UTC (Revision 2). |
e08c945 to
dcb1bb1
Compare
|
Both historical findings are addressed in
The coupled Gateway assertions now await completion receipts. Full CI 39741290601 is green on the current head. The PR body now includes the same-machine strict budget comparison and six inspected, synthetic before/after pairs; each PNG pair is byte-identical. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…9580) * refactor(ui): use native agent file read and save status * test(ui): correct agents file fixture types
Base:
63415c568253b60f94f17a3707cb6539f9161ede; current head:30eb823571ce48bba38900396174910d1cef567a. C/E/U/N = eligible candidate / named allowed exception / unresolved / native. This PR resolves only file-content reads and file Save/Overwrite: 19→17 eligible groups. Skills Reset keeps its existing native classification; other pending PRs receive no credit. Items 1, 2, 5–10 count eligible sites, with 24 existing owner/primitive exceptions retained. The five operation exceptions are unchanged.What Problem This Solves
Agents Files still used a manual error field and discarded save completion promises, leaving the renderer outside Solid’s async/action model. This change exposes the admitted owner’s read and outcome receipts to a narrow
Loading/Erroredstatus slot, and presents Save/Overwrite with an optimistic saving action. The textarea remains mounted and editable while writes settle.The page’s existing synchronous Skills Reset lifetime is now a small shared helper. Its four retirement sites are unchanged; Files captures that lifetime before admitting a write so navigation or reconnect can retire presentation while the plain owner still settles the write. Selected-file callbacks move into the existing file owner, preserving target and permission checks and shrinking the capped page-state file. Identity and Default remain unchanged.
The owner retains synchronous loading/saving admission facts, request generations, draft custody and conflict checks. Those are authority, not duplicate presentation state. No optimistic file bytes are invented: the operator’s editable draft is already visible. No
affects/refreshis added to a receipt observer: it cannot refetch, and the admitted owner publishes its accepted result directly.Evidence
pnpm tsgo:uifiles.test.ts, 28 casesfile-status.test.tsx, 3 casesagents-page.file-route-retirement.test.tsx, 1 case30eb823571c: 48 jobs succeeded, 24 skipped; all 16 UI jobs passed, including both real-Gateway shardsnode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.ui-pages.json --incrementalafter the repairThe route’s existing lazy boundary, host tags, selectors and CSS classes are preserved. There are no dependency changes. Touched production: 2,226→2,324 LOC (+98); tests/support: 3,403→3,730 LOC (+327). The page-state owner shrinks 998→957 lines. Growth provides the native status/action boundary and focused lifetime proof; no new rendering abstraction beyond the shared 11-line lifetime helper.
The final test-only correction adds missing fixture fields to its type and uses the supported anchored button-name selector. Production blobs are unchanged from the reviewed, behavior-tested candidate. The exact failed test typecheck and full replacement-head CI passed; unchanged focused behavioral proof is reused.
Startup remains below 325,000 B. All seven startup JavaScript assets have identical content after normalizing generated chunk URL hashes; no startup modules were added. Every increase stays below 64 B. The paired strict checker reports no violations or warnings, including locale budgets.
Builds use fixed metadata on the same machine. Full input and publication manifests independently qualify the copied distributions against the exact commits: 3,289 base / 3,290 head tracked inputs, the same 10 generated inputs, and 6,999 publication files per side. Only the six authored production build inputs differ. The screenshot-only Playwright runs use Node for the browser/photon helpers; normal focused Vitest proof uses the pinned default runtime.
The following 1440×1000 captures use only synthetic Garden helper data. Each pair is byte-identical; pending and failed reads, pending and failed saves, and conflict recovery retain the existing layout and editable draft.