Skip to content

feat(zephyr-agent): show outdated version warning in plugins#393

Merged
Nsttt merged 8 commits intomainfrom
feat/agent-outdated-version-warning
Mar 9, 2026
Merged

feat(zephyr-agent): show outdated version warning in plugins#393
Nsttt merged 8 commits intomainfrom
feat/agent-outdated-version-warning

Conversation

@Nsttt
Copy link
Member

@Nsttt Nsttt commented Mar 6, 2026

What's added in this PR?

Implements plugin-side outdated-version UX directly in zephyr-agent (no gateway/header dependency).

Details:

  • Added local outdated check during ZephyrEngine.create:
    • resolves active plugin package name from app dependencies + builder fallback
    • fetches latest version from npm dist-tags
    • compares current vs latest and prints a one-time terminal error-style warning when outdated
  • Warning copy now:
    • Your Zephyr Plugin version is outdated ...
    • If you are facing any issue, upgrade <plugin-package-name> first.
  • Removed previous header-based warning path from HTTP/resolve request flows.
  • Added runtime-safe handling for unknown builder strings (fixes BUILDER_PLUGIN_CANDIDATES[builder] is not iterable).

Screenshots

N/A (terminal output only)

What's the issues or discussion related to this PR ?

Context: users on older plugin versions should get immediate troubleshooting guidance from the plugin itself, without requiring API gateway support.

What are the steps to test this PR?

  1. Run:
    • pnpm nx test zephyr-agent --runInBand
    • pnpm nx build zephyr-agent
  2. For outdated warning behavior, mock npm dist-tags response to a higher latest than current and verify one warning is printed.
  3. For resolver robustness, verify unknown builder inputs do not throw and fallback package name is used.

Documentation update for this PR (if applicable)?

No docs update in this PR.

(Optional) What's left to be done for this PR?

None.

(Optional) What's the potential risk and how to mitigate it?

Risk: extra npm registry request on initialization.
Mitigation: non-blocking behavior; failures to fetch latest are ignored.

(Required) Pre-PR/Merge checklist

  • I have added/updated/opened a PR to documentation to cover this new behavior
  • I have added an explanation of my changes
  • I have written new tests (if applicable)
  • I have tested this locally (standing from a first time user point of view, never touch this app before)
  • I have/will run tests, or ask for help to add test

@Nsttt Nsttt self-assigned this Mar 6, 2026
@Nsttt Nsttt marked this pull request as ready for review March 6, 2026 15:29
Copilot AI review requested due to automatic review settings March 6, 2026 15:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a plugin-facing terminal warning intended to notify users when their Zephyr plugin version is outdated, plus utilities/tests to determine which Zephyr plugin package is in use.

Changes:

  • Added resolveZephyrPluginPackageName() to infer the Zephyr plugin package name from an app’s package.json deps.
  • Added maybeShowOutdatedPluginWarning() which checks npm dist-tags and emits a one-time console error warning.
  • Hooked the warning into ZephyrEngine.create() and added Jest coverage for the new utilities.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
libs/zephyr-agent/src/zephyr-engine/index.ts Calls the new outdated-warning logic during engine initialization.
libs/zephyr-agent/src/lib/version/plugin-package-name.ts Implements plugin package name resolution based on builder + declared deps.
libs/zephyr-agent/src/lib/version/plugin-package-name.test.ts Tests plugin package name resolution + fallback behavior.
libs/zephyr-agent/src/lib/version/outdated-plugin-warning.ts Implements npm-registry-based latest-version lookup + warning emission.
libs/zephyr-agent/src/lib/version/outdated-plugin-warning.test.ts Tests warning emission, non-emission, and one-time behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@Nsttt Nsttt merged commit f9ebf97 into main Mar 9, 2026
11 checks passed
@Nsttt Nsttt deleted the feat/agent-outdated-version-warning branch March 9, 2026 09:45
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.

3 participants