Skip to content

fix(upgrade): return NETWORK_ERROR when latest version cannot be resolved - #700

Merged
Drswith merged 1 commit into
mainfrom
cursor/critical-quantex-cli-bugs-97f8
Sep 6, 2026
Merged

fix(upgrade): return NETWORK_ERROR when latest version cannot be resolved#700
Drswith merged 1 commit into
mainfrom
cursor/critical-quantex-cli-bugs-97f8

Conversation

@cursor

@cursor cursor Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

quantex upgrade crashed with an unstructured Error when self-upgrade planning could not resolve an installable latest version.

Impact: npm / bun / binary installs that run quantex upgrade during a registry or release-metadata failure lose the structured NETWORK_ERROR contract. Command runtime rethrows the error, so human and JSON modes both fail without a stable error code.

Trigger: latest-version inspection returns no installable target (check-unavailable). The application layer correctly returns a plan without mutating. The command layer only mapped that status under --check / dry-run, then threw Self-upgrade execution did not produce a result.

Root cause: plan-status dispatch was incomplete. --check / dry-run also treated every non-update-available status as NETWORK_ERROR, so a source / unknown install running --check was misclassified as a network failure.

Fix: map check-unavailable to structured NETWORK_ERROR on every upgrade entry, and map manual-required before the --check / dry-run branch. The executed-result throw remains only as a fail-closed invariant.

Linked Artifacts

  • OpenSpec: fix-upgrade-unresolved-latest-crash

Validation

  • bun run memory:check
  • bun run lint
  • bun run format:check
  • bun run typecheck
  • bun run test (if behavior changed) — 2113 passed, 5 skipped
  • bun run openspec:validate — 26 passed

Release Intent

  • Release: patch - bug fix

Release Summary

BEGIN_COMMIT_OVERRIDE
fix(upgrade): return NETWORK_ERROR when latest version cannot be resolved

qtx upgrade now reports a structured network error instead of crashing
when the latest CLI version cannot be determined. --check on a
non-auto-update install source keeps MANUAL_ACTION_REQUIRED.
END_COMMIT_OVERRIDE

Docs Updated

  • openspec/...

Scope Check

  • I did not add a new ad hoc root-level Markdown file.
  • I updated the relevant issue, ADR, spec, runbook, or captured the missing doc work as follow-up.
  • I did not silently expand project scope without recording it explicitly.

Closure Check

  • Working tree was clean after commit.
  • Branch was pushed and this PR is the active delivery artifact.
  • OpenSpec change is not needed, still active until this merge, active across milestone merges by design, queued for agent-driven archive closure after completion, or already archived.
  • Release is not applicable, delegated to release automation, or verified.

Notes

  • Remaining owner: archive fix-upgrade-unresolved-latest-crash after this PR merges.
  • Left alone: open Release identity recovery on #699 (follow-up to #698), and the still-active umbrella restore-managed-update-and-resume-releases confirmation tasks (1.11.x already published).
Open in Web View Automation 

…lved

Plain `quantex upgrade` crashed when planning could not resolve an
installable latest version. Map that plan to structured NETWORK_ERROR
and keep MANUAL_ACTION_REQUIRED under --check.
@cursor
cursor Bot force-pushed the cursor/critical-quantex-cli-bugs-97f8 branch from 5e03edc to b85a77b Compare September 6, 2026 11:36
@cursor

cursor Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Rebase note (P3 delivery): Rebased cursor/critical-quantex-cli-bugs-97f8 onto latest origin/main (includes #705). Replay was clean — no conflict resolution required.

Diff still scoped to upgrade NETWORK_ERROR / MANUAL_ACTION_REQUIRED + tests + OpenSpec fix-upgrade-unresolved-latest-crash only. No Core migration / config / capabilities / commands / schema / YAML / SDK expansion.

New head: b85a77b. Leaving draft; maintainer can mark ready after required CI is green.

@Drswith
Drswith marked this pull request as ready for review September 6, 2026 11:40
@Drswith
Drswith merged commit 60f4960 into main Sep 6, 2026
11 checks passed
@Drswith
Drswith deleted the cursor/critical-quantex-cli-bugs-97f8 branch September 6, 2026 11:42
cursor Bot pushed a commit that referenced this pull request Sep 6, 2026
Sync accepted self-upgrade NETWORK_ERROR / MANUAL_ACTION_REQUIRED
deltas into openspec/specs/ after #700, and remove the completed
change folder from the working tree.
Drswith added a commit that referenced this pull request Sep 6, 2026
* chore(openspec): archive fix-upgrade-unresolved-latest-crash

Sync accepted self-upgrade NETWORK_ERROR / MANUAL_ACTION_REQUIRED
deltas into openspec/specs/ after #700, and remove the completed
change folder from the working tree.

* chore(lifecycle): keep comment so archive PRs run macOS CI

Touch a kept src/lifecycle file so classify sets run_test_matrix=true
and protect-main's required test (macos-latest) actually runs.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
cursor Bot pushed a commit that referenced this pull request Sep 6, 2026
Keep --channel on the frozen upgrade contract alongside --check, dry-run,
JSON, aliases, exit codes, state v2, and #700 error codes. JSON still must
not leak engine or route.
Drswith added a commit that referenced this pull request Sep 6, 2026
…711)

* feat(upgrade): route plan/check/apply through in-repo Core (P6)

Move CLI upgrade orchestration into an in-repo Core executor while keeping
src/self domain modules and the CLI/self production bridge. Freeze JSON,
--check, error codes, aliases, and the unpublished SDK surface.

* chore(openspec): mark cli-core-upgrade-p6 validation tasks complete

* chore(upgrade): lock --channel freeze and internal changelog framing

Keep --channel on the frozen upgrade contract alongside --check, dry-run,
JSON, aliases, exit codes, state v2, and #700 error codes. JSON still must
not leak engine or route.

* chore(openspec): mark cli-core-upgrade-p6 channel freeze validation complete

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
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