le-gpt-image v1.2:改图链路修复——native edits 对「过认证+大图上传」会被 RST(edit 改走 responses 兜底);responses 不再读 config.toml 模型(gpt-6.1-sol 带图像工具 500,固定默认 gpt-5.5,可 --model 覆盖);实测九鱼聚财水墨画补鱼成功(视觉复核 8→9 条)
This commit is contained in:
@@ -37,11 +37,6 @@ try:
|
||||
except ImportError: # Windows:无 flock,退化为无锁刷新
|
||||
fcntl = None # type: ignore[assignment]
|
||||
|
||||
try:
|
||||
import tomllib
|
||||
except ImportError: # Python < 3.11
|
||||
tomllib = None # type: ignore[assignment]
|
||||
|
||||
# 可选传输层:curl_cffi 以 Chrome TLS 指纹发请求。
|
||||
# chatgpt.com 的 Cloudflare 会质询 python-urllib/curl 的握手指纹(403 cf-mitigated: challenge),
|
||||
# Chrome 指纹(及 Codex/ChatGPT.app 的网络栈)不受影响。未安装时回退 urllib。
|
||||
@@ -447,15 +442,8 @@ def _reasoning_model(args: argparse.Namespace) -> str:
|
||||
return args.model
|
||||
if os.environ.get("CODEX_IMAGEGEN_MODEL"):
|
||||
return os.environ["CODEX_IMAGEGEN_MODEL"]
|
||||
config_file = _codex_home(args) / "config.toml"
|
||||
if tomllib is not None and config_file.exists():
|
||||
try:
|
||||
config = tomllib.loads(config_file.read_text(encoding="utf-8"))
|
||||
model = config.get("model")
|
||||
if isinstance(model, str) and model.strip():
|
||||
return model
|
||||
except (OSError, UnicodeError, Exception):
|
||||
pass
|
||||
# 注意:读 Codex config 的 model 字段曾踩坑——本机 config 里是 gpt-6.1-sol,
|
||||
# 它在内部 responses 端点带图像工具会 500。没显式指定时用实测可用的默认值。
|
||||
return DEFAULT_REASONING_MODEL
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user