Skip to content

✨ Feat: support user to configurate model concurrency limit and timeout seconds#2943

Open
xuyaqist wants to merge 42 commits into
developfrom
xyq/feat_add_model_timeout
Open

✨ Feat: support user to configurate model concurrency limit and timeout seconds#2943
xuyaqist wants to merge 42 commits into
developfrom
xyq/feat_add_model_timeout

Conversation

@xuyaqist
Copy link
Copy Markdown
Contributor

@xuyaqist xuyaqist commented May 8, 2026

  1. 在编辑模型时支持配置超时时间和并发限制
    (1)批量编辑
image (2)单模型编辑 image
  1. 在新增模型时支持配置超时时间和并发限制
image

3. 当用户配置了并发限制之后,在生成智能体的时候,会根据并发限制分批次地去调用模型生成智能体信息

  1. generate_title,默认设置为非流式接口调用
  2. 处理昊天知识库无法正常调用接口的问题,当公共知识库id为空时,设置默认的知识库id
  3. send_email mcp工具:区分sender_email和sender name,适配内部邮件系统
  4. 跳过证书验证
  5. 模型健康检测,如果设置ssl_verify为true调不通,设置为false进行测试,并且修改数据库ssl_verify字段为false
  6. 当agent_name或者display_name不为空时,在生成智能体时不应该覆盖agent_name和agent display_name。

Copilot AI review requested due to automatic review settings May 8, 2026 01:29
@xuyaqist xuyaqist requested review from Dallas98 and WMC001 as code owners May 8, 2026 01:29
@xuyaqist xuyaqist changed the title Xyq/feat add model timeout Feat: support user to configurate model concurrency limit and timeout seconds May 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds per-model request timeout and concurrency limit configuration across the frontend, backend persistence, and SDK model wrappers, and uses the configured concurrency limit to throttle concurrent LLM calls during system-prompt generation.

Changes:

  • Add timeout_seconds / concurrency_limit fields to model config types, API payloads, and DB schema.
  • Expose timeout/concurrency controls in model add/edit dialogs and propagate them through modelService.
  • Apply timeout during connectivity checks and throttle concurrent prompt-generation threads based on the model’s concurrency limit.

Reviewed changes

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

Show a summary per file
File Description
sdk/nexent/core/models/openai_llm.py Adds timeout + concurrency parameters to OpenAIModel and uses them in connectivity checks.
sdk/nexent/core/agents/nexent_agent.py Passes timeout into OpenAIModel when instantiating agent models.
sdk/nexent/core/agents/agent_model.py Extends ModelConfig schema with timeout and concurrency fields.
frontend/types/modelConfig.ts Adds timeoutSeconds / concurrencyLimit to the frontend model option type.
frontend/services/modelService.ts Maps timeout/concurrency fields between API snake_case and UI camelCase for create/update flows.
frontend/public/locales/zh/common.json Adds i18n strings for timeout and concurrency fields (ZH).
frontend/public/locales/en/common.json Adds i18n strings for timeout and concurrency fields (EN).
frontend/app/[locale]/models/components/model/ModelEditDialog.tsx Adds timeout/concurrency inputs and extends provider config dialog to edit them.
frontend/app/[locale]/models/components/model/ModelDeleteDialog.tsx Uses the shared provider config dialog for per-model settings and batch settings.
frontend/app/[locale]/models/components/model/ModelAddDialog.tsx Adds timeout/concurrency inputs and per-model settings via shared dialog.
docker/sql/v2.1.1_0507_add_concurrency_and_timeout_to_model_record_t.sql Adds DB columns for timeout_seconds and concurrency_limit.
backend/utils/llm_utils.py Passes timeout from model config into OpenAIModel for system prompt calls.
backend/services/prompt_service.py Fetches concurrency_limit and uses a semaphore to throttle concurrent LLM calls during prompt generation.
backend/services/model_provider_service.py Defaults timeout for LLM provider models and merges existing attributes (incl. timeout/concurrency).
backend/services/model_management_service.py Adds update-by-id-or-name logic for batch updates and adjusts ssl_verify auto-setting.
backend/services/model_health_service.py Passes timeout into connectivity checks and adds an ssl_verify fallback behavior.
backend/services/file_management_service.py Passes timeout into OpenAILongContextModel construction.
backend/services/conversation_management_service.py Passes timeout into OpenAIModel for title generation.
backend/database/model_management_db.py Adds update_model_record_by_model_name helper for batch updates.
backend/database/db_models.py Adds ORM columns for timeout_seconds and concurrency_limit.
backend/consts/model.py Extends request schemas with timeout/concurrency for create/update/manage flows.
backend/agents/create_agent_info.py Propagates timeout into agent ModelConfig generation.

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

Comment thread frontend/app/[locale]/models/components/model/ModelDeleteDialog.tsx Outdated
Comment thread backend/database/model_management_db.py Outdated
Comment thread backend/agents/create_agent_info.py Outdated
Comment thread backend/agents/create_agent_info.py Outdated
Comment thread sdk/nexent/core/models/openai_llm.py Outdated
Comment thread frontend/app/[locale]/models/components/model/ModelAddDialog.tsx Outdated
Comment on lines +304 to +307
if model_id_or_name and model_id_or_name.isdigit():
# Use model_id (primary key) for update
logging.info(f"[DEBUG] Updating model by id: model_id={model_id_or_name}, tenant_id={tenant_id}, update_data={update_data}")
update_model_record(int(model_id_or_name), update_data, user_id, tenant_id)
Comment thread backend/database/model_management_db.py Outdated
Comment thread backend/services/model_health_service.py
Comment thread sdk/nexent/core/agents/nexent_agent.py
@xuyaqist xuyaqist changed the title Feat: support user to configurate model concurrency limit and timeout seconds ✨ Feat: support user to configurate model concurrency limit and timeout seconds May 8, 2026
@xuyaqist xuyaqist force-pushed the xyq/feat_add_model_timeout branch 2 times, most recently from 0a433db to 0eb02b0 Compare May 15, 2026 11:08
@xuyaqist xuyaqist force-pushed the xyq/feat_add_model_timeout branch from 5e70bf9 to c33b368 Compare May 18, 2026 09:44
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.

2 participants