Skip to content

feat(agents): support model priority sorting - #3914

Merged
YehongPan merged 17 commits into
developfrom
xyq/bugfix_subagent
Sep 15, 2026
Merged

YehongPan merged 17 commits into
developfrom
xyq/bugfix_subagent

Conversation

@xuyaqist

Copy link
Copy Markdown
Contributor
  1. 支持多选模型时调整模型顺序
image 2. 在对话时,特别渲染agent名称 image 3. 令markdown不渲染删除线 image

xuyaqist and others added 16 commits September 10, 2026 10:18
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
Copilot AI lite review requested due to automatic review settings September 11, 2026 11:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

  • onDragEnd also fires when the item is dropped back onto itself. In that case reorderModelIds returns the same array, but this still calls updateModelSelection and 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-config form is disabled while useAgentReadOnly() 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, so handleModelPriorityChange can call updateAgent and 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 separate ReactMarkdown component with remarkGfm and no del override (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 same del mapping 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.

@xuyaqist xuyaqist changed the title Xyq/bugfix subagent feat(agents): support model priority sorting Sep 11, 2026
@YehongPan
YehongPan merged commit 16af6b9 into develop Sep 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants