Skip to content

fix(runtime): suggest resume for an engine-known run ID only while its run directory exists (#1258) - #1274

Open
aviggiano wants to merge 1 commit into
unstablefrom
fix/1258-run-exists-message
Open

aviggiano wants to merge 1 commit into
unstablefrom
fix/1258-run-exists-message

Conversation

@aviggiano

@aviggiano aviggiano commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

This is a follow-up to #1264 (issue #1258). It fixes two problems in the check that refuses a run ID the workflow engine already records, before planning starts.

Change

  • The resume hint now appears only when the run directory exists. The check looks in runsRootForProject(projectRoot), the same runs root resume uses.
    • Directory exists: ...so it cannot be launched again; choose a different --run-id, or continue it with \ultrafuzz resume ``
    • Directory is gone: ...so it cannot be launched again, even though its run directory is gone (\ultrafuzz clean` leaves the engine's record behind); choose a different --run-id`
  • The check now runs inspect ultrafuzz-<id> --format json --full-output and reads commandPayload(inspected.json)?.run. The two-shape handling is removed. It does not use parseCurrentSmithersInspect, which throws on a run with no recorded history.
  • Fail-open behavior is unchanged. The launch is refused only when the engine reports exactly ultrafuzz-<id>. Any other answer lets the launch go ahead, and submission still rejects a duplicate.
  • No new diagnostic codes, flags or config.

Tests

  • The two-shape loop is replaced by one envelope test:
    • Run directory missing (the cleaned case): the message has no ultrafuzz resume, ends with choose a different --run-id, no run directory is created, and nothing is submitted.
    • Run directory present: the message ends with the ultrafuzz resume <id> hint.
  • New test: the engine reports a run whose run.id differs from ultrafuzz-<id>, and the launch goes ahead (no RUN_ALREADY_EXISTS, up is submitted).
  • The existing new-run test now expects --full-output in the inspect command.
  • Passed locally: the three targeted runtime tests, eslint and prettier on the changed files, pnpm typecheck for runtime, pnpm -w knip, and ESLINT_PLUGIN_DIFF_COMMIT=origin/unstable pnpm -w lint:strict:ci.

🤖 Generated with Claude Code

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable regression was established.

Summary

The PR reads the engine’s full-output inspection envelope and suggests resume for an engine-known run ID only while its run directory exists. Tests cover missing and present directories, a mismatched engine run ID, and the updated inspection arguments.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Start with run ID] --> B{Engine database exists?}
  B -- No --> P[Continue planning]
  B -- Yes --> C[Inspect with full-output]
  C --> D{Exact run ID reported?}
  D -- No --> P
  D -- Yes --> E{Run directory exists?}
  E -- Yes --> F[Refuse launch; suggest different ID or resume]
  E -- No --> G[Refuse launch; suggest different ID]
Loading

Reviews (1) · Last reviewed commit: "fix(runtime): suggest resume for an engi..."

…s run directory exists (#1258)

- RUN_ALREADY_EXISTS from the pre-planning engine check now suggests
  `ultrafuzz resume <id>` only when the run directory exists; after
  `ultrafuzz clean <id>` it says the engine still records the ID (#1257)
  and to choose a different --run-id
- read the check's inspection with `--format json --full-output` and
  commandPayload, like every other inspect caller, and drop the bare/
  enveloped dual-shape reading
- tests: one envelope refusal test covering both message variants, and a
  launch that goes ahead when the engine reports a different run ID

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@aviggiano
aviggiano requested a review from a team as a code owner October 2, 2026 18:07
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.

1 participant