Skip to content

✨ Feat: Allow setting agent as main agent via configuration#3461

Merged
Dallas98 merged 2 commits into
developfrom
xyq/feat_main_agent
Jul 20, 2026
Merged

✨ Feat: Allow setting agent as main agent via configuration#3461
Dallas98 merged 2 commits into
developfrom
xyq/feat_main_agent

Conversation

@xuyaqist

@xuyaqist xuyaqist commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

新增高级设置

image

默认为主智能体

image

Copilot AI review requested due to automatic review settings July 20, 2026 08:23
@xuyaqist
xuyaqist requested review from Dallas98 and WMC001 as code owners July 20, 2026 08:23

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.

Pull request overview

This PR introduces an is_main_agent flag for tenant agents, allowing the frontend to configure whether an agent is treated as a “main agent” (defaulting to true). It spans database schema, backend models/service logic, and frontend types/state/UI (including a new “Advanced Settings” modal).

Changes:

  • Add is_main_agent column to ag_tenant_agent_t with NOT NULL DEFAULT TRUE, plus baseline schema + migration.
  • Plumb is_main_agent through backend Pydantic models and agent create/export/import/update flows.
  • Update frontend typing, store defaults/dirty-checking, save payloads, and introduce an Advanced Settings modal with i18n strings.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/backend/database/test_agent_db.py Updates test fixture defaults to include is_main_agent = True.
frontend/types/agentConfig.ts Adds is_main_agent to agent types and update payload typing.
frontend/stores/agentConfigStore.ts Adds defaulting, mapping, and dirty-check logic for is_main_agent.
frontend/services/agentConfigService.ts Adds is_main_agent to update payload + response mapping default.
frontend/public/locales/zh/common.json Adds zh translations for “Advanced Settings” and “Main Agent” flag.
frontend/public/locales/en/common.json Adds en translations for “Advanced Settings” and “Main Agent” flag.
frontend/hooks/agent/useSaveGuard.ts Includes is_main_agent in save/update request payload.
frontend/app/[locale]/agents/components/AgentSelectorHeader.tsx Includes is_main_agent when copying/creating agents from detail.
frontend/app/[locale]/agents/components/agentManage/AgentList.tsx Includes is_main_agent when copying/creating agents from list.
frontend/app/[locale]/agents/components/agentInfo/AgentGenerateDetail.tsx Adds Advanced Settings modal UI and wires is_main_agent into the edit flow.
deploy/sql/migrations/v2.4.0_0720_add_agent_is_main_agent.sql Adds migration to introduce is_main_agent with default TRUE.
deploy/sql/init.sql Updates baseline schema to include is_main_agent + column comment.
backend/services/agent_service.py Includes is_main_agent in create/update/export/import agent payloads.
backend/database/db_models.py Adds ORM column is_main_agent with default True, non-nullable.
backend/database/agent_db.py Ensures is_main_agent defaults on create and is returned in create response.
backend/consts/model.py Adds is_main_agent to AgentInfoRequest and export/import model.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@xuyaqist xuyaqist changed the title Feat: Allow setting agent as main agent via configuration ✨ Feat: Allow setting agent as main agent via configuration Jul 20, 2026
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Dallas98
Dallas98 merged commit ca8cb2c into develop Jul 20, 2026
16 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