Local text-to-image fallback violates the return_url contract

未关闭 适合新手
#10,388 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
backend

调研方向

从 astrbot/core/utils/t2i/renderer.py 开始,在不带 return_url 调用 LocalRenderStrategy.render(text) 的回退路径中,追踪远程策略和 Star.text_to_image 如何处理 return_url。阅读本地策略,以确定可远程访问的本地 URL 是否根本可行。完成标准:请求 return_url=True 的调用方永远不会收到文件系统路径——要么该标志在回退中保留,要么抛出明确的错误;用现有 t2i 测试验证或新增一个测试。

由索引模型根据 Issue 内容生成。

描述

The public Star.text_to_image(..., return_url=True) contract says the result is a URL. When the remote renderer fails, astrbot/core/utils/t2i/renderer.py falls back to LocalRenderStrategy.render(text) without forwarding return_url; the local strategy returns a filesystem path. Callers explicitly requesting a URL can therefore receive a local path that cannot be used as a remotely accessible image URL.

Please preserve the requested result kind through fallback, or return a clear error when a local URL cannot be provided.

主要语言
Python
星标
45.3k
派生
3.3k
平均合并
1 天 9 小时
30 天内合并 PR
124

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

AstrBotDevs/AstrBot 的其他 Issue

查看 AstrBotDevs/AstrBot 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。