Skip to content

fix(setup): explain why no population agent launched, hide the empty transcript - #273

Open
Adarsh-Me wants to merge 1 commit into
mex-memory:mainfrom
Adarsh-Me:fix/269-empty-setup-transcript
Open

Adarsh-Me wants to merge 1 commit into
mex-memory:mainfrom
Adarsh-Me:fix/269-empty-setup-transcript

Conversation

@Adarsh-Me

Copy link
Copy Markdown

What

Closes #269. Stops the setup wizard from showing a session transcript for a run that never launched an agent, and says why the manual prompt appeared instead of reusing the generic waiting message.

Why

Read at main (54f7d7a5), the mechanism is exactly as #269 describes:

  • src/hub/setup/runner.ts:238 allocates a transcriptId for every run, and populationTool starts null (L248) and stays null when no CLI is found.
  • src/setup/population.ts returned { tool: null, completed: false } with no record of which agents were checked and missing.
  • src/setup/headless.ts:284 therefore always emitted "Setup is waiting for population…" whether or not anything had run.
  • packages/hub-web/src/pages/SetupPage.tsx:275 gated the panel on transcriptId alone, so an empty transcript appeared next to the manual prompt.

Change

  1. SetupPopulationLaunchResult gains unavailable: SetupAgentTool[] — the agents that were probed and not found, in the user's selection order. Agents after the chosen one are never probed, so they are absent; an empty list with tool: null means "no selected tool is one setup can drive", which is a different reason and now gets a different message.
  2. headless.ts selects between those two explanations, and keeps the existing waiting message when an agent really did run but did not finish.
  3. SetupPage.tsx:275 also requires currentRun.populationTool.
  4. selectSetupAgent now delegates to the shared picker, so the ordering rule lives in one place and each CLI is probed at most once.

Deliberately not changed: ProgressPanel (L602) still renders the transcript during the population step. populationTool is only set once the first activity record is parsed, so guarding there would blank the panel for an agent that is running. Easy to add if you disagree.

How to test

npm ci
npm run typecheck
npx vitest run src/setup/__tests__/population.test.ts src/setup/__tests__/headless.test.ts src/setup/__tests__/headless-population.test.ts
npx vitest run --root packages/hub-web src/app/setup-page.test.tsx
npm run build

Measured on Windows 11, node 24.21.0:

run with this diff source reverted, tests kept
3 src/setup files 1 failed | 59 passed | 1 skipped 6 failed | 21 passed
setup-page.test.tsx 27 passed 1 failed | 26 passed
npm run typecheck (contracts + root + hub-web) rc=0 —
npm run build rc=0 —

The single remaining failure, headless-population.test.ts:329 (expect(onActivity).not.toHaveBeenCalled()), reproduces on clean main in the same file set — it is not from this diff. The right-hand column is the control that shows the new tests actually bite: hides the session transcript when setup launched no agent, and the two headless message tests, all fail without the fix.

Two things I want to flag rather than bury

1. This diff is not assertion-neutral. Eight toEqual({ tool, completed }) assertions in headless-population.test.ts pin the whole result object, so adding unavailable took that file from 1 failure to 11. I only found it by running a base control over the same 15 files (Test Files 15 failed, identical per-file counts in 13/15) instead of assuming the red was pre-existing; two files differed, one of them was mine. Those 8 assertions are updated here.

2. The full suite is broadly red on Windows with or without this change — npm run test reports 21 of 298 files failing here (status.test.ts 3, git-port.test.ts 3, migrate.test.ts 5, several *.contract.test.ts). The check job runs on ubuntu only, so CI is the real gate; I am not claiming a green local suite.

jsdom limit

The new page test asserts the panel is absent for a run with populationTool: null. It does not reproduce the reporter's exact "This session produced no output." string — that copy needs the transcript batch to report done, and the fixture can only deliver a batch once the panel has subscribed. Pre-fix, the same test shows the region rendering with "Waiting for session output…", which is the same defect (a panel for a session that never existed) at an earlier stream state.

Checklist

AI-assisted (Qoder); every number above comes from commands run on this machine, and the diff was read line by line before pushing.

…transcript

The runner allocates a transcriptId for every run, but populationTool stays null
when no selected Claude Code / Codex CLI was found. SetupPage gated the transcript
panel on transcriptId alone, so a run that launched nothing rendered a finished,
empty transcript beside the manual prompt.

- require populationTool before rendering the wizard's transcript panel
- add `unavailable` to SetupPopulationLaunchResult (agents probed and missing, in
  selection order) and use it to pick between "no selected tool can do this
  automatically" and "<tool> was not found on PATH for this process"
- extend the tests that pin the launch result for the new field

Closes mex-memory#269
@Adarsh-Me

Copy link
Copy Markdown
Author

@theyashasvipandey @theDakshJaitly CI for this head (run 38045873943) has been waiting at action_required since 10:43Z; this account can't approve fork runs. Typecheck, build and the three focused vitest files ran locally, with the fail-without-fix control in the body, but ubuntu CI is the real gate. Six other open PRs are held the same way.

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.

Setup wizard shows an empty 'Session ended' transcript when no population agent was launched

2 participants