Skip to content

feat(code): include check for terminated for the instrumentation agent#2026

Open
k11kirky wants to merge 1 commit intomainfrom
05-05-feat_code_include_check_for_terminated_for_the_instrumentation_agent
Open

feat(code): include check for terminated for the instrumentation agent#2026
k11kirky wants to merge 1 commit intomainfrom
05-05-feat_code_include_check_for_terminated_for_the_instrumentation_agent

Conversation

@k11kirky
Copy link
Copy Markdown
Contributor

@k11kirky k11kirky commented May 5, 2026

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

  • Added a wizardCompleted boolean to the setup store along with a completeWizard action that sets it to true.
  • Refactored subscribeToWizardEvents to separate the run ID polling loop from the event subscription logic. After subscribing, it now continuously polls the task run status and calls completeWizard when a terminal status is detected (up to 30 minutes).
  • Exposed isWizardDone from useSetupRun and wired it into SetupView so the wizard feed displays the "Integration ready" done state when the wizard task finishes.

Copy link
Copy Markdown
Contributor Author

k11kirky commented May 5, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@k11kirky k11kirky marked this pull request as ready for review May 5, 2026 09:44
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 5, 2026

Prompt To Fix All With AI
Fix 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

Comment thread apps/code/src/renderer/features/setup/services/setupRunService.ts
Comment thread apps/code/src/renderer/features/setup/stores/setupStore.ts
@k11kirky k11kirky force-pushed the 05-05-feat_code_include_check_for_terminated_for_the_instrumentation_agent branch from 5477dcc to 673e72c Compare May 5, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants