Skip to content

fix: drop unsupported inline media in assistant history - #336

Merged
Mag1cFall merged 2 commits into
Mag1cFall:mainfrom
paralax034:fix/model-mime-type
Nov 29, 2026
Merged

Mag1cFall merged 2 commits into
Mag1cFall:mainfrom
paralax034:fix/model-mime-type

Conversation

@paralax034

Copy link
Copy Markdown
Contributor

改动 / Changes

  • Add DropUnsupportedAssistantMedia in internal/aistudio/turns.go: parses MIME types with mime.ParseMediaType, retains text/*, image/*, audio/*, video/*, application/pdf, application/json, and application/x-ipynb+json inline media in assistant history turns, preserves attached thought signatures, and omits empty turns from upstream requests.
  • Apply DropUnsupportedAssistantMedia in trackedService.Generate (internal/app/runtime.go), normalizeTurns (internal/aistudio/turns.go), and PooledService.CountTokens (internal/aistudio/service.go).

验证 / Verification

  • go vet ./...
  • go test -p 1 -mod=readonly ./cmd/... ./internal/...
  • Sent a follow-up turn in Playground Agent mode (Code Execution) over assistant history containing text/x-python and application/octet-stream artifacts; the request completes and history attachments display in the UI.

paralax034 and others added 2 commits November 27, 2026 12:47
- 补齐上游直接接受的归档、办公文档与 WAV 别名类型,按解析后的基础类型判定并原样保留文本与裸音频参数
- 在计数路径保留过滤前后的轮次与片段位置映射,返回时为丢弃的片段与空模型轮补零对齐
- 将生成入口的过滤移至输入账本记录之后、预校验与上传之前,保持原请求摘要并避免无效附件进入上传阶段
@Mag1cFall
Mag1cFall merged commit b22dcb7 into Mag1cFall:main Nov 29, 2026
3 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.

2 participants