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
Open
fix(runtime): suggest resume for an engine-known run ID only while its run directory exists (#1258)#1274aviggiano wants to merge 1 commit into
aviggiano wants to merge 1 commit into
Conversation
…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>
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
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.
RUN_ALREADY_EXISTSmessage always suggestsultrafuzz resume <id>. fix(runtime): refuse a run ID the workflow engine already records before planning (#1258) #1264 mainly targets a run removed withultrafuzz clean <id>. In that case the run directory is gone, soresumecannot work and the hint is wrong.cleanleaves the engine's record behind (cleanleaves task worktree registrations,ultrafuzz/<run>/*branches and the engine run record behind #1257).inspect --format jsonwithout--full-output, then uses ad hocisRecordchecks that accept both a bare and an{ok, data}shape. Every other inspect caller uses--format json --full-outputand reads the result withcommandPayload(...).Change
runsRootForProject(projectRoot), the same runs rootresumeuses....so it cannot be launched again; choose a different --run-id, or continue it with \ultrafuzz resume ``...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`inspect ultrafuzz-<id> --format json --full-outputand readscommandPayload(inspected.json)?.run. The two-shape handling is removed. It does not useparseCurrentSmithersInspect, which throws on a run with no recorded history.ultrafuzz-<id>. Any other answer lets the launch go ahead, and submission still rejects a duplicate.Tests
ultrafuzz resume, ends withchoose a different --run-id, no run directory is created, and nothing is submitted.ultrafuzz resume <id>hint.run.iddiffers fromultrafuzz-<id>, and the launch goes ahead (noRUN_ALREADY_EXISTS,upis submitted).--full-outputin the inspect command.pnpm typecheckfor runtime,pnpm -w knip, andESLINT_PLUGIN_DIFF_COMMIT=origin/unstable pnpm -w lint:strict:ci.🤖 Generated with Claude Code
The PR appears safe to merge; no actionable regression was established.
Summary
The PR reads the engine’s full-output inspection envelope and suggests
resumefor 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]Reviews (1) · Last reviewed commit: "fix(runtime): suggest resume for an engi..."