Skip to content

feat: daemon self-update with version mismatch detection#83

Merged
vreshch merged 1 commit intomasterfrom
feature/daemon-self-update
Mar 29, 2026
Merged

feat: daemon self-update with version mismatch detection#83
vreshch merged 1 commit intomasterfrom
feature/daemon-self-update

Conversation

@vreshch
Copy link
Copy Markdown
Contributor

@vreshch vreshch commented Mar 29, 2026

Summary

  • Adds agentage update command that checks npm for latest version, installs it, and restarts the daemon
  • Auto-detects version mismatch between CLI and running daemon on every command — restarts stale daemon automatically
  • Shows "Update available" notice after CLI commands (npm check cached 24h)
  • Sends daemonVersion in heartbeat payload so hub always knows the running version
  • Lock file prevents concurrent update attempts

Changes

File Change
src/utils/update-checker.ts New — npm registry query + 24h cache + version comparison
src/commands/update.ts New — agentage update / agentage update --check
src/utils/ensure-daemon.ts Version mismatch detection → auto-restart
src/cli.ts Register update command + background update check notice
src/hub/hub-sync.ts Send daemonVersion in heartbeat
src/hub/hub-client.ts Updated heartbeat type with daemonVersion + latestCliVersion response

Companion PR

  • agentage/web — dashboard "update available" badge + /api/cli/latest endpoint

Test plan

  • All 333 existing tests pass
  • 7 new tests for update-checker (cache TTL, version comparison, network failure)
  • Type-check clean
  • Build succeeds
  • Manual: agentage update --check shows version info
  • Manual: version mismatch triggers daemon restart

- `agentage update` command: checks npm registry, installs update, restarts daemon
- Version mismatch detection in ensure-daemon: auto-restarts stale daemon
- Update-available notice after every CLI command (cached 24h)
- Send daemonVersion in heartbeat payload to hub
- Lock file prevents concurrent updates
@github-actions
Copy link
Copy Markdown
Contributor

🎉 PR Validation ✅ PASSED

Commit: 0d634542704646f62e646bc3e3f954829c60f0f5
Branch: feature/daemon-self-update

Checks:

  • ✅ Release guard (no version/changelog changes)
  • ✅ Dependencies installed
  • ✅ Type check passed
  • ✅ Linting passed
  • ✅ Format check passed
  • ✅ Tests + coverage passed
  • ✅ Build successful

Ready to merge!


🔗 View workflow run
⏰ Generated at: 2026-03-29T11:27:48.910Z

@vreshch vreshch merged commit de53e8a into master Mar 29, 2026
1 check passed
@vreshch vreshch deleted the feature/daemon-self-update branch March 29, 2026 13:17
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