Skip to content

fix(task): a run whose given instance id can't be registered fails instead of running unrecorded - #251

Merged
AlexS-scale merged 1 commit into
mainfrom
AlexS/register-failure-fails-run
Oct 19, 2026
Merged

AlexS-scale merged 1 commit into
mainfrom
AlexS/register-failure-fails-run

Conversation

@AlexS-scale

@AlexS-scale AlexS-scale commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

register_task_instance catches every exception and returns None, and Task.run then sets instance_id = None, even when the caller passed one. One brief store error at the start of a run means:

  • the run executes with no record, though the caller (a runner, the explorer) already handed that id out as the run's link;
  • retry rollbacks are refused, since there is no instance to undo through;
  • ids derived from the instance id are random.

A runner wants an error here instead, so it can fail the run or let its engine retry it.

Now, with a caller-supplied instance_id, a registration failure raises out of Task.run before any step runs. Without one (the CLI, which mints none), it is still logged and the run goes unrecorded, as before. The upsert's "disappeared during re-register" error is no longer swallowed either.

Test: registering a given id when the store fails raises. It fails on main.

RetriggerView in GreptileConfidence Score: 5/5

This PR appears safe to merge.

Summary

register_task_instance now raises registration errors when the caller supplied an instance_id.

  • Runs with a supplied ID stop when instance registration fails.

Reviews (1) · Last reviewed commit: "fix(task): a run whose given instance id..." · Reviewed by Greptile

@AlexS-scale
AlexS-scale requested a review from a team as a code owner October 19, 2026 15:47
@AlexS-scale
AlexS-scale merged commit d822ea7 into main Oct 19, 2026
14 checks passed
@AlexS-scale
AlexS-scale deleted the AlexS/register-failure-fails-run branch October 19, 2026 23:51
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.

2 participants