-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[thread store] separate thread names and repair ownership #29352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
591b7a4
3735390
23e2fb0
14f07d7
985e595
2d7edbc
639ee6b
463f8fd
3445438
24d662c
2eada6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| ALTER TABLE threads ADD COLUMN name TEXT; | ||
| ALTER TABLE threads ADD COLUMN name_state TEXT NOT NULL DEFAULT 'legacy_unknown' | ||
| CHECK (name_state IN ('legacy_unknown', 'unnamed', 'cleared', 'explicit')); | ||
| ALTER TABLE threads ADD COLUMN title_snapshot TEXT NOT NULL DEFAULT ''; | ||
|
anaiskillian marked this conversation as resolved.
|
||
| ALTER TABLE threads ADD COLUMN title_state TEXT NOT NULL DEFAULT 'legacy_unknown' | ||
| CHECK (title_state IN ('legacy_unknown', 'derived')); | ||
|
|
||
| UPDATE threads | ||
| SET name = title, | ||
| name_state = 'explicit', | ||
| title_snapshot = title | ||
|
Comment on lines
+9
to
+11
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For pre-0040 rows whose AGENTS.md reference: AGENTS.md:L103-L111 Useful? React with 👍 / 👎. |
||
| WHERE title <> '' | ||
| AND (first_user_message = '' OR trim(title) <> trim(first_user_message)); | ||
|
|
||
| UPDATE threads | ||
| SET title_snapshot = title | ||
| WHERE name_state = 'legacy_unknown'; | ||
|
|
||
| CREATE TRIGGER threads_title_snapshot_after_insert | ||
| AFTER INSERT ON threads | ||
| WHEN NEW.title_snapshot = '' | ||
| AND NEW.title <> '' | ||
| AND NEW.title_state = 'legacy_unknown' | ||
| BEGIN | ||
| UPDATE threads | ||
| SET title_snapshot = NEW.title | ||
| WHERE id = NEW.id; | ||
|
Comment on lines
+25
to
+27
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an older Codex binary inserts a thread after this migration, it does not know about AGENTS.md reference: AGENTS.md:L103-L111 Useful? React with 👍 / 👎. |
||
| END; | ||
Uh oh!
There was an error while loading. Please reload this page.