galaxyproject / galaxyproject/loom
Invocation display: step/job counts never populate (completed_steps always 0)
- Dominant language
- TypeScript
- Stars
- 14
- Forks
- 12
- Avg merge
- 6d 5h
- Merged PRs (30d)
- 17
Description
## Summary
The Galaxy workflow invocation display shows an inaccurate count of incomplete steps. Invocations that have effectively finished still report unfinished steps (e.g. `5/8 steps`), because the step-completion count is derived purely from per-step *jobs* and ignores steps that have no jobs.
## Where
- Count computed in `extensions/loom/tools.ts` (~L723–769), written to the `loom-invocation` block as `total_steps` / `completed_steps`.
- Rendered in `app/src/renderer/galaxy-invocations.ts` (~L113) as `${completedSteps}/${totalSteps} steps`.
## Root cause
```ts
let completedSteps = 0;
for (const invStep of inv.steps) {
let stepJobs = 0, stepOk = 0;
for (const job of invStep.jobs) {
stepJobs++;
if (job.state === "ok") stepOk++;
// ...
}
if (stepJobs > 0 && stepJobs === stepOk) completedSteps++; // <-- guard
}
// ...
totalSteps: inv.steps.length, // counts ALL steps, including job-less ones
completedSteps,
```
`totalSteps = inv.steps.length` counts **every** invocation step, but `completedSteps` only increments when `stepJobs > 0 && stepJobs === stepOk`. Galaxy invocation steps for **inputs, parameters, subworkflows, and collection operations produce no jobs**, so the `stepJobs > 0` guard means they can *never* be counted complete. They stay permanently in the "incomplete" bucket → the denominator includes steps the numerator structurally cannot reach.
Result: `total_steps - completed_steps` overstates incomplete steps by the number of job-less steps, even after the workflow is fully done.
Secondary issue: `GalaxyInvocationStep` exposes its own `state` field (`scheduled`, `new`, `ready`, …) in `galaxy-api.ts`, but the counting logic ignores it and rolls up `step.jobs` instead. The step's own scheduling state is the authoritative signal for "is this step done."
## Expected
Step completion should reflect Galaxy's per-step invocation state, not just job rollup. A step with no jobs that Galaxy reports as `scheduled` should count as complete.
## Suggested fix
Count completion from `invStep.state` (treat `scheduled` — and any terminal state — as done), and only fall back to job rollup for steps where the state is ambiguous. Or, at minimum, treat job-less steps as complete rather than excluding them from the numerator while including them in the denominator.
## Repro
1. Run any Galaxy workflow that has input/parameter steps (most do).
2. Watch the invocation card in Orbit.
3. Once all tool jobs are `ok`, the card still shows fewer completed steps than total (the input/parameter steps are never counted).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in extensions/loom/tools.ts around lines 723–769, then inspect GalaxyInvocationStep.state in galaxy-api.ts and the display in app/src/renderer/galaxy-invocations.ts around line 113. Reproduce with a workflow containing input or parameter steps and compare the stored total_steps/completed_steps values with each step's state. Done means job-less steps reported complete by Galaxy no longer remain in the incomplete count.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100