Skip to content

fix: reuse installed agent when update check fails - #91

Closed
nexicturbo wants to merge 1 commit into
monk-io:mainfrom
nexicturbo:fix/offline-local-agent-fallback
Closed

fix: reuse installed agent when update check fails#91
nexicturbo wants to merge 1 commit into
monk-io:mainfrom
nexicturbo:fix/offline-local-agent-fallback

Conversation

@nexicturbo

Copy link
Copy Markdown

Summary

  • fall back to a non-empty, previously checksummed local monk-agent when update discovery is temporarily unavailable
  • keep first installs fail-closed when no valid local installation exists
  • apply the behavior consistently to the root, packaged, and Antigravity PowerShell/POSIX scripts
  • exercise the offline fallback on Windows, macOS, and Linux in the existing install E2E workflow

Why

The ensure scripts currently fetch the remote archive checksum before consulting the installed binary and checksum sidecar. A cold start therefore aborts during any transient DNS, TLS, captive-portal, network, or get.monk.io failure, even after a successful prior installation.

The fallback only applies when the target is non-empty and the existing sidecar contains a valid 64-character SHA-256 value. An unavailable update endpoint still causes a hard failure when no previously checksummed local installation exists.

Validation

  • reproduced the original Windows failure with an installed v0.1.45 agent and an unreachable update endpoint
  • verified the updated PowerShell bootstrap returns the installed agent with the endpoint unavailable
  • verified an empty install directory still exits non-zero under the same outage
  • verified the normal online checksum/update path still returns the installed agent
  • verified all three distributed PowerShell copies and all three POSIX copies are byte-identical
  • parsed .github/workflows/install-e2e.yml and ran git diff --check

Fixes #90

@nexicturbo
nexicturbo force-pushed the fix/offline-local-agent-fallback branch from 314aeb8 to 6852e9d Compare July 22, 2026 02:18
@nexicturbo

Copy link
Copy Markdown
Author

Rebased onto v0.1.46 (a4c9972). The three POSIX copies and three PowerShell copies remain byte-identical by platform; shell syntax, PowerShell AST parsing, and git diff --check pass. Ready for maintainer workflow approval/review.

@nexicturbo

Copy link
Copy Markdown
Author

Rebased onto current v0.1.49 (64e8a0f) and revalidated the updated branch. PowerShell AST parsing, POSIX shell syntax, workflow YAML parsing, distributed-script identity checks, and git diff --check all pass. The PR remains mergeable and is ready for maintainer review.

Reuse an installed agent when the update endpoint is unavailable only if its current SHA-256 still matches the stored checksum. Keep all shipped script copies aligned and add Unix/Windows corruption regressions.
@nexicturbo
nexicturbo force-pushed the fix/offline-local-agent-fallback branch from 64e8a0f to 7273945 Compare August 2, 2026 17:57
@nooga

nooga commented Aug 9, 2026

Copy link
Copy Markdown
Member

Closing as already shipped — your fix was ported into the plugin via monk-agent's ENG-422 work (commit ac9fe06), which credits this PR directly. The offline checksum fallback is now in both the .sh and .ps1 launchers with regression tests.

Correct diagnosis and correct fix; that's recorded in triage. Thanks.

@nooga nooga closed this Aug 9, 2026
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.

[Bug bounty] cold start fails offline despite a verified local agent

2 participants