Repository navigation
Studio: keep messages from another window when deleting in a stale one - #16926
Conversation
[skip ci]
|
@codex review |
1 similar comment
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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: ab60951ab0
ℹ️ 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".
| # Repair research parents the prune deletes, walking the stored chain (dangling parent breaks import). | ||
| # Batch-written ids are excluded so an authorized reparent is not overwritten. | ||
| reseat_candidates = managed_ids - {str(m["id"]) for m in messages} | ||
| reseat_candidates = (managed_ids | unseen_ids) - {str(m["id"]) for m in messages} |
There was a problem hiding this comment.
Exclude pruned rows from the parent-reseat candidates
When prune_missing=True is used without explicit deletion IDs, unseen_ids contains the rows being deleted. Including those rows here makes _surviving_parent_id repeatedly traverse the same deleted prefixes of a parent-linked transcript, performing O(n²) SQL reads for rows that need no repair. In a local storage-only reproduction, pruning a 2,000-message chain to [] took approximately 8.6 seconds versus 0.04 seconds before this change. This work holds the BEGIN IMMEDIATE write lock, so other writes to the same database can exceed the default five-second timeout. Exclude pruned from the candidates so only retained messages are repaired.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in a392a16: rows the prune deletes are no longer reseat candidates, with a test that the walk is skipped.
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
With the same chat open in two windows, a turn sent in one window often never shows up in the other. That happens for turns with an image, audio or video, Connected provider turns, browser tool turns and Continue. Deleting any message in the window that never saw that turn then deleted it from the database too. If the other window reloaded or closed before its next full save, the question and its reply were gone everywhere, with no warning.
A delete now removes only the messages the user deleted. Deleting a question still removes its replies, including ones the deleting window never saw, the same as the client does. Other messages the deleting window did not know about are kept, and if one of them hung off a deleted message it is attached to the nearest message that is left. Saves that do not name what was deleted work as before.
A stale window bringing back messages that were deleted in another window is a separate, known issue and is not changed here.