Repository navigation
fix(ui): preserve agent file edits during save - #105359
Conversation
|
Land-ready proof for exact head
Known proof gaps: none for the changed Agent Files state controller. No screenshots or transcript artifacts uploaded. |
|
Codex review: needs maintainer review before merge. Reviewed July 12, 2026, 8:26 AM ET / 12:26 UTC. Summary PR surface: Source +4, Tests +39. Total +43 across 2 files. Reproducibility: yes. The linked issue provides two current-main Playwright reproductions against a real isolated Gateway, and the source path independently shows the unconditional overwrite. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Refresh the branch onto current main, confirm the exact merged head retains the conditional draft-settlement tests and real Gateway behavior, then land it so the linked issue closes with the fix. Do we have a high-confidence way to reproduce the issue? Yes. The linked issue provides two current-main Playwright reproductions against a real isolated Gateway, and the source path independently shows the unconditional overwrite. Is this the best way to solve the issue? Yes. The patch mirrors the existing load-time dirty-draft preservation invariant, relies on the Gateway's exact submitted-content contract, and fixes the race without introducing a competing state path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b1fcd7c1782d. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +4, Tests +39. Total +43 across 2 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (1 earlier review cycle)
|
|
Merged via squash.
|
* fix(ui): preserve agent file edits during save * chore: defer agent file note to release
What Problem This Solves
The Agents > Files editor silently discarded text entered while an earlier save was in flight. The textarea remained writable, but the successful
agents.files.setresponse replaced the newer draft with the older submitted content.Fixes #105354.
Why This Change Was Made
Treat the save response as a new persisted base without assuming the draft is still unchanged. The draft synchronizes to the saved content only when it still matches the submitted text; a later edit remains visible and dirty.
User Impact
Users can keep editing agent notes, identity, persona, and tool-guidance files while Save is pending without losing the newer text. Ordinary saves still mark an unchanged submitted draft as current.
Evidence
agents.files.setwrites and returns the exact submitted content.No screenshots or transcript artifacts uploaded.