FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(agent): enforce tenant Agent and text length limits by Junqilee · Pull Request #3701 · ModelEngine-Group/nexent · GitHub

feat(agent): enforce tenant Agent and text length limits - #3701

Open
Junqilee wants to merge 3 commits into
ModelEngine-Group:developfrom
Junqilee:codex/agent-resource-limits
Open

feat(agent): enforce tenant Agent and text length limits#3701
Junqilee wants to merge 3 commits into
ModelEngine-Group:developfrom
Junqilee:codex/agent-resource-limits

Conversation

Junqilee commented Aug 18, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Summary

  • Enforce a maximum of 1000 standard Agents per tenant.
  • Limit Agent name/display name to 30 Chinese characters or 60 ASCII characters.
  • Limit Agent descriptions to 500 Chinese characters or 1000 ASCII characters.
  • Limit Agent work descriptions to 5000 Chinese characters or 10000 ASCII characters.
  • Compress overlong generated descriptions before applying truncation fallback.
  • Localize Agent limit errors according to the user's language.
  • Improve frontend validation and error display.

Validation

  • Prompt service and text-width tests: 138 passed.
  • Agent API limit tests: 6 passed.
  • Prompt API and Agent database tests: 67 passed.
  • Frontend manual validation completed locally.
  • Backend Docker image rebuilt with MAX_AGENTS_PER_TENANT=1000.

Junqilee force-pushed the codex/agent-resource-limits branch from fc7ab7b to dbf8b0c Compare August 19, 2026 01:44
Junqilee marked this pull request as ready for review August 19, 2026 01:55

codecov Bot commented Aug 19, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.27586% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
backend/database/agent_db.py 96.29% 0 Missing and 1 partial ⚠️
backend/utils/text_length_utils.py 94.11% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Junqilee marked this pull request as draft August 19, 2026 01:57
Junqilee force-pushed the codex/agent-resource-limits branch from dbf8b0c to 4940ac1 Compare August 19, 2026 02:04
Junqilee marked this pull request as ready for review August 19, 2026 02:19
Comment thread backend/apps/agent_app.py Outdated
if not match:
return message

return f"租户智能体数量已达到上限:每个租户最多 {match.group(1)} 个智能体"

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

不应该硬编码中文提示,使用统一错误码,并在前端增加对应的国际化

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

已移除后端硬编码中文提示。租户 Agent 超限统一返回标准错误码 120104。

Comment thread backend/apps/prompt_app.py Outdated
):
if get_display_width(prompt_request.task_description) > MAX_AGENT_BUSINESS_DESCRIPTION_DISPLAY_WIDTH:
raise HTTPException(
status_code=HTTPStatus.BAD_REQUEST,

WMC001 Aug 19, 2026
edited
Loading

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

http错误码建议使用429

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

已将 Agent 工作描述超限的 HTTP 状态码从 400 调整为 429,并同步更新后端测试。

Junqilee requested a review from jeffwu-1999 as a code owner August 19, 2026 09:18
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL