Repository navigation
fix(project): 统一 CLI、MCP 与 Skill 的服务端 Token 流程 - #13
Merged
Merged
Conversation
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.
背景
本次修改解决本地 PDF 直传超时后,将错误响应中的 token 误认为有效任务 token,并持续轮询 status: undefined 的问题,同时统一 CLI、MCP 和 Skill 对 UniParser v1.3 token 机制的使用方式。
主要修改
CLI 和 MCP 的文件、图片、URL 触发请求统一发送 token=None 和 server_generated_token=True,只使用服务端生成的任务 token。
本地 PDF 保留 multipart 直接上传方式,不使用 TOS 上传或自动回退;同步请求使用 (60, 1860),异步请求使用 (60, 60)。
只有成功触发返回的 token 才会写入 trigger_meta.json 并进入结果轮询。
失败响应中的标准 token 仅用于错误诊断,不会进入 fetch 或任务恢复流程。
status: undefined 连续检查三次后返回 TOKEN_NOT_FOUND,避免无效任务持续等待 1800 秒。
补充 UPLOAD_ERROR、TOKEN_NOT_FOUND 等错误处理,并同步更新 CLI、MCP 和 Skill 文档。
保持底层 Client/API 行为不变,继续兼容原有 SDK 调用方式。