Skip to content

✨ Feature: Introduce jiuwen as an optional agent core. - #4320

Open
YehongPan wants to merge 35 commits into
developfrom
pyh/feat_jiuwen_agent_core_develop
Open

YehongPan wants to merge 35 commits into
developfrom
pyh/feat_jiuwen_agent_core_develop

Conversation

@YehongPan

@YehongPan YehongPan commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

✨ Feature: Introduce jiuwen as an optional agent core.

[Specification Details]

  1. 接入可替换的AgentCore。定义统一 Adapter 契约和工厂,支持 smolagents、Jiuwen。Nexent 保存业务配置,Adapter 负责转换配置、执行和输出,方便后续扩展其他 Core。通过 .env 中的 NEXENT_AGENT_CORE 统一选择 Core。覆盖普通会话、调试、工作台、NL2Agent、NL2Skills及本地子智能体。
  2. 重构 SDK 目录。拆分为 contracts、factory、orchestration、resources、output、context、sandbox、cores。两种 Core 的专属实现分别归档,项目调用统一迁移到新路径。
  3. 接入统一模型服务。Jiuwen 模型请求统一经过 Nexent ModelService 和可信模型出口配置。支持原生工具调用、受控文本协议,以及思考内容、模型参数和容量信息的适配。修复部分模型调用失败及旧思考参数兼容问题。
  4. 补齐资源执行桥。接入普通工具、MCP、Skills和知识库检索,复用现有权限与配置。修复 Skills 授权快照传递、MCP 工具名称映射等问题。修复 MCP 参数清理,保留合法空数组、空对象和显式 null,继续执行 Schema 校验。
  5. 补齐代码和沙箱执行。Jiuwen 可调用 Nexent 受控 Python 执行器和配置的沙箱,支持文件生成。修复并发子智能体跨事件循环共享锁导致的失败。
  6. 复用上下文管理和数据库历史。Jiuwen 接入现有 CM 算法、容量预算和用户保存配置。修复多轮会话重放旧任务的问题,支持切换全局 Core 后继续已有会话。
  7. 统一实时输出和历史展示。将两种 Core 的过程、结果转换为公共输出类型。统一展示思考、工具、子智能体、执行状态和用量。修复内部历史记录、协议标签泄漏,以及刷新后出现原始 JSON 或错误终态的问题。
  8. 补齐人在回路能力。Jiuwen 支持 ask_user 澄清卡片、提交后续聊和历史恢复。修复正常等待输入时,历史误报 JIUWEN_FINAL_OUTPUT_INVALID 的问题。
  9. 完善工作台创建流程。NL2Agent、NL2Skills 接入全局 Core 策略。修复澄清卡不展示、提前进入下一步、Skill 历史文件为空及终态误报等问题。生成结果卡只由 agent_generation_completed 触发,草稿编辑入口独立保留。三类交互反馈共用国际化文案,修复中文实时展示、刷新后变英文的问题。

[Test Results]

人在回路

img_v3_0217a_4de0c688-9c7f-4c13-b01f-99d17c53978g

工具调用(图片分析)

img_v3_0217a_7cbcb34a-27c5-445e-aed7-fadd072755dg

子智能体调用

img_v3_0217a_39ad470f-bc75-421e-8599-0024c78e5edg

nl2agent适配

img_v3_0217a_ff086d59-5f8a-4992-b03c-db9fed47d52g image

nl2skills适配

img_v3_0217a_521f90a4-7c58-4a52-a4bc-62bfca71e0ag

并行调用(多子智能体协同)

img_v3_0217a_bd6636eb-6cb1-40d9-aae6-984f795f0f7g

工作台知识库查询挂载

daa09c60-6ced-40f5-ab8c-a89c30df9ceb

工作台智能体挂载

7efedb9f-2698-4e6d-bb4b-456258a3d1d8

工作台技能挂载

Image

…ent_core_develop

# Conflicts:
#	sdk/nexent/core/agents/run_agent.py
Route Jiuwen model requests through the shared ModelService with trusted outlet snapshots, native tool calling and a controlled text protocol.

Bridge authorized tools, MCP, Skills, subagents and A2A; preserve saved Core configuration and reuse Nexent context management and database history without replaying old tasks.

Normalize public step observations and run results into existing Nexent chat events, including shared capacity metadata when context management is disabled. Add the v2.7.2 outlet migration, integration documentation and regression assets.

Validation: previously completed Python/frontend UT and targeted formal checks; capacity regression rerun: 11 passed. Eight real-model business turns covered image analysis, follow-ups and Core switching. Formal real UI case remains failed due to AIDP 502; global asset gate remains blocked by F-111-RULE-02.
Merge develop at 5d94f69, retaining upstream service extraction, model controls and chat restoration fixes.

Move Jiuwen persistence and output handling into the new execution/stream modules, retain trusted outlet provisioning and model snapshots in the refactored record factory, and adapt regression fixtures to the new module boundaries. Synchronize the catalog content digest after prior whitespace normalization.

Validation: 2139 distinct Python UT, 52 frontend tests, TypeScript and 3 formal Cases (28 assertions) passed. Global formal asset validation remains blocked by existing F-111-RULE-02. No fresh deployment or real-model D4 performed.
Propagate saved Skill authorization snapshots, provide controlled native Python file generation, and resolve registered MCP names to original wire names while rejecting collisions.

