feat(code): include check for terminated for the instrumentation agent#2026
Open
feat(code): include check for terminated for the instrumentation agent#2026
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
apps/code/src/renderer/features/setup/services/setupRunService.ts:412-419
**All terminal statuses show "Integration ready"**
`completeWizard()` is called for every terminal status, including `failed`, `cancelled`, and `terminated`. This means a wizard that crashes or is cancelled will display "Integration ready" in the UI, giving users a false signal of success. Compare the discovery flow, which distinguishes `completed` from `failed`/`cancelled` and calls separate `finishSuccess`/`finishFailure` handlers. The wizard polling should only call `completeWizard()` when `taskRun.status === "completed"`, and handle error statuses separately (e.g., with an error state or at minimum by not marking the wizard as done).
### Issue 2 of 2
apps/code/src/renderer/features/setup/stores/setupStore.ts:169-172
The `log.info` call here is redundant — the service already logs `"Wizard task reached terminal status"` with richer context (`taskId`, `runId`, `status`) right before calling `completeWizard()`. Having the same message logged twice (once with context, once without) violates the OnceAndOnlyOnce rule and adds noise to logs.
```suggestion
completeWizard: () => {
set({ wizardCompleted: true });
},
```
Reviews (1): Last reviewed commit: "feat(code): include check for terminated..." | Re-trigger Greptile |
5477dcc to
673e72c
Compare
jonathanlab
approved these changes
May 5, 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.

Problem
The wizard feed's "done" state was hardcoded to
false, meaning the UI never reflected when the wizard had actually completed, even after the underlying task reached a terminal status.Changes
wizardCompletedboolean to the setup store along with acompleteWizardaction that sets it totrue.subscribeToWizardEventsto separate the run ID polling loop from the event subscription logic. After subscribing, it now continuously polls the task run status and callscompleteWizardwhen a terminal status is detected (up to 30 minutes).isWizardDonefromuseSetupRunand wired it intoSetupViewso the wizard feed displays the "Integration ready" done state when the wizard task finishes.