Skip to content

A failed run offers "Fix with AI": a chat session that finds the cause and proposes a fix - #71

Merged
endrix merged 1 commit into
mainfrom
feat/fix-run-with-ai
Oct 2, 2026
Merged

endrix merged 1 commit into
mainfrom
feat/fix-run-with-ai

Conversation

@endrix

@endrix endrix commented Oct 2, 2026

Copy link
Copy Markdown
Owner

A failed run used to say only "Workflow run failed (exit code N). See the run output.". It also did not refresh the diagram, so the error marks (#70) waited for something else to redraw it.

Now, when a run fails

Fix with AI starts a task in that diagram's chat: a new session in plan mode, named for where it failed (Fix: x (in m › i)). Its first message is the failure:

  • the node and the nested workflows it is in, with the instance path;
  • the error;
  • the end of the run's stderr, i.e. its traceback, kept as the run writes it (appendTail, last 8 KB);
  • the run directory;
  • when the product can resume runs (cliResumeArgs), a note that the run can be resumed from the failure once fixed.

Plan mode because the person asked for a diagnosis and a proposal, not for files to change under them. They switch to build to apply it. The panel sends the message as if typed, so it appears in the transcript like any other.

Wiring

  • The run driver's host gains startChatTask, set only when the profile has a chat.
  • It goes to ChatRuntime.startTask, which posts chat.startTask to the panel on that diagram.
  • The panel opens, creates the named session in the task's mode, and sends the message once the session exists.
  • Without a chat, a failed run is reported and only Show Output is offered.

Tests

  • run-failure.test.ts (6): where, headline, stderr tail, prompt contents, and no resume note when the run cannot be resumed.
  • cli-run-driver-fix-with-ai.test.ts (3): a failing run with a real run record and traceback; the offer; the plan-mode task with path, traceback and resume note; no offer without a chat.
  • chat-panel-start-task.test.ts (3): session created in mode and name, message sent once after creation, and the task dropped if creation is aborted.

All workspaces pass, with neutrality 5/5 and typecheck 5/5.

https://claude.ai/code/session_015VK7fH1c4aKbexnq2QcuKU

…e and proposes a fix

A failed run said only "Workflow run failed (exit code N). See the run
output." -- and did not refresh the diagram, so the error marks waited for
something else to redraw it. Now the diagram is refreshed, and the
notification says where it failed and what (`Run failed in x (in m › i):
ValueError: …`, from the run record's error and instance path).

With a chat behind the diagram it also offers "Fix with AI". Taking it
starts a task in that diagram's chat: a new session in plan mode, named
for where it failed, whose first message is the failure -- the node and
the nested workflows it is in, the error, the end of the run's stderr (its
traceback, kept as the run writes it), the run directory, and, when the
product can resume runs, that the run can be resumed from the failure once
fixed. Plan mode: the person asked for a diagnosis and a proposal, not for
files to change under them. The panel sends the message as if typed, so
it is in the transcript like any other.

The path: the run driver's host gains `startChatTask`, set only for a
profile with a chat; it reaches `ChatRuntime.startTask`, which posts
`chat.startTask` to the panel on that diagram. Without a chat, a failed run
is reported and nothing is offered.

Claude-Session: https://claude.ai/code/session_015VK7fH1c4aKbexnq2QcuKU
@endrix
endrix merged commit a3375ce into main Oct 2, 2026
1 check passed
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