Repository navigation
fix(ui): refresh agent identity after Gateway file saves - #168170
Conversation
Keep the idle identity cache while publishing committed identity-file changes to open Control UI tabs. Drain older file reads before publishing so event-driven refreshes cannot retain stale identity. Replace obsolete TTL test expectations with explicit invalidation.
Keep the oversized mutation suite shrinking by moving raw identity-save coverage to the existing local and remote file-storage fixture. Observe committed bytes at publication and preserve rejection controls.
|
🦞👀 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: needs maintainer review before merge. What this changesRefresh open Control UI names and avatars after committed Gateway saves to an agent’s IDENTITY.md file. Example: Save the main agent’s identity from Atlas/🦞 to Cedar/🌻 through a Gateway file RPC.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open: this PR supplies a useful identity-refresh notification missing from current main. No concrete introduced defect was found, and the previous draft blocker is resolved. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway file handlers commit workspace edits and publish a scoped invalidation that the existing Control UI identity owner consumes. flowchart LR
A[Gateway file RPC] --> B[Workspace write owner]
B --> C[Drain earlier identity read]
C --> D[Scoped identity event]
D --> E[UI identity owner]
E --> F[Chat and roster]
Technical reviewBest possible solution: Retain event-driven identity caching and notify its existing owner after committed Gateway identity-file saves. Do we have a high-confidence way to reproduce the issue? Current-main source retains successful identity reads indefinitely while both file-save handlers lack invalidation notifications; submitted baseline controls report the corresponding failure, but no target code was executed during this review. Is this the best way to solve the issue? The patch repairs the missing producer notification and preserves existing cache, stale-response, and idle-read suppression contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2d6f7a3052a0. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +41, Tests +174, Docs 0, Other +2. Total +217 across 15 files. Added test files: 0. 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 10, 2026, 12:16 AM ET / 04:16 UTC (Revision 2). |
|
The only CI failures on reviewed head
Independent Linux rig proof on unchanged main All other selected CI groups passed; no CI rerun or branch update was used. The exact-head identity proof remains green: 49 Gateway tests and five bundled browser cases, with the platform-conditional GNU-shell cases explicitly skipped. The original failing identity files passed three CI-topology repetitions (169 tests each), and the proof preserves one bootstrap read with zero added reads over ten virtual idle minutes. Independent and hosted reviews found no actionable defect. Landing under the authorized inherited-failure exception; these unrelated failures remain visible and are not claimed fixed by this PR. A later independent workflow also reported The native merge helper was stopped before creating any merge intent because its cleanup unconditionally issues a Git push deletion, which conflicts with this lane's push restriction. Its retained lock was recovered after verifying no child tools remained. The explicitly authorized REST squash fallback will pin the exact reviewed head above. |
…8170) Publish committed identity-file changes to open Control UI tabs through the existing identity cache owner. Preserve zero idle identity reads and stale-response ordering.
What Problem This Solves
Open Control UI tabs could retain an old name or avatar after
IDENTITY.mdwas saved through a Gateway file RPC. The connection-scoped identity cache introduced in #167968 had no notification for those writes.User Impact
Successful identity-file saves through
agents.files.setandsessions.files.setrefresh open chats, the roster, and forwarded avatars. Idle identity reads remain suppressed. Direct filesystem/shell edits still require reload or reconnect; native clients retain their existing catalog-loading behavior.Why This Change Was Made
The file RPCs publish
agent.identity.changedonly after a committed write. Session-file saves match the configured agent workspace's exact identity path, excluding unrelated project and nested files. Before publishing, the writer drains any older identity-file read so an immediate client refresh cannot join a stale in-flight result. The existing UI identity owner handles invalidation and stale-response rejection.The obsolete TTL assertions reported by CI are already corrected on the main base. This PR adds the missing production notification path and its boundary regressions. The file-write tests use the existing real-storage fixture; the oversized mutation suite shrinks.
Non-test LOC delta: +43, needed for the write/event contract and read ordering. No new polling loop, cache, config option, module, export, or schema change.
Evidence
37999811982, headf8239ea9470d13d70cd222d992b79582604db816, jobs114055137248and114055137269: four stale-TTL assertions. Blacksmith Testboxtbx_01m4hesfbrtm9b3xjfdqz8qn18reproduced all four (149 other tests passed, 4.89 s). The added identity-event browser case failed on the original consumer.cbx_8d08927d2d6d: 7,051 UI sibling tests across 495 files passed (three skips); 221 Gateway tests across 13 files passed (11 skips). The one-workerpnpm test <files> --maxWorkers=1batch passed in 26.63 s for Gateway files and 7.74 s for UI files.pnpm test src/gateway/server-methods/agents-files.test.ts src/gateway/server-methods/agents-mutate.test.ts --maxWorkers=1. Fourteen GNU-shell cases were conditionally skipped because the host uses uutils; no remote-shell coverage is claimed. The local-disk negative control fails on the original code and observes committed bytes when repaired.14189fde0588c58d37e3ab90be1593d5ed0f9821: clean through P2.Validation used synthetic browser data and isolated temporary state, with no production Gateway or live channel account. Before/after screenshots show Atlas/🦞 becoming Cedar/🌻 while preserving the unsent draft and session.
Final-head smoke: all five bundled-browser cases passed in 58.37 s. The original full type-check batch, final-head dead-export scan, targeted source/style/script lint, and remaining structural guards all passed.