mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-01 01:12:43 -05:00
fix: a failed Codex turn shows a raw object as the error instead of Codex's message (#35385)
When Codex failed a turn, the reply's error showed Codex's whole error object, field names and all, instead of the reason. The error now shows Codex's own message, the same way Claude Code and Pi failures show theirs. Fixes #35381
This commit is contained in:
1 parent
82ab95e420
commit
3d6a092c76
1 file changed
+2
-2
@@ -173,7 +173,7 @@ async def run(transport, output, prompt, images, options):
|
||||
if turn.get('id') != turn_id:
|
||||
continue
|
||||
if turn.get('status') == 'failed' or turn.get('error'):
|
||||
raise ValueError(str(turn.get('error') or 'Codex turn failed'))
|
||||
raise ValueError((turn.get('error') or {}).get('message') or 'Codex turn failed')
|
||||
return
|
||||
elif method == 'thread/tokenUsage/updated':
|
||||
usage = (params.get('tokenUsage') or {}).get('last') or {}
|
||||
@@ -187,7 +187,7 @@ async def run(transport, output, prompt, images, options):
|
||||
if native in usage
|
||||
}
|
||||
elif method == 'error' and not params.get('willRetry'):
|
||||
raise ValueError(str(params.get('error') or params))
|
||||
raise ValueError((params.get('error') or {}).get('message') or str(params))
|
||||
except asyncio.CancelledError:
|
||||
if thread_id and turn_id:
|
||||
with contextlib.suppress(Exception):
|
||||
|
||||
Reference in new issue
Block a user