📌 fix: Preserve Ephemeral Agent Selections on Optimistic Hydration - #13433
Conversation
|
@codex review |
There was a problem hiding this comment.
Pull request overview
Fixes an edge case in the client’s ephemeral-agent state hydration: when optimistic new-chat hydration updates the submission to a persisted conversation ID before the agent template is applied, useApplyNewAgentTemplate no longer drops an explicitly provided ephemeralAgent due to a same-ID short-circuit.
Changes:
- Adjusted the same-source/target guard in
useApplyNewAgentTemplateto only short-circuit when no explicitephemeralAgentStateis provided. - Added a regression test ensuring explicit ephemeral agent selections (including MCP + tool flags) are preserved even when source and target conversation IDs match.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| client/src/store/agents.ts | Updates same-ID short-circuit to still apply explicitly provided ephemeral agent state. |
| client/src/store/tests/agents.spec.tsx | Adds regression test covering same-ID optimistic hydration with explicit ephemeral agent state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ 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". |
GitNexus: 🚀 deployedThe |
Summary
I fixed the new-chat optimistic update path so explicit ephemeral agent selections survive when a generated conversation receives its persisted conversation ID.
ephemeralAgentwhenuseApplyNewAgentTemplateis asked to apply state to the same conversation ID after optimistic hydration.Root cause: resumable SSE optimistic hydration updates the submission to the persisted conversation ID before
created/finalapplies the ephemeral agent template. That madesourceIdandtargetIdmatch, so the helper skipped writing the request-timeephemeralAgentinto the saved conversation state.Change Type
Testing
git diff --checkTest Configuration:
/Users/danny/.codex/worktrees/99d4/LibreChatChecklist