fix: always compare draft identity, gate auto-send until checked
Co-Authored-By: Ovis Fast (Claude) <[email protected]>
This commit is contained in:
1 parent
e7deca480a
commit
57761326fd
7 files changed
+161
-34
No files matched your search
@@ -211,6 +211,12 @@ export function saveDraft(store, agent, draft) {
|
||||
if (typeof agent !== "string" || agent === "") return;
|
||||
const clean = toDraft(draft);
|
||||
if (!clean) return;
|
||||
// A terminal whose start time could not be read must not wipe the start
|
||||
// time that is already on the disk: the next restart compares against it.
|
||||
if (clean.identity.created_ms === null) {
|
||||
const stored = toDraft(read(store, draftKey(agent)));
|
||||
if (stored && stored.identity.created_ms !== null) clean.identity = stored.identity;
|
||||
}
|
||||
write(store, draftKey(agent), clean);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user