All tickets
SUP-171
Empty agent edit advances its update timestamp
Description
Reported scenario
Invented customer report: Empty agent edit advances its update timestamp.
Reproduction / investigation setup
Capture timestamps then apply updateAgent with an empty patch and an advanced clock.
Observed static code evidence
Matching updates assign a new updatedAt even with an empty patch.
Simulated solution
Support solution: suppress empty edits at the caller. Explain that updatedAt records a matching update invocation, not detected field differences. Compare editable values before sending updates.
Simulated acceptance checks (not executed)
No-op caller sends no patch; actual updates preserve createdAt and advance updatedAt.
Activity
- Ticket created · 10/25/2026, 7:50:03 AM
- Anonymousinternal note10/25/2026, 8:13:32 AMRoot cause confirmed in code: `updateAgent` in `src/store/index.ts` unconditionally sets a new `updatedAt` on every call, even when the submitted patch is identical to the current agent data: ```ts updateAgent: (id, updates) => set((state) => ({ agents: state.agents.map((agent) => agent.id === id ? { ...agent, ...updates, updatedAt: new Date().toISOString() } : agent ) })), ``` The only caller, `src/pages/AgentCreator.tsx`'s `handleSubmit`, always invokes `updateAgent(id, data)` on form submit in edit mode without comparing old vs. new values, so no-op edits incorrectly advance the timestamp. `createdAt` is unaffected. Suggested fix: suppress no-op edits at the caller (AgentCreator.tsx) by comparing submitted form data against the current agent's editable fields before calling updateAgent; skip the call entirely if nothing changed. Actions taken: - Filed engineering ticket "Empty agent edit advances updatedAt timestamp" covering `src/store/index.ts` and `src/pages/AgentCreator.tsx`, with root cause, suggested fix, and acceptance criteria. - Drafted a user-facing KB article explaining the behavior and a workaround (avoid saving when no changes are made), pending publish. - Saved this investigation as a confirmed finding for future reference.