[codex] fix AgentGUI cold-start conversation rail race#1267
Open
chovy-ai wants to merge 3 commits into
Open
Conversation
chovy-ai
marked this pull request as ready for review
July 17, 2026 03:10
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fix AgentGUI project conversation history appearing empty after a cold desktop startup until the user switches Agent filters.
User impact
The conversation database and daemon response were intact, but the initial AgentGUI rail could show only the active project conversation and an empty second project. Switching Agent filters caused a full section request and made the missing history appear, which made the startup race look like data loss.
Root cause
Two startup state flows were allowed to compete:
listSessionSectionsrequest that establishes the rail topology (workspace,team-shell, andconversations).The targeted refresh reused the controller's paging sequence. It invalidated the still-pending full response, then applied only its changed page (in the reproduced case,
conversations) to a controller whose full section topology had not been established. Project section templates remained visible, but their canonical memberships were absent, so the UI showed the active overlay in one project and no history in the other.Switching Agent filters created a new scope and issued another full section request, which is why the history appeared after interaction.
The branch also removes implicit Agent-target fallback behavior and keeps the All scope keyed only by values actually sent in the backend request. Asynchronously hydrated
userProjectstherefore cannot create a second equivalent query scope.Fix
Regression coverage
The new controller test reproduces the race by:
conversationsrefresh;Validation
pnpm check:full: 18 tasks passed, including TypeScript tests, Go tests, and lint checks.DEV_GUI_TUTTI_ENV=production make dev-gui.workspaceandteam-shellhistories were immediately visible.