Skip to content

feat(jev): support windows workflows and grouped steps - #520

Open
yichen11818 wants to merge 5 commits into
vercel-labs:mainfrom
yichen11818:codex/jev-windows-flow
Open

yichen11818 wants to merge 5 commits into
vercel-labs:mainfrom
yichen11818:codex/jev-windows-flow

Conversation

@yichen11818

@yichen11818 yichen11818 commented Nov 3, 2026 •

Copy link
Copy Markdown

Summary

JEv cannot launch npm's Windows command shims with Node's execFileSync. Deep Electron controls also need configurable snapshot depth and timeouts. This PR resolves the packaged native executable, shares bounded observation options between the JEv entry points, and adds flow.mjs for callers that already know several steps to perform.

Each flow round submits the pending target questions together, batches the leading confident steps, and reads again when a target is not yet available. Completed steps are never replayed. An error stops the flow unless it is a stale ref explicitly marked safe to retry and not delivered, including when earlier batch entries succeeded.

Windows observation optionally reads the popover surface and falls back to the window when that surface is unavailable. #521 implements the Windows surface itself. This PR can merge independently: no Rust adapter changes are included. The two PRs separate JEv workflow behavior from native Windows surface resolution.

Related issues

Companion adapter PR: #521. No issue is closed by this PR.

Type of change

  • feat: grouped step runner
  • fix: Windows executable lookup, platform paste shortcut, bounded screen reads, and partial-batch retry handling
  • test: binary lookup, flow planning, partial-batch failures, and optional popover reads
  • ci: run all JEv test files on Linux, Windows, and macOS
  • docs: update the JEv skill

How tested

Run on Windows with Node 22.20.0:

  • node --test scripts/jev/*.test.mjs: all 4 discovered test files passed
  • The new flow integration test failed before the retry fix, then passed after it. It verifies that an unsafe timeout or unsafe stale ref after partial success stops without replay, while a safe undelivered stale ref retries only the unfinished step.
  • Integration tests cover an open popover, a popover outside the pinned window, and a CLI that does not support popovers.
  • Binary lookup tests run independently of whether a local release build exists.
  • go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.11 -shellcheck= .github/workflows/ci.yml
  • Repository pre-commit harness/script checks and git diff --check
  • Windows native fixture snapshot smoke: release CLI captured a complete 160-ref tree after the fixture was launched through agent-desktop
  • Regression: the Windows title-bar menu node is ignored instead of being treated as an open application menu
  • Upstream cross-platform CI and live model/browser end-to-end validation remain outstanding.
  • No reproducible before/after latency benchmark is included. The skill makes no equal-latency claim for one versus several questions.

The integration tests use a simulated CLI and model responses. They do not send screen content to an external service. Rust gates are not reported as JEv coverage because this branch does not change Rust sources.

Checklist

  • Conventional-commit title
  • JEv skill updated with behavior and retry limits
  • Local JEv tests pass and the new tests are wired into CI
  • All required upstream checks pass; GitHub CI is currently action_required and the Vercel preview requires Vercel Labs authorization.

Kept as a draft while the upstream checks and remaining validation are pending. The Vercel preview check requests authorization from a Vercel Labs team member.

On Windows the scripts could not start agent-desktop at all: npm installs a
.cmd and a .ps1 shim, and execFileSync refuses to spawn either without a
shell. The default binary lookup now finds the native executable the npm
package ships next to the shim on PATH.

The paste fallback sent cmd+v on every platform. It now sends ctrl+v
outside macOS.

Electron windows lost their controls: at the CLI's default depth of 10 a
canvas app returned 56 elements and none of its toolbar, against 251 at
depth 20, and its reads could outlast the 3 s deadline. JEV_SNAPSHOT_MAX_DEPTH
and JEV_SNAPSHOT_TIMEOUT_MS pass --max-depth and --timeout-ms to every read,
validated, and change nothing when unset. The skeleton first look keeps the
CLI depth.

A minimized window answered with a timeout or an empty tree. When every
window of the app is minimized, the error now says so and names the restore
command.
run.mjs and act.mjs ask Jev one step at a time, so every step costs a screen
read, a request and a process start, and the caller waits between them.
Measured on a browser page with 120 candidates, one question took about 0.5 s
and five questions in one request took the same.

flow.mjs reads the screen once, asks for the target of every pending step in
one request, and runs the leading steps Jev is sure of as one agent-desktop
batch. The first unsure step ends the batch and the next round asks again on
the new screen. After an action the screen is re-read until it changes; when
Jev then finds nothing on an unchanged screen the run stops with no_effect
instead of waiting. Text is written with set-value and no separate focus,
because focus on Windows moves the foreground and headless delivery refuses
it, which had stopped the key press after it.
@vercel

vercel Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

@yichen11818 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Stop on unsafe delivery after any partial batch success, read optional Windows popovers, and run the JEv suite on all three platforms.
@yichen11818 yichen11818 changed the title fix(jev): support Windows Electron flows feat(jev): support windows workflows and grouped steps Nov 3, 2026
@yichen11818
yichen11818 marked this pull request as ready for review November 5, 2026 02:34
Comment thread scripts/jev/flow.mjs
Comment on lines +109 to +113
export const toEntries = (step, node, { app, windowId }) => {
if (step.press) return [{ command: "press", args: { combo: step.press, app, ...(windowId ? { window_id: windowId } : {}) } }];
const hasText = step.text !== undefined;
const { verb } = reconcile(hasText ? "set-value" : "click", node, hasText);
return [{ command: verb, args: (ARGS[verb] ?? ((ref) => ({ ref_id: ref })))(node.ref_id, step.text) }];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A flow step such as “uncheck Notifications” becomes a click rather than an uncheck operation, so an already-unchecked checkbox can be turned on and reported as completed.

Fix on Vercel

Comment thread scripts/jev/bin.mjs
Comment on lines +19 to +21
if (!existsSync(join(dir, "agent-desktop.cmd"))) continue;
const exe = join(dir, "node_modules", "agent-desktop", "bin", `agent-desktop-win32-${arch}.exe`);
if (existsSync(exe)) return exe;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With a local npm installation on Windows and no release build, binary lookup misses the executable beside node_modules/.bin and JEv fails to launch agent-desktop.

Fix on Vercel

This branch has not been deployed

No deployments
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