Skip to content

Fix/issue 40 delegate model provider and docs#43

Merged
CrazyBoyM merged 3 commits intoshareAI-lab:mainfrom
Gui-Yue:fix/issue-40-delegate-model-provider-and-docs
Mar 28, 2026
Merged

Fix/issue 40 delegate model provider and docs#43
CrazyBoyM merged 3 commits intoshareAI-lab:mainfrom
Gui-Yue:fix/issue-40-delegate-model-provider-and-docs

Conversation

@Gui-Yue
Copy link
Copy Markdown
Contributor

@Gui-Yue Gui-Yue commented Mar 8, 2026

Summary

  • 修复 Agent.delegateTask 在自定义 ModelProvider 场景下的兼容性问题:默认继承父 Agent 的 ModelProvider 实例,不再强依赖 modelFactory
  • 修复 delegateTask 传入字符串 model 时硬编码 anthropic 的问题,改为沿用父provider 并仅覆盖 model 名称。
  • 新增能力:task_run 支持可选 model 参数,支持:
    • string
    • { provider, model }
    • 不传时默认继承父模型实例
  • 增强并纠偏文档(docs/en + docs/zh-CN):补充 delegateTask/task_run 模型解析规则、参数说明、最小示例、常见错误。
  • 新增/更新单元测试覆盖上述行为。
  • Close feature: 期望delegateTask能够支持指定modelProvider #40

Motivation / Context

Type of Change

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Test
  • Chore / Build

Scope / Modules

  • core (agent / events / pool / room / scheduler)
  • infra (db / provider / sandbox / store)
  • tools (fs / bash / mcp / skills / task)
  • skills
  • examples
  • docs (en / zh-CN)
  • tests
  • other: ___

Public API

  • Exports changed in src/index.ts
  • No public API change

Breaking Changes

  • Yes , and attach report(include necessity) and transition plan
  • No

Testing

  • npm run test:unit(required)
  • npm run test:integration(if needed)
  • npm run test:e2e(if needed)

Impact / Risk

  • 影响面主要在子任务委派链路(delegateTask / task_run)。
  • 风险可控,改动向后兼容(model 为可选扩展)。
  • 跨 provider 使用 { provider, model } 时,如缺少必要配置(例如自定义 provider的鉴权信息)通常仍需 modelFactory 提供实例化能力。

Checklist

  • Docs updated if needed
  • Examples updated if needed
  • New feature includes related tests and docs
  • Tests follow tests/README.md structure
  • Docs follow docs/en + docs/zh-CN format rules
  • No secrets or tokens committed
  • No dist/ changes (unless release)
  • Only one lockfile updated for the package manager used

@Gui-Yue Gui-Yue force-pushed the fix/issue-40-delegate-model-provider-and-docs branch from 1e47450 to 162f6c4 Compare March 8, 2026 05:16
@Gui-Yue Gui-Yue force-pushed the fix/issue-40-delegate-model-provider-and-docs branch from 162f6c4 to bf104cb Compare March 8, 2026 05:36
@CrazyBoyM CrazyBoyM merged commit f8956f6 into shareAI-lab:main Mar 28, 2026
8 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.

feature: 期望delegateTask能够支持指定modelProvider

2 participants