fix: mutable defaults + clean error handling in hypothesis refiner#88
Closed
DavidJBianco wants to merge 2 commits into
Closed
fix: mutable defaults + clean error handling in hypothesis refiner#88DavidJBianco wants to merge 2 commits into
DavidJBianco wants to merge 2 commits into
Conversation
The inner try/except in refiner() was printing to stdout (garbling parseable output) and re-raising as a generic Exception, discarding the original type. Remove it so exceptions propagate with their native type and traceback intact. Add a single exception handler at the CLI boundary in main() that prints a concise message to stderr, shows the full traceback with --verbose, and exits with code 1. Supersedes PR #77. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Author
|
Merged into dev via fast-forward (batch-d-refiner-fixes chain). |
This was referenced Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two fixes to
hypothesis_assistant/hypothesis_refiner_cli.pyand four other assistant entrypoints, applied in dependency order:Commit 1 — Mutable default
previous_run(supersedes #83)Replaces
previous_run: list = list()withprevious_run: Optional[list] = Noneacross all five assistant entrypoints:able_assistant/__init__.pydata_assistant/__init__.pyhypothesis_assistant/hypothesis_refiner_cli.pyplanning_assistant/__init__.pyresearch_assistant/__init__.pyAll call sites already guard with
if previous_run:so the change is behavior-preserving.Commit 2 — Remove double-wrap in
refiner(), add clean CLI error boundary (supersedes #77)Root cause:
refiner()had an innertry/exceptthat (a) printed to stdout (garbling parseable CLI output), (b) re-raised as a genericException, discarding the original type and making narrow handling impossible for any caller.Fix:
try/exceptfromrefiner()entirely. Exceptions now propagate with their native type and full traceback intact.try/except Exceptionat the CLI boundary inmain()aroundasyncio.run(refiner(...)). On failure: prints a concise message to stderr, shows the full traceback with--verbose, exits with code 1.This is the correct layer for this handler — a CLI's job is to not dump tracebacks at users by default, not to discriminate between autogen/provider exception types.
Closes #77 and #83 (both superseded).
Test plan
python3 -m compileall peak_assistant— passes--verbose— should print full traceback🤖 Generated with Claude Code