Skip to content

autoskillit update exits 20 (failed-upgrade) after a successful update, and on an already-current install #5340

Open

Description

@Trecek

Problem

On the dev (branch) channel, a successful autoskillit update prints AutoSkillit updated successfully. and then exits 20 (failed-upgrade). After success, the command re-executes itself with its original arguments. The second invocation runs update again under the newly installed release, finds previous, observed and target commits all equal, and rejects the unchanged advance verdict.

Separately, running autoskillit update when already current also exits 20. Scripts and operators therefore see a failure for a successful update, and for a no-op update.

Reproduction (verified 2026-10-30, real packages in a scratch Docker home)

Environment:

  • Old: pristine develop-track 0.10.1013 (5c4924749b3b52fabc487233c3747e511ab35512).
  • Target: 0.10.1306 (f84bae324c3497ec0851d5ac887770d0e895fbad), supplied through a scratch Git mirror.
  1. Install the old release. Run autoskillit update.
    • Observed: the candidate is installed and published, and the entrypoint pivots.
    • AutoSkillit updated successfully. is printed.
    • Then: Upgrade advance verdict unchanged on branch channel ..., AutoSkillit update did not complete (failed-upgrade)., exit 20.
  2. Run autoskillit update again on the now-current candidate.
    • Observed: exit 20 in about 11 s, with previous, observed and target all equal to f84bae324....
  3. Check the candidate.
    • Observed: autoskillit --version and autoskillit doctor exit 0. The installed direct_url.json records the target commit.

Evidence

  • src/autoskillit/cli/update/_update.py:64 calls perform_restart() after success.
  • src/autoskillit/cli/update/_restart.py:12 runs os.execv(sys.executable, [sys.executable] + sys.argv), re-running the original update arguments.
  • src/autoskillit/cli/update/_transaction.py:165-170 formats the unchanged advance verdict that the second run treats as failure.
  • _update.py and _restart.py are identical in 0.10.1013 and the current develop. Upgrades from already-shipped releases hit this through the old caller plus the new callee.

Impact

  • Every successful dev-channel update ends with a failure exit code and a contradictory message.
  • An already-current autoskillit update is reported as a failed upgrade.
  • Automation that checks the exit status will treat working installs as broken.

Expected behavior / acceptance criteria

  • A successful update exits 0. The post-update restart must not re-run the update transaction. Consider whether a restart is needed at all for update.
  • autoskillit update on an already-current install reports "already up to date" and exits 0.
  • These outcomes hold when an older release's updater installs the new release. The new release's handling of a re-executed update must cope with the old caller.
  • A regression test exercises the real restart and exec boundary. Existing updater tests mock perform_restart.

Related

Activity

  1. added
    bugExisting behavior is broken
    recipe:remediationRoute: investigate/decompose before implementation
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugExisting behavior is brokenrecipe:remediationRoute: investigate/decompose before implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions