Skip to content

fix(core): explain refs emptied by the zsh :e modifier - #727

Closed
ZERLB wants to merge 1 commit into
vercel-labs:mainfrom
ZERLB:fix/explain-ref-emptied-by-zsh
Closed

ZERLB wants to merge 1 commit into
vercel-labs:mainfrom
ZERLB:fix/explain-ref-emptied-by-zsh

Conversation

@ZERLB

@ZERLB ZERLB commented Nov 20, 2026

Copy link
Copy Markdown

Summary

In zsh, the default shell on macOS, "@$SNAP:e5" applies the :e (extension) modifier to $SNAP and sends @5. The command fails with INVALID_ARGS, and the suggestion only asks for the qualified form, which is what the caller believes it sent. A ref that is @ followed by digits now gets a suggestion that names the cause and the braced form "@${SNAP}:e5". The shell paragraph of the skill says the same.

$ zsh -fc 'SNAP=s8f3k2p9; print -r -- "@$SNAP:e5"; print -r -- "@${SNAP}:e5"'
@5
@s8f3k2p9:e5

Related issues

No issue filed for this.

Type of change

  • feat: — new feature
  • fix: — bug fix
  • docs: — documentation only
  • refactor: — no behavior change
  • perf: — performance improvement
  • test: — adding or fixing tests
  • chore: — maintenance / dependencies
  • ci: — CI/CD changes
  • BREAKING CHANGE — incompatible ABI or CLI change

How tested

  • cargo fmt --all -- --check
  • cargo clippy "${HOST_PKGS[@]}" --all-targets -- -D warnings
  • cargo test "${HOST_PKGS[@]}" --lib
  • cargo test -p agent-desktop
  • cargo test -p agent-desktop-ffi --tests
  • AGENT_DESKTOP_E2E_EXCLUSIVE=1 bash tests/e2e/run.sh (requires --release build + AX permission; run when behavior changes)

The test steps ran through scripts/cargo-test-isolated-home.sh on macOS 26.7.1, arm64. I did not run the E2E suite: the change is the text of one suggestion and reaches no adapter code.

ref_token_tests.rs gains a test: @5, @10 and @123 get the new suggestion, and a bare @e5 keeps the old one. agent-desktop click @5 on main at e8934a5 and on this branch returns the same code and message, and the suggestion changes:

suggestion
main Use the snapshot-qualified ref that snapshot prints, for example @s8f3k2p9:e1. A bare @en ref is not accepted.
This branch This ref lost its snapshot id to the shell: in zsh, "@$SNAP:e5" applies the :e modifier to $SNAP and leaves @5. Write "@${SNAP}:e5", or paste the ref exactly as snapshot prints it, for example @s8f3k2p9:e1.

A malformed ref of another shape, such as @s8f3k2p95, keeps the suggestion it has on main.

Checklist

  • PR title uses a conventional-commit prefix (type: description, lowercase, no capital after colon)
  • cargo fmt and cargo clippy -D warnings are clean
  • All tests pass
  • No unwrap() added in non-test code
  • No inline comments added (only /// doc-comments on public items)
  • All modified files are within the 400 LOC limit
  • Skill docs updated if a command, flag, or JSON output changed (skills/agent-desktop/ or the platform skill under skills/agent-desktop-macos/, skills/agent-desktop-windows/ or skills/agent-desktop-linux/)
  • README / other docs updated if the public interface changed

No command, flag or output field changes, so the README and the docs site stay as they are.

In zsh, the default shell on macOS, `"@$SNAP:e5"` applies the `:e`
(extension) modifier to `$SNAP` and sends `@5`. The `INVALID_ARGS`
suggestion only asked for the qualified form, which is what the caller
believed it had sent, so the same command came back.

A ref that is `@` followed by digits now gets a suggestion that names the
cause and the braced form `"@${SNAP}:e5"`. The shell paragraph of the
skill says the same.
@vercel

vercel Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

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

A member of the Team first needs to authorize it.

@lahfir

lahfir commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

closing as fixed in #702 on main: invalid ref errors already explain the zsh :e modifier and braced form. thanks @ZERLB

agent-desktop click "@${SID}:e1"

@lahfir lahfir closed this Nov 28, 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.

2 participants