Repository navigation
fix(vscode): show partial and failed reviews as failed, not "No issues found" - #1882
Conversation
…s found" ocr review reports the manifest terminal state (complete, partial, failed, skipped), but resultToState only recognised completed_with_errors, so a partial review with no findings was shown as a clean pass.
|
🔍 OpenCodeReview found 2 issue(s) in this PR.
|
| // `ocr review` reports the manifest terminal state (complete | partial | failed | skipped); | ||
| // completed_with_errors is the manifest-less status. None of these is a clean pass. | ||
| const INCOMPLETE_STATUSES: ReadonlySet<string> = new Set(['completed_with_errors', 'partial', 'failed']); |
There was a problem hiding this comment.
The comment states "None of these is a clean pass", implying skipped should also be treated as incomplete/failed. However, skipped is not included in INCOMPLETE_STATUSES, and the test at line 14-15 confirms that skipped maps to 'empty' rather than 'failed'. Either the comment is misleading and should clarify that skipped is intentionally excluded (e.g., "None of the error statuses is a clean pass"), or skipped should be added to the set.
|
|
||
| // `ocr review` reports the manifest terminal state (complete | partial | failed | skipped); | ||
| // completed_with_errors is the manifest-less status. None of these is a clean pass. | ||
| const INCOMPLETE_STATUSES: ReadonlySet<string> = new Set(['completed_with_errors', 'partial', 'failed']); |
There was a problem hiding this comment.
The CliResult.status type (defined in shared/types.ts) only includes 'success' | 'completed_with_errors' | 'completed_with_warnings' | 'skipped', but this set also checks for 'partial' and 'failed'. While the runtime behavior is correct (the set is ReadonlySet<string> so it accepts any string), the type definition is out of sync with actual CLI output. The tests confirm this by needing as any casts for these values.
Consider updating CliResult.status to include 'partial' | 'failed' (and potentially 'complete') so that callers get proper type coverage and the as any casts in tests can be removed.
|
Please preserve access to the review process logs before merging this PR. The status correction is right, but it also changes which result view is displayed in the VS Code extension sidebar (not the standalone HTML result viewer):
The logs remain in frontend state; the new result view simply does not expose them. See the different props passed to the two views in App.tsx and the current FailedView. Please keep the corrected failed state and CLI message, pass the existing logs into AI assistance disclosure: drafted with Codex; the model identifier is not available in this session. |
|
@divya0795 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. |
A partial review with no comments now reaches FailedView instead of EmptyView. FailedView had no log viewer, so the run's process log, still held in webview state, could no longer be opened. Pass state.logs to FailedView and give it the same expandable "Process log" disclosure as EmptyView and DoneView, with a view.failed.processLog string in every locale. Add a regression test that drives the reducer through a partial run and renders FailedView (preact-render-to-string, dev-only) to check the toggle is offered. Also reword the ReviewSession status comment, which read as if complete and skipped were not clean passes.
NanaseInori
left a comment
There was a problem hiding this comment.
The status correction is justified: a partial review without findings must not be presented as a clean result. I checked the two-file diff, SidebarProvider's callbacks, the frontend reducer and the destination view. The reducer preserves the failed state when reviewDone arrives, so the new routing does take effect.
[P2] Preserve the existing process-log access on the new failure path. The maintainer's earlier request remains unresolved at this head. App.tsx passes logs to EmptyView but supplies only error/onRetry to FailedView, and FailedView contains no log viewer. Consequently the newly rerouted partial/zero-finding result loses the post-run diagnostics that were previously accessible, precisely when users need to inspect the failed groups.
Please keep the corrected status and CLI message, pass the retained logs into FailedView, render an expandable log viewer, and add a frontend regression proving that a completed partial run remains failed while its logs stay accessible. The existing helper/session tests cannot detect this view-level regression.
References: maintainer request, view routing, FailedView.
The symptom-focused duplicate search returned only this PR. The stale shared status union and the comment wording can be cleaned up, but they are not the runtime blocker described above. This was a source review; I did not run the extension suites locally.
This review was conducted by NanaseInori's review bot, using the model GPT-6 Astra Pro. If you need a human review, please manually @NanaseInori.
abhisheksharma2411
left a comment
There was a problem hiding this comment.
Nice find — the before/after table made this easy to follow, and keeping the process log reachable from the failed view is a good addition.
Two things I noticed while reading, both about the IntelliJ side you're matching.
The supportedReviewStatuses clause didn't come across. ReviewSession.kt has two rules, and the first one runs before the comments check:
result.status !in supportedReviewStatuses -> ReviewState.FAILED
result.comments.isNotEmpty() -> ReviewState.DONE
result.status in setOf("completed_with_errors", "partial", "failed") -> ReviewState.FAILED
else -> ReviewState.EMPTYwith the comment "Only recognized, non-failing terminal results can report an empty review." The TS version after this PR falls through to 'empty' for anything it doesn't recognise, so a status outside the set and no comments still shows "No issues found" — the same shape as the bug you're fixing. An empty status from a truncated JSON read lands there too. Adding a known-statuses set and failing on anything outside it would close that, and it's a couple of lines.
The type still says partial can't happen. CliResult.status in shared/types.ts is 'success' | 'completed_with_errors' | 'completed_with_warnings' | 'skipped' — no complete, partial or failed, which is why each new test needs status: 'partial' as any. supportedReviewStatuses on the Kotlin side lists all seven, and output.go can emit all seven ("success" at :361 and :381, completed_with_errors / completed_with_warnings at :420-422, and the four manifest states at :405). Widening the union would drop the casts and let INCOMPLETE_STATUSES be typed rather than ReadonlySet<string>.
Small one: expect(html).toContain('Process log') pins the English copy, and the logs-toggle assertion on the next line already covers that the toggle rendered — worth dropping one of them so a reworded string doesn't fail the test.
I read the code rather than ran it, so take the first one as "this is what the three lines do" rather than a reproduction.
resultToState fell through to 'empty' for any status it did not know, so a result with a missing or unrecognized status and no comments still showed "No issues found". Mirror the IntelliJ plugin's resultToState: only a recognized, non-failing status may report an empty review; a missing or unknown one is a failure, checked before the comments. Widen CliResult.status to the seven statuses cmd/opencodereview/output.go emits (adds complete, partial and failed), type both status sets, and drop the `as any` casts the tests needed for those values. The FailedView test no longer pins the English "Process log" label; the logs-toggle assertion already covers that the toggle rendered.
|
Thanks for the reviews. Both follow-ups are pushed. Process log on the failed view, for @lizhengfeng101 and NanaseInori's review:
IntelliJ parity and the status type, for @abhisheksharma2411:
Local results on Node 24.22.1:
The workflow runs on this PR are waiting for approval because this is my first contribution here. Could a maintainer approve them? AI disclosure: these changes and this reply were drafted with Claude Code (Claude Opus 5.5). |
Description
The VS Code extension shows a partially failed review as "No issues found".
ocr review --format jsonreports the manifest terminal state instatus:complete,partial,failedorskipped(cmd/opencodereview/output.go:403-405, values frominternal/session/manifest.go:166-169).completed_with_errorsis only set when there is no manifest, which is theocr scanpath.resultToStatein the extension only checks forcompleted_with_errors:partialexits 0 by design (reviewResultError,review_cmd.go:339-345), so the CLI promise resolves normally. Example: 2 of 5 selected files fail with an LLM error and the other 3 have no findings. The result isstatus: "partial"with no comments, and the sidebar shows the empty "No issues found" view. Three files were never reviewed. The IntelliJ plugin already treatspartial/failedas failed (extensions/idea/.../services/ReviewSession.kt:15-25).Fix: treat
completed_with_errors,partialandfailedas not-clean when there are no comments. Also pass the CLI'smessageto the failed state, so the Failed view says why. That matches what the IntelliJ side does. Results with comments still show asdone, andcomplete/skipped/successwithout comments still show the empty view.Behaviour before and after, for every status (output of a throwaway jest run against the old and new
resultToState):(
failednormally exits non-zero and is caught as an error already. It is listed for completeness.)To confirm that the CLI emits the manifest vocabulary, here is a real run of
ocr review --format json --audience agentbuilt frommain, against an unreachable LLM endpoint:Out of scope: the shared
CliResult.statusunion inextensions/frontend/src/shared/types.tsstill lists the older values. I left it alone because open PRs #1379 and #1519 touch that file. TheSet<string>check here needs no type change.Type of Change
How Has This Been Tested?
Added 4
resultToStatecases and 1ReviewSession.runcase. Before the fix, 3 of them failed (partial/failedwithout comments →"empty", andrunreported no failure). After the fix, all pass.Ran the
vscode-extCI steps locally on Node 24.22.1, the version CI uses:yarn install --frozen-lockfile,yarn lint,yarn compileandyarn test. Baseline onmainwas 11 suites / 99 tests passing. With the fix it is 11 suites / 104 tests passing, lint is clean and the compile succeeds.make testpasses locally (Go side untouched; the extension's own CI gate is above)Manual testing (describe below)
Checklist
go fmt,go vet)AI disclosure: I found this issue and drafted the fix and tests with Claude Code (Claude Opus 5.5). The commit has no AI attribution.
Related Issues
None. I searched issues and PRs for "resultToState", "No issues found partial", "vscode partial review" and "partial status vscode empty" and found nothing. No open PR touches
ReviewSession.ts.🤖 Generated with Claude Code