You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason will be displayed to describe this comment to others. Learn more.
Found a few correctness issues in the new file-upload and MCP bootstrap paths. The comments below are the ones that look worth fixing before relying on this in normal use.
highpkg/providers/factory_provider.go:244
这个 PR 目前把 provider 相关测试跑挂了。我实际执行了 go test ./pkg/providers/...,失败包括 TestCreateProviderFromConfig_MinimaxInjectsReasoningSplit 和 TestCreateProviderFromConfig_MinimaxPreservesUserExtraBody。即使这里的行为变更是有意的,也需要在同一个 PR 里把测试同步更新,否则当前分支处于红灯状态。
highpkg/providers/anthropic_messages/provider.go:224
同一轮 go test ./pkg/providers/... 里,pkg/providers/anthropic_messages 也失败了:TestBuildRequestBody_ConsecutiveToolResultsMerged 和 TestBuildRequestBody_UserToolResultsMerged。从实现看,tool_result 在无法合并时会被降级成新的纯文本 user message(provider.go:244、provider.go:316),这和现有的消息合并语义不一致。至少测试还没跟上,较大概率还带来了真实的协议回归。
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
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.
文件解析功能总结
核心目标
测试 MiniMax M2.7(通过 Anthropic Messages API)集成为桌面宠物的 LLM 后端,支持完整的工具/函数调用、自动连接 MCP 工具(
understand_image、web_search),并处理文件上传(图片、PDF、DOCX、文本)。已完成的工作
1. MiniMax 供应商实现
minimax-anthropic→anthropic_messages.Provider,原生支持 Tools APIWithDisableImages(true)在调用 API 前剥离msg.Media中的图片 data URLreasoning_split自动注入tool_result降级为纯文本max_completion_tokens字段名2. 文件拖拽与二进制支持
page.tsx中handleDrop正确读取e.dataTransfer.files并调用sendFileDropped()FileIsBinary字段,PDF/DOCX 等二进制文件以 base64 读取(不是 UTF-8 文本),避免乱码3. 文档解析
archive/zip+encoding/xml,剥离w:命名空间前缀后解析word/document.xmlgithub.com/ledongthuc/pdf库,无需外部pdftotext4. MCP 自动下载
ensureUVX()按顺序查找:PATH →.goclaw-runtime/bin/uvx.exe→ GitHub 下载resolveCommand()自动解析uvx/uv为完整路径NewManagerWithBinDir(binDir)指定下载目录5. MCP 配置
minimax-coding-plan"uvx"(运行时解析,不使用-y标志)MINIMAX_API_KEY、MINIMAX_API_HOST(必须为https://api.minimaxi.com)6. 图片处理策略
load_image:该工具对纯文本模型返回无用的[image:media://]引用understand_image:通过 MCP 注册为mcp_minimax-coding-plan_understand_image,参数为prompt+image_source关键决策
.goclaw-runtime/bin/ledongthuc/pdf下一步
understand_image正常工作重要注意点
logger.Infof不输出(默认 warn 级别),logger.Warnf可见picoclaw.exe(不是goclaw.exe)uvx -y不支持 → 使用uvx minimax-coding-plan-mcpforwardFileToSettings()会自动重建