Fix goal-first live threads missing from thread/list#28808
Merged
Conversation
jif-oai
approved these changes
Jun 18, 2026
| if self.thread_manager.get_thread(thread_id).await.is_ok() | ||
| && let Err(err) = self | ||
| .thread_store | ||
| .append_items(AppendThreadItemsParams { |
Collaborator
There was a problem hiding this comment.
Can we persist this through the live session’s metadata-aware path? Raw ThreadStore::append_items skips ThreadMetadataSync, so state-DB-only op such as list/search still miss this thread
Collaborator
Author
There was a problem hiding this comment.
Good catch. I was trying to avoid exporting a new function from ThreadStore, but it looks like that may be necessary here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #28263.
Why
When a thread starts with
/goal, the goal extension can update SQLite goal state before the thread has any user-turn rollout items.thread/listandthread/searchrely on persisted listing metadata, so a goal-first live thread could be absent from app-server listings after restart even though the goal itself existed.This regressed when goal handling moved out of core: the core path wrote the goal update through the live thread rollout path, while the extension-backed app-server path only updated goal state and emitted the live notification.
What
GoalSetOutcome::thread_goal_updated_item()so the goal extension owns the canonicalThreadGoalUpdatedrollout item shape.CodexThread::append_rollout_items()helper that appends through the live thread and keeps derived SQLite metadata in sync.thread/goal/setand verifies it appears in state-DB-onlythread/list.Verification
env -u CODEX_SQLITE_HOME just test -p codex-app-server goal_first_live_thread_appears_in_state_db_thread_list