You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Do not post_process before finally in ModelOutputThunk.astream #577
#355 introduces a finally block that does mot post-processing prior to propagating exceptions. The motivation is to log failures.
Problem: the post-process functions in backends make heavy implicit assumptions about system invariants. It is in fact extremely rare that post-process will succeed when there was an exception thrown during generation. As a result, actual exceptions thrown during generation are swallowed silently and obscure key errors are thrown instead.
Solution: there is none; if an exception is encountered during generation, there is no "safe" way of getting a partial post-process done because we do not know at that point what might've gone wrong. The finally block should be removed and exceptions should be allowed to be raised during generation.
Activity
Hack in lieu of generative-computing#577
psschwei commentedon Mar 5, 2026
finally block in question:
mellea/mellea/core/base.py
Lines 338 to 362 in 4cc75c8
psschwei commentedon Mar 6, 2026
Fixed in #580