feat(model): optimize model type labels and max token input#3116
Closed
Dallas98 wants to merge 40 commits into
Closed
feat(model): optimize model type labels and max token input#3116Dallas98 wants to merge 40 commits into
Dallas98 wants to merge 40 commits into
Conversation
Dallas98
commented
May 30, 2026
Member
- Rename VLM display labels to image understanding/generation/video understanding
- Remove default max token values from model access forms
- Add required max token manual input with common quick-select options
- Reuse max token selector across add/edit/provider config flows
- Stop falling back to 4096 when max tokens are not explicitly provided
Fix external collaboration agent saving and related bugs
* feat: add section-level prompt optimization for generated agent details * feat: add section-level prompt optimization for generated agent details * feat: add section-level prompt optimization for generated agent details * feat: add section-level prompt optimization for generated agent details
…resql (#3002) * Bugfix: Auto-clean account when exists in Supabase but not in postgresql database * Bugfix: Remove type field from A2A v1.0 as it should not exist * 修复文档图片大小 * Bugfix: Prevent session expiration while user is active * 修改测试用例 * 修改测试用例 * Bugfix: Immediately show login page on 401 response
…3011) * ✨ Add workflow and script for building offline deployment package
* feat: add prompt template management for agent generation * feat: add prompt template management for agent generation * feat: add prompt template management for agent generation * feat: add prompt template management for agent generation * feat: add prompt template management for agent generation * feat: add prompt template management for agent generation * feat: add prompt template management for agent generation * feat: add prompt template management for agent generation * feat: add prompt template management for agent generation * feat: add prompt template management for agent generation * feat: add prompt template management for agent generation
…rs (#2969) * ✨ Feat: Update monitoring configuration to use OpenTelemetry OTLP protocol and enhance observability features * Refine OpenTelemetry monitoring and multi-platform config * Add local Phoenix and Langfuse monitoring deployment support * ✨ Feat: Enhance monitoring capabilities with FastAPI instrumentation and OpenTelemetry integration * ✨ Feat: Add Grafana and Tempo support for enhanced monitoring capabilities * ✨ Feat: Update monitoring configurations with specific versioning for Grafana, Tempo, Phoenix, Langfuse, and Redis * ✨ Feat: Refactor monitoring configuration to use environment variables for Grafana, Phoenix, and Langfuse ports; remove deprecated Jaeger support * ✨ Feat: Expand OpenTelemetry design documentation to include observability principles, usage of OpenTelemetry, and detailed signal definitions * ✨ Feat: Add support for Apache SkyWalking as a monitoring provider, including configuration and documentation updates * 支持zipkin查看 * ✨ Feat: Add support for LangSmith as a monitoring provider, including configuration updates and documentation enhancements * clean code * clean code * ✨ Feat: Add OpenTelemetry monitoring stack with configurable providers and settings * Normalize monitoring env variables * ✨ Feat: Add OpenTelemetry monitoring stack with configurable providers and settings * 支持白名单黑名单配置 * 补充 * 优化代码实现 * 优化代码实现 * Enhance monitoring trace payload summaries * fix test * clean code * Enhance monitoring configuration by adding LangSmith API key, project, and OTLP traces endpoint * Add monitoring configuration options for trace content and limits * Remove deprecated fastapi flag and normalize trace payloads * 清楚langfuse适配字段 * Update service configurations to support NodePort for Grafana, Langfuse, Phoenix, and Zipkin * 网络配置优化 --------- Co-authored-by: hhhhsc <name>
…ut seconds (#2943) * 解决冲突 * 修改sql脚本名称 * Bugfix: ssl_verify causing different result in check embedding model connection * Feat: support user to configurate model concurrency limit * 修改sql脚本名称 * 优化名称/变量名称重复提示 * Bugfix: when creating an embedding modal, embedding_dimension_check lack fallback casuing dimension=0 * Bugfix: fix the published agent version need at least one tool * Bugfix: unify agent unavaliable reason * Bugfix: use STARTTLS (TLS upgrade) when using port 587 to send email * 新增haotian知识库路由 * 修复前端 * 为nexent-config挂载证书,令容器内的 Python 应用使用宿主机的 CA 证书来验证外部 SMTP 服务器的 SSL 证书 * 修复模型健康检查报错 * 区分send email针对是否跳过证书校验的逻辑 * 区分sender_email和和sender_name * 修复无法获取昊天知识库列表的问题 * Create a session with trust_env=False to ignore proxy environment variables * 设置generate_title为非流式接口 * Revert "设置generate_title为非流式接口" This reverts commit d1cffeb. * "设置generate_title为非流式接口" * 设置authorization字段也为密码展示 * 如果是公共知识库,设置默认id * 新增并发数量的限制 * Bugfix: Resolve frontend cache issue when only one model is available * 修复循环依赖的问题 * Bugfix: Prevent overwriting of agent name and variable name when generating agent info * Bugfix: Immediately show login page on 401 response * Revert "Bugfix: Immediately show login page on 401 response" This reverts commit 9b59e72. * Bugfix: Remove invalid concurrency_limit related code from OpenAIModel * 优化代码,修复单元测试 * 修改单元测试 * 修改单元测试 * 修改单元测试 * 修改单元测试 * 修改单元测试 * 修改单元测试 * 修改单元测试 * 删除使用宿主机的证书 * 修改sql * 修改UT * 修改默认昊天公共知识库Id * 修改单元测试 * 删除单元测试 * 使用DefaultHttpxClient而非httpx.client * 删除不存在的函数 * 修改单元测试 * 修改单元测试
* 添加MCP管理界面,支持添加、删除、修改、启用、停止、查看MCP服务,支持用户自行添加和公共市场快速添加,目前公共市场快速添加只支持链接形式的MCP服务; 添加公共市场的浏览和搜索。 * 重构代码以符合项目规范,前端样式修改 * feat: Enhance MCP Tools functionality and UI - Added new service enabling and disabling messages in English and Chinese localization files. - Updated API endpoints for enabling and disabling MCP tools. - Introduced new container service addition functionality in the MCP tools service. - Refactored mcpToolsService to handle container services and improve error handling. - Updated types for MCP tools to reflect new transport types and service details. - Created a new SQL migration script to extend the mcp_record_t table for additional MCP tool attributes. - Implemented a custom hook for managing MCP tools page state and interactions. 功能亮点:增强 MCP 工具的功能与用户界面 - 在英文和中文本地化文件中添加了启用和禁用服务的提示信息。 - 更新了用于启用和禁用 MCP 工具的 API 接口。 - 在 MCP 工具服务中引入了新增容器服务的功能。 - 重构了 mcpToolsService 以处理容器服务并改进错误处理机制。 - 更新了 MCP 工具的类型,以反映新的传输类型和服务详情。 - 创建了新的 SQL 迁移脚本,用于扩展 mcp_record_t 表以支持 MCP 工具的额外属性。 - 实现了自定义钩子,用于管理 MCP 工具页面的状态和交互。 * Rewrite the code to rename “market” to ‘registry’ Remove the “market_name” field from the mcp_record_t SQL extension and correct the spelling error in the source code 重构代码,将market命名转为registry 移除mcp_record_t扩展sql的market_name,修正拼写错误souce * Add a community marketplace feature where users can upload their own MCPs to the community marketplace for other users to browse and discover. 添加社区市场功能,用户可以上传自己的MCP到社区市场供其它用户浏览发现。 * Support for displaying and filling in variables and request headers during quick addition in MCP Registry; Removal of the old MCP Tools interface and uniform migration to the new interface; Caching of the search bar in external marketplaces; Update to the logic of the tool list on the Agent page, synchronized with the MCP Tools page 外部市场支持快速添加时的变量和请求头显示和填写; 去除mcp tools的旧接口,统一改为新接口; 外部市场搜索栏缓冲; 智能体页面工具列表逻辑更新,和mcp tools页面同步更新 * Add source and transport type method filters 增加来源和传输方式筛选 * /container/add: The App layer has been changed from “handling business logic” to “only making calls and mapping exceptions.” Aggregation of props for frontend detail pop-ups. New MCP domain exceptions have been added; the service layer throws MCP exceptions, and the App layer uniformly maps them to HTTP status codes. /container/add 由 App 层“做业务”改为“只做调用+异常映射”。 前端详情弹窗 props 聚合。 新增 MCP 领域异常,service 层抛出MCP异常,app 层统一映射 HTTP 状态。 * Store tags as an array and add the ability to filter MCPs by tag. 将tags改为数组形式存储,新增用tag筛选mcp。 * Add restrictions on request headers; only Bearer tokens in the Authorization header are allowed.增加请求头填写限制,只允许Authorization的Bearer Token填写 * Supports displaying descriptions in Markdown format, supports expanding and collapsing descriptions, and supports descriptions of unlimited length. 支持描述markdown形式展示,支持描述展开和收起,支持无限长的描述。 * Add pagination to the community marketplace; add display of shipping methods and tags; add filtering by shipping methods and tags. 社区市场添加分页,添加传输方式和tag显示,添加传输方式和tag筛选. * Optimized the display of installation package variables on the remote market details page; Added a hyperlink entry point to the Modelscope MCP Plaza. 优化外部市场详情界面安装包变量显示; 新增魔搭mcp广场超链接入口。 * Fine-tune description style 微调描述样式 * Added container service port conflict verification and recommended port features; When quickly adding a container from the external market, a port needs to be filled in; Refactored the code of mcp_management_app and service, moving a large amount of data validation handling to the app, using Pydantic for validation, simplifying the code. 添加了容器服务端口冲突校验和推荐端口功能; 外部市场快速添加容器需要填写端口; 重构了mcp_managemeny_app和service的代码,讲大量数据检验处理移动到app中,利用Pydantic校验,简化代码。 * Data validation for the mcptools frontend form; Fix the front-end and back-end integration errors of My Posts and Community Market; Fix the display of description editing in My Posts editing and Community Market. mcptools前端表单进行数据校验; 修复我的发布和社区市场前后端对接错误; 修复我的发布编辑和社区市场的描述编辑显示。 * 禁止oci形式mcp添加 * Add MCP.so hyperlink 添加MCP.so超链接 * Optimized the frontend's handling of OCI unsupported display. Slightly optimized the backend code for OCI unsupported cases. 优化前端对oci的不支持显示。 稍微优化了后端对oci不支持的代码。 * Remove duplicate code 去除重复代码 * Optimization Recommended ports are now random Fixed container name duplication issue Abstracted front-end code port handling to reduce duplicate code Added a prompt for failed addition of services with duplicate names Loading state between each MCP card is independent and does not interfere 优化 推荐端口现在改为随机 容器重名问题修复 前端代码端口处理问题抽象,减少重复代码 增加对重复命名服务添加失败的提示 每个mcp卡片之间加载状态独立不干扰 * Fixed the issue of accompanying registry_json errors when adding to the community market, and optimized redundant code 修复社区市场添加时附带registry_json错误的问题,并优化冗余代码 * Readjust, change stdio to a container 重新调整,把stdio改成容器 * Mini Fix 小修复 * ♻️ Refactor: Refactor the remote_mcp and mcp_management services, and adapt the Agent development page to the mcp service. * 尝试优化前端代码架构,进行初步重构,优化了Props传递和hooks设计不合理的一部分问题; 删除mcp描述的markdown展示; 删除不必要的工具列表Model,改用统一Model Component。 * 二次重构,继续优化 * 前端代码样式重构,优化标题样式,去除所有圆角,修改主界面布局,去除我的发布,改为主界面导入的服务和发布的服务切换,优化搜索栏和筛选栏样式,优化卡片列表支持动态布局,优化详情弹窗显示,优化查看server.json和容器配置弹窗样式,修改标签样式,增加发布到社区的确认和修改弹窗,去除连通性校验弹窗,优化添加弹窗显示避免大小抖动,去除common.json中部分过时字段 后端去除last_sync_time字段和少量冗余代码 * 优化状态显示组件,移动端口组件 * 修复端口冲突显示bug 调整部分Types和const的代码写法 * 修改容器配置和server.json弹窗样式 修复小bug * 修复更新合并带来的部分冲突,如/list和delete 由于接口变化,修改tag筛选为前端筛选 * ♻️ Refactor: Refactor the remote_mcp and mcp_management services, and adapt the Agent development page to the mcp service. [Specification Details] 1. Modify healthcheck method. * 修改部分post接口为get * 修复输入了authorization_token但是list却不传authorization_token的问题. 修复删除Mcp不删除对应容器的问题 修复前端点击启用关闭不刷新的问题,并添加刷新工具中信息提示。 * 简化部分组件传递信息代码 * 修复我的发布详情界面滚动条问题 * 修复社区市场tag筛选项是按租户显示的问题; 社区市场传输类型筛选改为后端实现; 去除原来的http和sse,统一改为url; 修复部分代码不必要的null和可选性问题; 修复部分翻译键问题; 修复添加容器化服务的部分前端逻辑代码错误。 * 修复社区市场弹窗层级问题 * 修改发布代码逻辑 支持发布时修改config_json和url 删除healthcheck详细显示 * 整体页面色调改为绿色 * 修改主界面切换页签样式 修改主界面布局 * 修改卡片样式设计 * 改进添加和详情弹窗,缩小宽度,添加动态过渡 * 小修复 * 给发布的服务提供筛选栏 tag筛选改为前端筛选,删除相关代码 * 调整容器启用关闭以兼容k8s部署,现在会删除停止的容器,启用时重新拉取 * 修复详情界面切换服务状态信息显示不更新问题 * 修复页签字体不居中,筛选栏字体大小问题 * 前端代码组件分类 * 修复弹窗问题 * 改名 * 修复i18n缺失bug * 删除部分未使用文本 * 小修复 * 添加测试文件 * 修改sql * 更新文档 * ♻️ Refactor: Front-end style adjustment. * ♻️ Refactor: Front-end style adjustment & test cases addition. * ♻️ Refactor: Front-end style adjustment & test cases addition. [Specification Details] Fix frontend build. * ♻️ Refactor: Revert to the container naming rules for launching containers in Docker and Kubernetes clients. [Specification Details] Modify the name of the update SQL statement and synchronize the Kubernetes init.sql file. * ♻️ Refactor: Revert to the container naming rules for launching containers in Docker and Kubernetes clients. [Specification Details] 1. Fix test cases. * ♻️ Refactor: Add UUID when creating the container. [Specification Details] 1. Fix test cases. * 修复描述为空导致的搜索栏bug 修复社区市场不必要的来源显示 * 🐛 Bugfix: Fix the issue of missing fields in init.sql. * 🐛 Bugfix: ModelAddDialog.tsx rollback --------- Co-authored-by: panyehong <2655992392@qq.com> Co-authored-by: panyehong <91180085+YehongPan@users.noreply.github.com>
…erface (#3025) * ♻️ Performance optimization of the knowledge base file list query interface * ♻️ Performance optimization of the knowledge base file list query interface: ut
* ✨ Support skill params config * ✨ Add frontend official skill install wizard, which could be triggered by tenant creation or admin management ♻️ Remove terminal skill installation in deploy.sh ✨ Users can now manage skills in tenant resource page * ♻️ Remove terminal skill installation in deploy.sh ♻️ Change default skill install directory to $ROOT_DIR/nexent-data * ✨ Supports tenant-level separation of skills 🐛 Bugfix: code retrieved from knowledge base would falsely be executed * ♻️ Now constraint and few shot tab would remain empty when generating agent prompt ♻️ Add backend support to skill-tenant management and official skill installation * ✨ Agent export/import now includes skills * 🐛 Bugfix: frontend syntax error * 🐛 Bugfix: frontend syntax error 🧪 Add unit tests * ♻️ Refactor: remove redundant code 🧪 Add unit tests * 🐛 Bugfix: frontend syntax error * 🧪 Fix test files * 🐛 Bugfix: frontend syntax error * 🐛 Bugfix: frontend syntax error * 🧪 Fix test files * 🐛 Bugfix: SU skill resource management with wrong scope * 🐛 Bugfix: SU skill resource management with wrong scope
[Specification Detail] 1. Fixed the issue where the model list could not be retrieved when adding models in batches on the ME platform. 2. When adding a single model, check /open/router to modify model_factory.
* import tts model * add test files * add test files * add test files * add test files * 🔧 Chore: Update Docker pipeline configurations to tag and push latest images for main branch on push events --------- Co-authored-by: Dallas98 <990259227@qq.com>
* 🐛 Bugfix: Cannot generate agent prompt * ♻️ ag_skill_info_t SQL fixup
#3020) * 修改单元测试 * Revert "修改单元测试" This reverts commit d0aad14. * Optimize agent page layout * Refactor agent generate page * 对于agent的currentAgentPermission状态进行统一处理,暴露isReadOnly * 修复智能体生成页面,所有字段既由form item的name控制,又由streamValues控制 * 更新i18n * 更新单元测试 * 更新api/agent/search_info返回的结果,新增skills,统一tools和skills * 修复单元测试 * 解决冲突 * 修复web编译失败问题 * 处理在创建模式下智能体生成后无法保存的问题 * 删除注释 * 优化代码 * 修复前端编译失败 * 更新单元测试 * 更新单元测试 * Revert "更新单元测试" This reverts commit d5b7879. * Reapply "更新单元测试" This reverts commit 35f0821.
* 部署脚本优化 * 部署脚本优化 * 部署脚本优化 * Remove namespace template from Helm common chart * Update commit message generation instructions * Refine prompt-writing instructions * Reuse Supabase secrets and harden suadmin provisioning * Add back navigation to deployment TUI * Make K8s local data deletion optional * Update deployment docs for optional application selection --------- Co-authored-by: hhhhsc <name>
…g tools (#3001) * 视觉语言模型分类 以及添加音频理解工具 * 补充test测试 * Chore: Update .dockerignore to remove unnecessary backend assets * Feat: add optional id field to SingleModelConfig interface --------- Co-authored-by: Dallas98 <990259227@qq.com>
…2720) * ✨add_image_retrieval * ✨add_image_retrieval * ✨add_image_retrieval * ✨add_image_retrieval * ✨add_image_retrieval * ✨add_image_retrieval * ✨add_image_retrieval * ✨add_image_retrieval * ✨add_image_retrieval * ✨add_image_retrieval * add_image_retrieval * add_image_retrieval * add_image_retrieval * add_image_retrieval * add_image_retrieval * modify unit test file * modify unit test file * modify fix the bug * modify test file * modify test files * cancel downloading models and modifying test files * modify the image configuration file * resolve conflict * modify test files * modify test file * improve test coverage * remove unnecessary input parameter * modify test file * modify test files * modify test file * modify test file * modify test files * modify test file
* feat: support multi-turn compare sessions * feat: support multi-turn compare sessions
…es. (#3036) * ♻️ Improvement: Supports adding custom headers when adding MCP services. [Specification Details] 1. When creating an MCP service, custom headers can be passed in when calling the tool and agent. 2. Add test cases. * ♻️ Improvement: Supports adding custom headers when adding MCP services. [Specification Details] 1. Fix the front-end pipeline and test case pipeline
* 🐛 Fix markdown code block display error * 🐛 Fix markdown code block display error
* 视觉语言模型分类 以及添加音频理解工具 * 补充test测试 * Chore: Update .dockerignore to remove unnecessary backend assets * Feat: add optional id field to SingleModelConfig interface * fix_audio_tools,Support adding models individually * fix test * fix test 2 --------- Co-authored-by: Dallas98 <990259227@qq.com>
* 🐛 Add detail error message in debug mode * 🐛 Fix test
* 🐛 Bugfix: Fix iData tool call error. [Specification Details] 1. Modify the front-end component logic to pass the `dataset_ids` field for idata and haotian knowledge base retrieval. * 🐛 Bugfix: Fix iData tool call error. [Specification Details] 1. Submit incremental sql
…xt module. (#3039) * ♻️ refactor: consolidate context building into ContextManager Purpose: Consolidate ALL context building related code into a single ContextManager class, making it the single source of truth for system prompt assembly, component injection, memory management, and token-aware compression. This refactoring introduces a component-based architecture where system prompt parts (tools, skills, memory, knowledge base, agent definitions) are assembled from registered ContextComponent instances using pluggable selection strategies. Changes Summary: - Added ContextComponent hierarchy with 7 subclasses - Added ContextStrategy implementations with 4 algorithms - Extended ContextManagerConfig with strategy and injection flags - Added component management methods to ContextManager - Integrated component registration in NexentAgent - Modified CoreAgent to use component-based system prompt assembly - Created backend helper for component building - Updated tests with comprehensive coverage (260 tests) File Changes: sdk/nexent/core/agents/agent_model.py: - Added ContextComponent abstract base class with to_messages() pattern - Added 7 component subclasses: SystemPromptComponent, ToolsComponent, SkillsComponent, MemoryComponent, KnowledgeBaseComponent, ManagedAgentsComponent, ExternalAgentsComponent - Added ContextStrategy abstract class with 4 implementations: FullStrategy, TokenBudgetStrategy, BufferedStrategy, PriorityWeightedStrategy - Added context_components field to AgentConfig sdk/nexent/core/agents/summary_config.py: - Added StrategyType literal for strategy selection - Extended ContextManagerConfig with strategy field - Added inject_* flags for each component type (7 flags) - Added component_budgets dict for per-component token limits - Added buffer_size_per_component for buffered strategy sdk/nexent/core/agents/agent_context.py: - Added _components registry in __init__ - Added register_component() for component accumulation - Added clear_components() and get_registered_components() - Added _get_strategy() for strategy selection - Added build_system_prompt() for component-based assembly - Added _calculate_component_budget() for budget allocation - Added _message_already_present() for deduplication sdk/nexent/core/agents/__init__.py: - Exported all new ContextComponent subclasses - Exported all ContextStrategy implementations - Exported StrategyType sdk/nexent/core/agents/nexent_agent.py: - Added component registration after ContextManager mount - Iterates context_components from AgentConfig and registers each sdk/nexent/core/agents/core_agent.py: - Modified SystemPromptStep creation to use component-based assembly - Added fallback logic: components -> original system_prompt backend/utils/context_utils.py (NEW): - Added build_context_components() main function - Added build_*_component() helpers for each type - Added _format_*_description() helpers for text formatting - Added build_app_context_string() for app metadata backend/agents/create_agent_info.py: - Imported build_context_components from context_utils - Called build_context_components() with agent configuration - Passed context_components to AgentConfig test/sdk/core/agents/test_context_component.py (NEW): - Added 66 tests for ContextComponent hierarchy - Tests for each subclass creation, validation, to_messages() - Tests for ContextStrategy implementations test/sdk/core/agents/test_agent_context/unit/test_component_management.py (NEW): - Added 29 tests for ContextManager component methods - Tests for register, clear, get_registered, build_system_prompt - Tests for strategy selection and budget calculation test/sdk/core/agents/test_nexent_agent_component_integration.py (NEW): - Added 9 integration tests for NexentAgent and CoreAgent - Tests for component registration flow - Tests for system prompt assembly with fallback - Tests for backward compatibility test/backend/utils/test_context_utils.py (NEW): - Added 27 tests for context_utils helper functions - Tests for format helpers and build helpers - Tests for build_context_components main function test/sdk/core/agents/test_agent_context/loader.py: - Added _load_agent_model() for loading agent_model.py - Exported all ContextComponent and ContextStrategy classes test/sdk/core/agents/test_agent_context/stubs.py: - Fixed register_smolagents_mocks() to always overwrite sys.modules test/backend/agents/test_create_agent_info.py: - Added _create_stub_component_class() helper - Added component class stubs to agent_model mock setup test/common/test_mocks.py: - Removed unnecessary nexent.core.agents.agent_model mocking * fix(db): add missing semicolon to is_new index in init.sql Without the terminator, psql parses the CREATE INDEX and the following CREATE TABLE as a single statement and aborts with a syntax error at line 415, leaving 28 tables uncreated (including ag_prompt_template_t and user_tenant_t). This breaks every backend service on a fresh DB. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * ♻️ refactor: route rendered system_prompt through build_context_components build_context_components() now accepts an optional pre-rendered ``system_prompt``. When provided it returns a single SystemPromptComponent carrying the Jinja2 output verbatim so ContextManager.build_system_prompt() emits a system prompt byte-identical to what CoreAgent saw before the context-management refactor. When omitted the function keeps its piece-wise behaviour for future incremental componentization. create_agent_info.py forwards the rendered string, completing the behavior-preserving migration: ContextManager is now the single assembly point without changing what the agent actually sees. Splitting the rendered prompt into real semantic components (Tools / Skills / Memory / KB) is deferred to a follow-up. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * 🧪 test: add prompt-equivalence golden test Two golden tests guard the behavior-preserving migration of system prompt assembly into ContextManager: * test_system_prompt_component_roundtrip - wraps a Jinja2-rendered prompt in a single SystemPromptComponent, registers it, runs build_system_prompt() through ContextManager, joins role=system messages and asserts byte-identical content. Verifies the component machinery (register / strategy / dedup / role filter / join) is loss-less. Parametrised over language (zh/en) and is_manager flag. * test_full_build_context_components_matches_jinja2 - mirrors what backend/agents/create_agent_info.py does in production: render Jinja2 then hand the rendered string to build_context_components(system_prompt=...). Asserts the full end-to-end output stays byte-identical to the Jinja2 baseline. If this turns red the migration path itself has regressed. Both run only on branches that have backend.utils.context_utils and the new ContextComponent classes; the module-level skip keeps it inert on older branches. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * 🔧 chore: log when a ContextStrategy drops a component TokenBudgetStrategy / BufferedStrategy / PriorityWeightedStrategy used to silently drop components that did not fit their selection criteria, which made truncated system prompts impossible to diagnose at runtime. Each strategy now emits a logger.warning identifying the component type, priority, and which constraint tripped (total_budget vs type_budget vs buffer overflow vs relevance threshold vs per-component token fit). Behaviour for callers is unchanged - the selection results are identical; only observability improves. FullStrategy is unaffected since it cannot drop. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * ✨ feat(sdk): pass-through extra_body to chat.completions.create ModelConfig.extra_body / OpenAIModel(extra_body=...) / NexentAgent. create_model() forwarding is reintroduced so callers can supply provider-specific knobs to every chat.completions.create payload — most commonly Qwen3's chat_template_kwargs={"enable_thinking": false} to suppress reasoning preludes. Production safety: the field defaults to None on ModelConfig and the runtime guard "if self.extra_body" gates the kwargs injection, so any caller that does not opt in sees byte-identical request payloads. Originally added on feature/agent-context-improvement-eval to support the benchmark's thinking-off flag; missing on refactor/context-management caused the flag to be silently dropped (Pydantic v2 default extra='ignore' absorbed the kwarg, leaving </think> residues in benchmark model output). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * ✨ feat(sdk): pre-truncate long observations under ContextManager Adds ContextManagerConfig.max_observation_length (chars; 0 = disabled, the production default) and a corresponding head+tail truncation in CoreAgent.execute_action that fires only when ContextManager is enabled AND the observation exceeds the configured limit. A short marker tells the agent the elision is recoverable via search/read tools. Originally added on feature/agent-context-improvement-eval as commit c992b48 "truncate model/tool output" by liudongfei. That commit also accidentally enabled `import pdb; pdb.set_trace()` at line 294; this back-port carries only the intended truncation logic. Production safety: - New field defaults to 0 (disabled). Existing callers see no behaviour change unless they explicitly set it. - Guarded by self.context_manager.config.enabled, so even setting the field has no effect when ContextManager is off. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * ✨ feat(sdk): add benchmark instrumentation APIs on ContextManager Back-ports three small additions from feature/agent-context-improvement-eval that benchmarks depend on but were not part of the refactor: * incremental_summary_system_prompt (commit 9aecd0f on feature): Dedicated system prompt for incremental summary updates ("previous summary + new turns -> updated summary"). compress_*_with_cache's incremental paths now select this prompt via prompt_type='incremental'. Falls back to summary_system_prompt when the field is empty so callers that have not customised it still see a sensible default. * get_token_counts() (commit 824e737): Returns {last_uncompressed, last_compressed} from the most recent compress_if_needed pass. Required for benchmark token_reduction = 1 - last_compressed/last_uncompressed accounting. Recording sites added at all three return paths: under-threshold short-circuit, stable_bypass, and deep-compression finalisation. * export_summary() (commit 824e737): Returns cached summary texts + compression_boundary metadata (covered_pairs / end_steps / retained config). Benchmarks use the boundary to validate probe design - probes should only target content actually inside the compressed section. Production safety: * _generate_summary / _do_generate_summary gain prompt_type with default "initial". Existing callers that do not pass it keep the unchanged fresh-compaction prompt. * incremental prompt is only activated at the two call sites already labelled "*_incremental" in compress_previous_with_cache / compress_current_with_cache - other production callers are untouched. * Token-count instance vars default to None until the first compress_if_needed call, matching the feature-branch behaviour. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * 📦 chore: import sdk/benchmark and sdk/ctx_debugger from feature branch Lifts the benchmark + ctx_debugger source trees verbatim from feature/agent-context-improvement-eval. The benchmark is independent from production agent runtime and exists purely as an evaluation / diagnostic harness, so it lives on this integration branch (off refactor/context-management + feat/sysprompt-component-bringback) without changing any SDK or backend code. Subsequent commits on this branch will adapt the benchmark to the refactor's new ContextManager API surface (removing references to methods/fields that only existed on feature, e.g. export_summary, get_token_counts, OffloadStore, ModelConfig.extra_body, incremental_summary_system_prompt, max_observation_length, enable_reload). All such adaptations stay within sdk/benchmark/ and sdk/ctx_debugger/. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * 🧪 test: add minimal end-to-end smoke for benchmark-on-refactor smoke.py runs one trivial question through agent_runner.build_agent_run_info on the refactor SDK. Smoke passes today: imports clean, agent loop completes one step, final_answer is non-empty and correct. Two supporting tweaks live in this commit since the smoke does not run without them: - paths.py: accept .git as either a directory or a file. Git worktrees store .git as a pointer file at the repo root; the original isdir check failed to locate the project root from inside a worktree. - .gitignore: keep sdk/benchmark/.env out of version control (LLM credentials should remain local). Known limitations exposed by this smoke (work for follow-up commits): - LLM_ENABLE_THINKING / LLM_EXTRA_BODY are silently dropped because refactor's ModelConfig has no extra_body field (Pydantic v2 default is extra='ignore'). Visible as residual </think> tokens in model output. Will be fixed benchmark-side by subclassing OpenAIModel. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * 🐛 fix(benchmark): r.get is a method not a subscriptable test_benchmark.py:501 was r.get["baseline_failed"] (typo, would raise TypeError at runtime). Should be r.get("baseline_failed") to mirror the correct usage on line 502. The fix already exists on feature/agent-context-improvement-eval HEAD, but the import commit (3e42ff3) picked up an older snapshot of manual_cases/test_benchmark.py that pre-dates the fix. Spot-fixing here; a wider refresh of the benchmark dir against feature HEAD can be a follow-up if/when it is worth it. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * 🐛 fix(test): allow prompt_type kwarg in compress side_effect mocks P3/C4 incremental_llm_none_falls_through_to_fresh in test_compress_with_cache_extra.py used side_effect signatures that only accepted (text, model_, call_type=...). After da9d58a added prompt_type="incremental" at the two incremental call sites, these mocks raised TypeError. Extend the signatures with prompt_type="initial" so they tolerate either call shape. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * 🧪 fix(test): restore real sys.modules after stub-injecting tests Two test modules previously installed heavy mock module trees into sys.modules at import time and never rolled them back: - test/sdk/core/agents/test_agent_context/loader.py — registers mock smolagents (memory/models/agents) to sandbox-load agent_context.py via importlib. - test/sdk/core/agents/test_context_component.py — registers ~25 mocks (smolagents, rich, jinja2, langchain_core, exa_py, openai, mem0, paramiko, boto3, tiktoken, aiohttp, botocore, ...) to sandbox-load agent_model.py. When pytest collected these in the same session as test/backend/utils/test_context_utils.py, the latter resolved its "from nexent.core.agents.agent_model import ..." chain through the bare mock ModuleType entries left in sys.modules and failed with ImportError("unknown location") on AgentMemory, Console, etc. Fix: after each sandbox finishes loading the module it needs (so its target captures the mock classes as module-level attributes), restore real packages back into sys.modules via importlib.import_module. The already-loaded test target keeps its mock references; sibling test trees see real packages. Cross-validated: pytest test/sdk/core/agents/test_agent_context/ test/sdk/core/agents/test_context_component.py test/sdk/core/agents/test_nexent_agent_component_integration.py test/backend/utils/test_context_utils.py → 221 passed (was 206 passed, 15 failed). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * ♻️ refactor(sdk): implement piecewise component assembly for all 4 variants Goal 3: Replace a330d81 short-circuit with semantic component architecture - Expand _format_* functions with full Jinja2 long text (memory guidelines, skill process, tool file guide, agent calling specs) for zh/en variants - Add build_skeleton_*_component() for header/duty/execution_flow/constraint/ code_norms/footer sections - Rewrite build_context_components() to accept raw params and emit piecewise + skeleton components in correct order (priority-encoded 100→10) - Remove 'if system_prompt: return [single]' short-circuit from build_context_components - Modify create_agent_info.py to pass raw params instead of Jinja2-rendered string - Rewrite test_prompt_equivalence.py as semantic assertions (section presence, order, memory ordering, key content) - 12 tests pass - Update test_context_utils.py for new piecewise behavior - 105 tests pass Verified: task_success_retention=1.0 for example_infra benchmark case * ✨ feat(sdk): add compress_history_offline standalone function Back-port of feature/agent-context-improvement-eval's compress_history_offline, required by benchmark's static compression inspector (sdk/benchmark/.../ summary_inspector.py). Same prompts and schema as the in-agent compression path, but operates on plain (user, assistant) text pairs without any ContextManager state — no cache, no offload store, no agent runtime. Also brings back two module-level helpers it depends on: - format_summary_output: strips markdown fences, attempts JSON parse, falls back to plain text. Logic identical to ContextManager._format_summary but reusable from module scope. - _is_context_length_error: matches known context/token-limit error strings. Logic identical to ContextManager._is_context_length_error. Production safety: this is purely additive — three new module-level symbols (compress_history_offline, format_summary_output, _is_context_length_error). No existing ContextManager method body is touched. backend/ never imports or calls any of these. The benchmark inspector is the only consumer. Verified: pytest test/sdk/core/agents/test_agent_context/ \ test/sdk/core/agents/test_context_component.py \ test/sdk/core/agents/test_nexent_agent_component_integration.py \ test/backend/utils/test_context_utils.py → 221 passed (unchanged). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * ✨ feat(sdk): pass-through max_tokens to chat.completions.create Mirrors feature/agent-context-improvement-eval commit a7d472e, adapted for refactor: the field is added to ModelConfig and forwarded through NexentAgent.create_model into OpenAIModel, but defaulted to None so that production behaviour is unchanged. Rationale: benchmarks (eventqa, longmemeval) need a per-call completion output cap to bound pathological generation loops where a model regurgitates context. Feature picked 4096 as the default; backport chooses None instead so production keeps the provider's own default (typically the model's max output). Benchmarks that want the cap set it explicitly via ModelConfig(..., max_tokens=4096). - agent_model.py: ModelConfig.max_tokens: Optional[int] = None - nexent_agent.py: create_model() forwards model_config.max_tokens - openai_llm.py: OpenAIModel(max_tokens=None) stored on instance; injected into completion_kwargs only when set AND when caller did not pass an explicit override via **kwargs Verified: pytest test/sdk/core/agents/test_agent_context/ \ test/sdk/core/agents/test_context_component.py \ test/sdk/core/agents/test_nexent_agent_component_integration.py \ test/backend/utils/test_context_utils.py → 221 passed (unchanged). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * 📝 docs: translate Chinese markdown files to English in benchmark and ctx_debugger Translate all documentation files from Chinese to English to comply with CONTRIBUTING.md code standards: - sdk/benchmark/README.md - sdk/benchmark/manual_cases/README.md - sdk/benchmark/manual_cases/note_benchmark.md - sdk/benchmark/eventqa_eval/README.md - sdk/benchmark/eventqa_eval/RUNBOOK.md - sdk/benchmark/longmemeval_eval/README.md - sdk/ctx_debugger/README.md - sdk/ctx_debugger/langfuse_eval_assessment.md These translations ensure the project documentation is accessible to international contributors and follows the English-only convention established in CONTRIBUTING.md. * 🔄 sync(benchmark): pick eventqa_eval + agent_runner from feature Sync sdk/benchmark/agent_runner.py and sdk/benchmark/eventqa_eval/ run_eventqa.py from feature/agent-context-improvement-eval HEAD to freeze the version this branch will validate against. Per the user's instruction, the eventqa stack will not be updated again after this. agent_runner.py changes: - Comments translated zh -> en (commit 657d0b8 on feature) - extra_body handling upgraded: now reads LLM_EXTRA_BODY (raw JSON) and LLM_ENABLE_THINKING (truthy flag) env vars instead of the hardcoded THINKING_OFF_EXTRA_BODY dict. Both vendor dialects (Qwen3 chat_template_kwargs and Anthropic thinking.type) coexist in one payload so the same runner works against either backend. - max_tokens parameter forwarded to OpenAIModel (default 4096 at benchmark layer; SDK back-port keeps default=None so production is unaffected — see faf74dc). - AgentRunResult.total_input_tokens / total_output_tokens fields added, step callback accumulates them. Needed by run_eventqa.py. - sys.path setup simplified (drop redundant dirname layer). run_eventqa.py changes: - ingest_main_input_tokens / ingest_main_output_tokens accumulated across ingest chunks; surfaced in summary.json under "cost". - run_probes() turned into bounded-concurrent (asyncio.gather + Semaphore sized by --probe_concurrency). Signature changed from list[dict] to tuple[list[dict], dict] — the second element is the token totals. - Probes forward args.probe_max_tokens to build_agent_run_info. Verification: 1 book x 3 questions x 100k ingest x baseline_context=100k baseline_acc = 1.000 compressed acc = 0.667 retention = 0.667 token_reduction = 0.359 ratio (compressed_total / baseline_total) = 2.076 Compression triggered (token_reduction>0) and the agent answered with compressed context, confirming the full eventqa_eval pipeline works on refactor end-to-end. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * sync(benchmark): pick run_longmemeval + run_with_debugger+ summary_schemas from feature * 🔄 sync(benchmark): pick manual_cases harness from feature Sync test_benchmark.py + calibrate_thresholds.py + the updated example_infra/case.json from feature/agent-context-improvement-eval HEAD. The 22 additional case dirs that feature added are NOT pulled — they're specific evaluation datasets the user keeps under their own bookkeeping; this branch only validates the harness with the original example_infra case. README.md / note_benchmark.md kept at worktree (English) versions. test_benchmark.py changes: - Replace build_agent_run_info_with_custom_prompt with build_agent_run_info (current SDK surface). - Introduce BENCHMARK_SYSTEM_PROMPT — a lean, generic system prompt that strips the verbose platform scaffolding (file URL guide, reference marks, safety principles) to minimize token overhead during benchmark runs while keeping the core execution-loop instructions. - Introduce BENCHMARK_SUMMARY_SYSTEM_PROMPT + custom 6-field summary schema (~620 word budget) for incremental compression. Replaces the default 10-field Hermes schema by merging completed_work + resolved_questions into "progress" and restricting key_facts to values NOT already stated in progress. Eliminates the 3-field redundancy that caused output bloat in incremental updates and held output size stable instead of growing past token_threshold. - Add net_token_reduction / compression_cost_tokens reporting in the summary so downstream analysis can subtract compression LLM cost from the input savings. calibrate_thresholds.py: new tool for tuning token_threshold per case. example_infra/case.json: 2 new probes added (generate_env.sh sed usage; ES port-mapping cross-container access), bringing the probe count to a more useful smoke level. Verification on refactor: test_benchmark.py --cases example_infra task_success_retention = 1.0 probe_retention = 0.722 token_reduction = 0.635 net_token_reduction = 0.408 compression_cost_tokens = 8341 summary_score = 0.5 Pipeline works end-to-end with the synced harness and expanded probes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * 🔧 chore(benchmark): align build_agent_run_info max_tokens default to None Match the SDK back-port faf74dc (ModelConfig.max_tokens default=None for production safety). The benchmark harness previously inherited feature's 4096 default, but every concrete benchmark caller already passes max_tokens explicitly (e.g. run_eventqa.py forwards args.probe_max_tokens=4096 into probes), so flipping the default to None has no behaviour change for current callers while making the abstraction symmetric with the SDK: "default unbounded; opt in to a cap". Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * update system and summary prompt * readme and eval res * add fallback and build_compressed_snapshot * add acon output res * add default summary prompt argument * add cases * add reports results * add static summary inspections * fix(sdk): restore indentation on extra_body after merge * fix(sdk,test): resolve merge fallout in AgentConfig and align tests * chore(sdk/benchmark): stop tracking eval datasets and outputs Untrack acon_eval/data and outputs, longmemeval_eval/data and outputs, and all manual_cases/cases entries except example_infra. Add local .gitignore files in each directory so future runs do not re-add them. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore(sdk/benchmark): stop tracking manual_cases reports and inspections Untrack manual_cases/reports and manual_cases/inspections (generated per run) and add a .gitignore so they are not re-added. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Jason <jason@nexent.tech> Co-authored-by: wuyuanfr <18270469842@163.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: liudongfei <744532452@qq.com> Co-authored-by: zooowooxo <oct030929@gmail.com>
…#3057) * ✨ feat(sdk): increase max_steps default to 15 and add bounds validation Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> * ✨ feat(backend): align max_steps defaults to 15 and widen validation to 30 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> * ✨ feat(frontend): increase max_steps default to 15 and widen input bounds to 30 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> * 🧪 test(sdk): update max_steps default and boundary tests for new 1-30 range Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> * 🧪 test(backend): update invalid max_steps test to match new 30 bound Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> --------- Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
#3042) * ✨ Feat: add ASSET_OWNER role, enforce asset visibility, and refine northbound knowledge APIs * Introduce ASSET_OWNER role with virtual tenant scope (asset_owner_tenant_id) and invitation bootstrap flow * Add/adjust role permissions and tenant migrations for ASSET_OWNER-scoped resources (agents, skills, models, tools, invitations) * Enforce visibility rules: hide ASSET_OWNER agent prompts for non-ASSET_OWNER callers (prompts_hidden) and restrict ASSET_OWNER skills/docs/files to asset-owner scope * Tighten attachment access control for attachments/asset_owner/{user_id} while keeping knowledge_base files readable for authenticated users * Refine /nb/v1/knowledge endpoints and parameters for index and file operations (list/create/delete indices, list files, delete documents, upload/download) * feat(asset-owner): add invitation & user management support - Add tenant_id migration and asset owner permissions/menu SQL - Expose northbound knowledge/vector database updates for asset owner visibility - Add backend auth/utils and invitation/agent/user management services - Update invitation list UI * feat(asset-owner): add invitation & user management support - Add tenant_id migration and asset owner permissions/menu SQL - Expose northbound knowledge/vector database updates for asset owner visibility - Add backend auth/utils and invitation/agent/user management services - Update invitation list UI * feat(asset-owner): add invitation & user management support - Add tenant_id migration and asset owner permissions/menu SQL - Expose northbound knowledge/vector database updates for asset owner visibility - Add backend auth/utils and invitation/agent/user management services - Update invitation list UI * feat(asset-owner): add invitation & user management support - Add tenant_id migration and asset owner permissions/menu SQL - Expose northbound knowledge/vector database updates for asset owner visibility - Add backend auth/utils and invitation/agent/user management services - Update invitation list UI * feat(asset-owner): add invitation & user management support - Add tenant_id migration and asset owner permissions/menu SQL - Expose northbound knowledge/vector database updates for asset owner visibility - Add backend auth/utils and invitation/agent/user management services - Update invitation list UI
* add_parameters * modify test file
…ode (#3064) * 修改导入标签的样式 * 当用户未进入编辑状态时,默认不能选择tool&skill * Bugfix: when refresh_token is null, alert 401 * 更新i18n
… for improved token management
JasonW404
reviewed
Jun 24, 2026
| echo "========================================" | ||
| echo "" | ||
| echo "Package contents:" | ||
| unzip -l "${{ steps.set-vars.outputs.package-name }}.zip" | head -50 No newline at end of file |
Member
There was a problem hiding this comment.
新增的 build-offline-package.yml workflow 文件末尾缺少换行符(No newline at end of file)。POSIX 标准要求文本文件以换行符结尾,某些 CI 工具在拼接脚本时可能产生意外行为。
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.