Add unit regressions and deployed resource/Skill journey cases covering files, knowledge retrieval, external MCP, mixed-core delegation, and follow-up history without replay.
Adapt Jiuwen preparation, model outlet snapshots and conversation ordering to the canonical backend structure. Preserve structured clarification responses and immutable historical SQL migrations.
Include d954d64 and refresh formal asset views. Supply the missing scrollIntoView browser boundary in the citation test and assert selected-source scrolling.
Separate contracts, resource orchestration, Core context bridges and sandbox modules. Migrate SDK, backend and test import sites and remove legacy alias modules. Preserve model implementations and backend business behavior.

Validation: 92 isolated contract and import-boundary tests; syntax, copyright, unchanged backend business AST and frozen model blobs checked.
Centralize history, Skills, artifact and response rules across smolagents and Jiuwen. Share current-request delegation intent, authorized targets, successful dispatch state and bounded recovery while retaining Core-specific execution protocols.

Add policy and protocol regressions and a two-Core file-assistant browser journey. Validation of the exact commit tree: 234 Python regressions and 14 controlled runtime tests. Previous delivery also passed 739 Python tests, 14 frontend tests and both real-model browser variants; retain the separately recorded global asset-gate limitation.
Use canonical context/configuration imports in backend, benchmarks and
isolated regression stubs. Align sandbox and context tests with the
already migrated SDK, retain terminal MCP error guards, and include
generated navigation for the Jiuwen feature contracts.

Remove duplicate copyright lines without changing model modules.
Validation: isolated SDK suites 1,616 passed; terminal guard 5 passed;
benchmark CLI imports, copyright and formal asset checks passed.
Export and import the saved agent core and context-manager enable flag.
Keep smolagents and enabled CM as backward-compatible defaults for
older payloads, and reject unsupported cores through the public contract.

Validation: 12 focused transfer tests and formal asset checks passed.
Update fixture authentication and unified prompt fields, include the
controlled Python tool in native-mode expectations, and publish owned
fixtures before checking their exports. Support explicit browser channel
selection and distinguish resource diagnostic subsets from full passes.

Include the existing delegation fix traceability record.
Validation: model/native-file UT 71 passed; model bridge D3 4 passed;
resource D3 6 passed and D5 4 passed; formal asset checks passed.
Authorize explicit saved-user retry targets and acknowledge their server
identity without appending a new question. Keep history siblings ordered,
project the latest answer into model context, and share running-branch
recovery across chat and Workbench without creating an extra branch.

Include required retry helpers, boundary regressions and fixed browser
acceptance assets. Independently repeated equal-text questions retain
their own persisted boundaries.

Validation: backend UT 34 and frontend UT 35 passed; type-check passed;
UT-FE-040 passed all 5 component tests; formal asset checks passed.
Real browser rerun was blocked by model_authentication_error on the first
model call. Owned fixtures were cleaned and the source stayed unchanged;
this rerun is not a real-model acceptance pass.
Merge develop a73ab25 while retaining canonical SDK contracts, factory,
orchestration, resources, output and per-Core implementation directories.
Port upstream execution-history, callable-name and MCP diagnostics changes
to their canonical owners; do not restore removed SDK aliases.

Keep shared prompt/delegation rules, explicit output results and retry
history branches. Preserve Qwen tool ID continuations alongside updated
stream trailers and provider diagnostics. Freeze Jiuwen connection headers
and use canonical model outlet columns ahead of transitional snapshots.

Validate 2,922 Windows unit tests, 2 Linux symlink checks, 92 frontend tests,
frontend types, 8 selected formal cases and combined-tree asset gates.
Local configuration, test results and unrelated untracked files excluded.
Use the deployment-wide Core policy and remove per-Agent Core persistence
and the unmerged selection migration. Preserve Agent models, CM and resources.

Keep Jiuwen executions on a managed event loop, bridge terminal ask_user
forms, normalize legacy model preferences and preserve native history units.

Restore MCP creator interactions and waiting terminals, retain tool identities
and Skill artifacts in history, and show generated-Agent result cards only
on matching completion events. Keep draft editing as a separate action.

Include regression tests, formal Cases and integration documentation.
Validation: 278 targeted Python tests, 104 frontend tests, copyright and
whitespace checks, and strict design/implementation asset validation passed.
Real Workbench journeys on both Cores passed on the matching deployed code.
Compare exact sorted Skill-name lists when checking the owned clone.
Retain duplicate detection and the existing model, prompt and tool checks.
Record the test-only correction with its owning formal Case.
Merge develop at 5876d6e.
Keep canonical SDK contracts, public capabilities and per-Core implementations;
do not restore legacy aliases or move models.

Apply upstream creation-confirmation validation and literal clarification
wrappers in the shared contract. Retain smolagents cancellation, bounded
clarification recovery and actionable Python syntax feedback.

Omit absent optional clarification fields from Jiuwen events so the shared
frontend continues to render ordinary ask_user cards. Migrate new upstream
test imports and align duplicate-usage assertions with final snapshot emission.

Validation: 2429 Windows Python tests and two Linux symlink tests passed;
185 Workbench and 119 component tests passed. Two component timeouts were
reproduced against origin/develop sources and remain separately recorded.
Three D3 Cases passed 83 variants with cleanup. Strict asset validation,
TypeScript, copyright and whitespace checks passed. No deployment or push.
Add a real Workbench ask_user journey covering terminal forms, exact saved
response identity, read-only history, follow-up facts and owned cleanup.

Align the Agent creator regression with the Submitted history label and
verify restored text, selected/unselected options and other answers against
the actual submitted payload. Register the Case, binding and change record.

Validation: 161 existing Python regressions and three real-model Workbench
D4 journeys passed. Selected files match the verified source hashes. Strict
design/implementation asset validation, copyright and whitespace checks passed.
YehongPan and others added 3 commits November 10, 2026 17:07

This branch has not been deployed

No deployments
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