feat: expose plugin and CLI versions to catch eval version drift (#135)#136
Conversation
The macOS "native WebKit eval callback returned an error" came from a plugin <= 0.7.0 compiled into the app while the CLI was already 0.7.1. Nothing reported either version, so the drift was invisible and the same eval problem kept resurfacing per platform. - plugin: `ping` returns `plugin_version`; `state` includes it too - plugin: log the version when the socket/named pipe starts listening - cli: add `--version`; `ping` prints plugin+CLI versions and warns on drift - docs: plugin-setup troubleshooting for the drift plus `cargo update`
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR exposes the plugin's compile-time version in ChangesVersion Reporting and Drift Detection
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
✅ Approve
1 finding — 1 minor
Review assessment
Effort: ●●●●○ 4/5
Metrics: 1 finding · 1 file touched · 0 blocker plus major findings
Severity distribution:
Total: 1 finding
Bar: █
- 🟡 minor: 1 finding
TL;DR
The pull request adds version introspection to detect and warn about version drift between the tauri-pilot plugin and CLI, addressing the root cause of recurring macOS eval errors. The changes include exposing plugin and CLI versions, logging the plugin version on startup, and documenting sync guidance. No functional changes were made to the eval mechanism itself.
Findings
| Severity | Location | Title | Details |
|---|---|---|---|
| 🟡 | crates/tauri-pilot-cli/src/main.rs:140 | Missing JSON output for version handshake in ping |
The ping command omits JSON output when printing the version handshake, which breaks consistency with other commands. JSON consumers (e.g., scripts or CI) cannot parse the version drift warning programmatically. |
File-by-file
crates/tauri-pilot-cli/src/main.rs
1 finding
- crates/tauri-pilot-cli/src/main.rs:140 Missing JSON output for version handshake in
ping
Compliance & provenance
Compliance & audit
Model: mistral / mistral-large-latest
Prompt sha256: ec9d577a30b739d74e1e3f12571df248b078764e0910c8f3067123873736744e
No signed audit trail is attached
Missing JSON output for version handshake in ping — crates/tauri-pilot-cli/src/main.rs:140
🔍 Audit Reference: SOVRI-MT-0C95-2A35
Tokens: 6068 in / 631 out · Estimated cost: $0.0040 (mistral mistral-large-latest)
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/tauri-plugin-pilot/src/server/windows.rs (1)
592-592:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate the Windows ping test to verify
plugin_version.The Unix ping test (at
unix.rs:284-289) was updated to verify bothstatusandplugin_versionfields, but the Windows test still checks only the entire result object. Since the handler'spingdispatch is platform-agnostic and returnsplugin_versionfor all platforms, both server tests should verify the same response contract to catch regressions.🔧 Align with the Unix test pattern
assert_eq!(resp.id, serde_json::json!(1)); assert!(resp.error.is_none()); - assert_eq!(resp.result, Some(serde_json::json!({"status": "ok"}))); + let result = resp.result.expect("ping returns a result"); + assert_eq!(result["status"], serde_json::json!("ok")); + assert_eq!( + result["plugin_version"], + serde_json::json!(env!("CARGO_PKG_VERSION")) + );🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/tauri-plugin-pilot/src/server/windows.rs` at line 592, The Windows ping test currently asserts resp.result equals {"status":"ok"}; update it to also verify the plugin_version like the Unix test does by asserting resp.result is Some(serde_json::json!({"status":"ok","plugin_version": crate::common::PLUGIN_VERSION})) or by asserting the "status" field equals "ok" and the "plugin_version" field equals the PLUGIN_VERSION constant; locate the assertion in the Windows test (where resp.result is compared) and replace it with the combined check using serde_json::json! or two explicit assertions referencing PLUGIN_VERSION.
🧹 Nitpick comments (1)
crates/tauri-plugin-pilot/src/handler.rs (1)
601-621: 💤 Low valueConsider consolidating the ping tests.
The test
test_dispatch_ping_returns_ok(lines 601-608) verifies only thestatusfield, whiletest_dispatch_ping_reports_plugin_version(lines 610-621) verifies bothstatusandplugin_version. The first test is now redundant since the second provides full coverage.♻️ Simplify by removing the redundant test
- #[tokio::test] - async fn test_dispatch_ping_returns_ok() { - let engine = EvalEngine::new(); - let result = dispatch("ping", None, &engine, None, None, None, &Recorder::new()) - .await - .expect("dispatch succeeds"); - assert_eq!(result["status"], json!("ok")); - } - #[tokio::test] async fn test_dispatch_ping_reports_plugin_version() {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/tauri-plugin-pilot/src/handler.rs` around lines 601 - 621, Remove the redundant test function test_dispatch_ping_returns_ok and consolidate its assertion into test_dispatch_ping_reports_plugin_version: keep a single async #[tokio::test] that calls dispatch("ping", ...) (as in the existing test_dispatch_ping_reports_plugin_version), assert result["status"] == json!("ok") and assert result["plugin_version"] == json!(env!("CARGO_PKG_VERSION")); ensure the test uses EvalEngine::new(), Recorder::new(), and .expect("dispatch succeeds") exactly like the current tests and delete the now-duplicate test_dispatch_ping_returns_ok function.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@crates/tauri-plugin-pilot/src/server/windows.rs`:
- Line 592: The Windows ping test currently asserts resp.result equals
{"status":"ok"}; update it to also verify the plugin_version like the Unix test
does by asserting resp.result is
Some(serde_json::json!({"status":"ok","plugin_version":
crate::common::PLUGIN_VERSION})) or by asserting the "status" field equals "ok"
and the "plugin_version" field equals the PLUGIN_VERSION constant; locate the
assertion in the Windows test (where resp.result is compared) and replace it
with the combined check using serde_json::json! or two explicit assertions
referencing PLUGIN_VERSION.
---
Nitpick comments:
In `@crates/tauri-plugin-pilot/src/handler.rs`:
- Around line 601-621: Remove the redundant test function
test_dispatch_ping_returns_ok and consolidate its assertion into
test_dispatch_ping_reports_plugin_version: keep a single async #[tokio::test]
that calls dispatch("ping", ...) (as in the existing
test_dispatch_ping_reports_plugin_version), assert result["status"] ==
json!("ok") and assert result["plugin_version"] ==
json!(env!("CARGO_PKG_VERSION")); ensure the test uses EvalEngine::new(),
Recorder::new(), and .expect("dispatch succeeds") exactly like the current tests
and delete the now-duplicate test_dispatch_ping_returns_ok function.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 984990aa-9790-4c9d-a6cd-281383d14e91
📒 Files selected for processing (8)
CHANGELOG.mdcrates/tauri-pilot-cli/src/cli.rscrates/tauri-pilot-cli/src/main.rscrates/tauri-pilot-cli/tests/version.rscrates/tauri-plugin-pilot/src/handler.rscrates/tauri-plugin-pilot/src/server/unix.rscrates/tauri-plugin-pilot/src/server/windows.rsdocs/src/content/docs/guides/plugin-setup.md
Addresses a PR review nit: extract inject_plugin_version so the `plugin_version` field and its env! source live in one place instead of being repeated in the ping and state arms.
Already handled in db8f11f, ahead of this review. The Windows test at windows.rs:592 now asserts |
|
Tip For best results, initiate chat on the files or code changes.
|
Per review: pin the assertion to `tauri-pilot <version>` so a change to the binary name or clap's version layout is caught, not just the presence of the version string.


Root cause
Issue #135 reports
native WebKit eval callback returned an erroron macOS Tahoe with tauri-pilot 0.7.1. That string only ever came from the native macOS WKWebView eval path, which #127 removed in 0.7.1. So the plugin compiled into the reporter's app is <= 0.7.0 even though the CLI is 0.7.1.The plugin and CLI are separate crates with independent versions, and nothing reported either one at runtime. That is why the same eval problem kept getting re-fixed per platform (#108, then #110/#112, then #126/#127): field reports were never tied to a plugin version.
Changes
pingreturnsplugin_version;statecarries it too. The version is logged when the socket or named pipe starts listening.--version(was missing, asked for in Eval error native WebKit eval #135).tauri-pilot pingprints the plugin and CLI versions and warns when they drift. A ping response with noplugin_versionis read as plugin <= 0.7.0, upgrade.cargo updateor version-pin fix.No change to the eval mechanism: the 0.7.1 IPC path is correct. This makes the version drift observable so it stops recurring.
Testing
Addresses #135.
Summary by cubic
Expose plugin and CLI versions and add a version handshake in
tauri-pilot pingto detect and warn about version drift behind the macOS eval error in #135. No eval/IPC behavior changed; runtauri-pilot pingto confirm versions match.New Features
pingandstateincludeplugin_version.--versionadded;tauri-pilot pingshows plugin and CLI versions and warns on drift (non-JSON). Test asserts exact--versionoutput format.Refactors
inject_plugin_versionhelper used bypingandstate.Written for commit 49d779e. Summary will update on new commits.
Summary by CodeRabbit
New Features
Improvements
Documentation