feat(agents): support model priority sorting - #3914
Merged
Merged
Conversation
xuyaqist
commented
Sep 11, 2026
Contributor
- 支持多选模型时调整模型顺序
2. 在对话时,特别渲染agent名称
3. 令markdown不渲染删除线
Document the approved version-name label behavior and implementation plan.\n\nCo-authored-by: Codex <noreply@openai.com>\nGenerated-by: gpt-5-codex
Display each internal collaborative agent's saved version name beside its name.\n\nCo-authored-by: Codex <noreply@openai.com>\nGenerated-by: gpt-5-codex
Show version number and name when selecting an internal agent, while keeping related agent labels compact with the saved version number.\n\nCo-authored-by: Codex <noreply@openai.com>\nGenerated-by: gpt-5-codex
Skip version-detail requests while an agent switch is pending or no published version exists. This prevents stale agent state from requesting a nonexistent version.\n\nCo-authored-by: Codex <noreply@openai.com>\nGenerated-by: gpt-5-codex
Keep the active agent and URL synchronized by updating the route only after the selected agent data has been loaded into the store.\n\nCo-authored-by: Codex <noreply@openai.com>\nGenerated-by: gpt-5-codex
Set the selected agent URL before asynchronous loading so URL synchronization cannot reload the previous agent after initialization.\n\nCo-authored-by: Codex <noreply@openai.com>\nGenerated-by: gpt-5-codex
Use the URL as the sole selection source and load the selected agent only from its synchronization effect, preventing competing route and store updates.\n\nCo-authored-by: Codex <noreply@openai.com>\nGenerated-by: gpt-5-codex
Allow selected agent models to be reordered with drag and drop, keeping the first model and display names synchronized. Co-authored-by: Codex <noreply@openai.com> Generated-by: gpt-5-codex
Replace the fixed conversation subtitle with the selected agent's display name and cover the header behavior with a regression test. Co-authored-by: Codex <noreply@openai.com> Generated-by: gpt-5-codex
Keep selected model tags compact and expose priority sorting through an on-demand popover. Co-authored-by: Codex <noreply@openai.com> Generated-by: gpt-5-codex
Write reordered model IDs to the form store so Select tags render the updated priority. Co-authored-by: Codex <noreply@openai.com> Generated-by: gpt-5-codex
Render GFM delete nodes as plain text in newchat while retaining other GFM features. Add a focused regression test and implementation plan. Co-authored-by: Codex <noreply@openai.com> Generated-by: gpt-5
Resolve the agent prompt merge conflict while preserving model priority controls and available-model filtering. Co-authored-by: Codex <noreply@openai.com> Generated-by: gpt-5-codex
Use the filtered selection state for model priority controls after merging develop. Co-authored-by: Codex <noreply@openai.com> Generated-by: gpt-5-codex
xuyaqist
requested review from
Dallas98,
WMC001 and
jeffwu-1999
as code owners
September 11, 2026 11:59
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Four unresolved findings remain, including three moderate issues and one accessibility nit.
Pull request overview
Adds ordered model selection, agent-name subtitles in new-chat conversations, and plain-text Markdown strikethrough handling.
Changes:
- Added drag-and-drop model priority controls and translations.
- Displayed agent names in conversation headers.
- Updated Markdown rendering and added regression tests.
File summaries
| File | Reviewed changes | Findings |
|---|---|---|
frontend/tests/newchatThreadAgentBinding.test.ts |
Agent subtitle regression coverage | — |
frontend/tests/newchatMarkdownRendering.test.ts |
Markdown rendering regression coverage | — |
frontend/tests/modelPriority.test.ts |
Model priority tests | — |
frontend/public/locales/zh/common.json |
Chinese translations | — |
frontend/public/locales/en/common.json |
English translations | — |
frontend/package.json |
Drag-and-drop dependencies | — |
frontend/lib/agent/modelPriority.ts |
Reordering and selection helpers | — |
frontend/app/[locale]/newchat/ui/markdown-text.tsx |
Plain-text strikethrough rendering | moderate (1 vote): Apply the same del override to the streaming reasoning renderer. |
frontend/app/[locale]/newchat/assistant-ui/thread.tsx |
Agent-name subtitle | — |
frontend/app/[locale]/agents/components/agent-prompt.tsx |
Model priority drag-and-drop UI | moderate (1 vote): Guard no-op drops before persisting. moderate (1 vote): Include form-lock/read-only state in sortable controls and handlers. nit (1 vote): Give drag handles model-specific accessible names. |
docs/plans/2026-09-11-newchat-agent-name-subtitle-plan.md |
Implementation plan | — |
docs/plans/2026-09-11-newchat-agent-name-subtitle-design.md |
Agent subtitle design notes | — |
docs/plans/2026-09-11-disable-newchat-strikethrough-design.md |
Markdown design notes | — |
Review details
Suppressed comments (4)
frontend/app/[locale]/agents/components/agent-prompt.tsx:221
onDragEndalso fires when the item is dropped back onto itself. In that casereorderModelIdsreturns the same array, but this still callsupdateModelSelectionand enqueues a full agent update. Guard the no-op case before persisting so a click/no-op drag does not issue an unnecessary API request.
updateModelSelection(modelIds);
frontend/app/[locale]/agents/components/agent-prompt.tsx:191
- The parent
agent-configform is disabled whileuseAgentReadOnly()is true, and that state includes the NL2 form lock, but this new flag only checks role/speed. During a locked NL2 flow for an otherwise authorized user, the priority button and sortable items remain active, sohandleModelPriorityChangecan callupdateAgentand persist a reorder through the form lock. Include the form-lock/read-only state in the sortable control and handler guard.
const isModelSelectionDisabled = !canManage && !isSpeedMode;
frontend/app/[locale]/agents/components/agent-prompt.tsx:83
- All drag handles use the same accessible name, so a screen-reader or keyboard user cannot distinguish which model will be moved when the popover contains several items. Include the model's display name in the handle's accessible label (or otherwise expose it as part of the handle name).
className="flex cursor-grab touch-none text-muted-foreground disabled:cursor-default"
aria-label={reorderLabel}
frontend/app/[locale]/newchat/ui/markdown-text.tsx:696
- This override is only used by
defaultComponents; the newchat reasoning path still renders streaming Markdown through its separateReactMarkdowncomponent withremarkGfmand nodeloverride (ui/reasoning.tsx:200-267). While reasoning is streaming,~~text~~will therefore still render as a strikethrough and only change after streaming completes. Apply the samedelmapping to that renderer as well.
del: ({ children, ...props }) => <span {...props}>{children}</span>,
- Files reviewed: 10/10 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
YehongPan
approved these changes
Sep 15, 2026
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.