fix: skip share prompt when analysis parsing fails#65
Merged
Conversation
promptExport() was checking `if (!analysis)` but a parseFailed analysis still passes that — it's an object, just a useless one with zeroed scores and empty findings. So the CLI would happily ask "Share results?" and offer to copy a blank card to clipboard. Now we treat parseFailed the same as no analysis: skip the export menu entirely and tell the user to retry with `oasis analyze`.
pi3-code
approved these changes
Mar 5, 2026
Contributor
pi3-code
left a comment
There was a problem hiding this comment.
I pulled the branch, built it, ran the full test suite, and confirmed the bug locally. The parseFailed stub is truthy, so the previous guard was missing it. This fix works as expected.
Approving.
While reviewing I noticed two related spots where the same parseFailed stub leaks through:
- run-flow.ts:562 — printAnalysisSummary still runs on parseFailed, so the user may see a "STRATEGY ASSESSMENT" section with zeros right after the spinner reports failure.
- run.ts:360 — similar pattern.
I can open a small follow-up PR to guard these paths and add a test for promptExport.
4 tasks
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
When analysis fails to parse the LLM response,
promptExport()was still showing the "Share results?" menu because it only checkedif (!analysis)— but aparseFailedanalysis is still a truthy object, just one full of zeroed scores and empty findings. Nobody wants to copy a blank share card to their clipboard.Now
parseFailedanalysis is treated the same as no analysis: skip the export menu, tell the user to retry withoasis analyze <id>.Test plan