Repository navigation
Conversation
宿主对一次连接器调用有 30 秒上限,超时会被中止并报「结果未知」。图片没有任务号可查, provider 那边做出来的那张也就找不回来,所以带参考图的慢速出图过去会直接失败一次。 现在出图超时不再失败:直连被掐断后,把直连本来要发的那份请求原样交给 Agent 跑一轮 (宿主不限制 Agent 回合的时长),图从那条路回来,并落一份本地副本。页面上不弹失败, 运行日志里写明换了路。 只有 CONNECTOR_TIMEOUT 和 CONNECTOR_OUTCOME_UNKNOWN 走这条路;provider 明确报错不降级。 版本 0.86.0 -> 0.87.0。
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.
问题
宿主对一次连接器调用有 30 秒上限(
hostConnector.call与context.tool直调都是 30 秒)。超时的调用会被中止并报「结果未知」(CONNECTOR_OUTCOME_UNKNOWN/CONNECTOR_TIMEOUT)。图片生成没有任务号可查:provider 那边已经做出来的那张图既拿不到链接,也没法事后去认领。加上带参考图的出图最慢(实测 0.27MP 参考图约 24.1 秒、3.75MP 约 27.5 秒、12MP 约 40.1 秒),于是画布上「带参考图的出图」会随机失败一次,并且丢图。
改法
出图超时不再失败,改走另一条路:
CONNECTOR_TIMEOUT/CONNECTOR_OUTCOME_UNKNOWN)时,把直连本来要发的那份请求原样交给 Agent 跑一轮。宿主不限制 Agent 回合的时长,图从那条路回来。只对这两种「被宿主掐断」的码降级:provider 明确报错、连接器不可用都不降级(换一条路还是同一个 provider)。
代价说清楚:Agent 回合里的工具调用要用户点一次「允许一次」。这是宿主的权限模型,插件不能替用户批准,所以降级后不是「零打扰」,是「不报错,但要批一次」。
测试环境与结果
node --test "tests/*.test.mjs":249 / 249 通过。新增用例「a stopped image call goes on by the Agent road instead of failing」;原用例「a call that waited for the machine says how long it waited when it fails」改到 audio 模式继续覆盖同一批断言(出图模式现在不再失败,断言的意图完整保留)npm run check(validate + 87 个仓库级测试)通过;plugins/antianqi/ai-node-canvas0 error。HOST_CONNECTOR_UNVERIFIED这条 warning 改动前就有(hostConnectorAccess.providers由宿主在安装时授予),本次未新增诊断真机端到端(把本 PR 的代码按插件装进客户端跑通)
把本 PR 的代码按插件装进 MiniMax Code 客户端(装进去的
miniapp/node/agent-runner.mjs、miniapp/node/connector-runner.mjs与本 PR 源字节一致),在画布里用 12MP(2588×4627)+ 0.27MP 两张参考图跑出图:success,产出 1 张 703,923 字节的图片。1/1 succeeded,只生成了一次。版本
0.86.0 → 0.87.0(
package.json、.minimax-plugin/plugin.json、两个 README 同步)。真机端到端里看出的一个尾巴
降级路径把签名链接换成本地副本的时机,晚于画布页面把运行结果写回文档的时机:本地副本于 08:24:50.039 写入,而画布文档在 08:24:49.922 已经保存。结果是节点上仍存着会过期的签名链接,本地副本虽已落盘却没被文档引用。图片本身不丢,影响有限,但这条降级路径的收尾可以再收紧(把替换动作提前到运行置为完成之前,或让页面在收到完成后再拉一次运行结果)。
未验证
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.