Conversation
`(z)` splits a blank string into one empty word, so a before-load hook that consumed its final request and returned an empty `ZI[annex-before-load:new-@]` reached the loader as a blank object ID and failed with "No plugin or snippet ID given". Drop the word when the replacement holds no non-whitespace character. Apply the same guard to `new-global-ices`, where the stray word made an empty ice-list look odd and malformed, costing a spurious warning and 7 added to the return status. Quoted non-empty replacements, following requests, and odd hook failure statuses are unchanged. Refs #511
There was a problem hiding this comment.
🟢 Approval recommended
The reviewed changes address the reported issue and include regression coverage.
Pull request overview
Fixes before-load hook handling so blank replacements no longer become invalid object IDs or malformed ice lists.
Changes:
- Handles blank and whitespace-only replacements safely.
- Preserves failure, follow-up, and quoted replacement behavior.
- Adds focused regression coverage.
File summaries
| File | Summary |
|---|---|
zi.zsh |
Guards blank hook replacements and ice lists. |
tests/load-object-status.zsh |
Adds focused dispatcher regression tests. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Sep 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
(z)splits a blank string into one empty word. A before-load hook thatconsumed its final request successfully and returned an empty
ZI[annex-before-load:new-@]therefore reached the loader as a blank objectID, and the dispatcher reported
No plugin or snippet ID given(zi.zsh:3086)with status 2 instead of succeeding with nothing loaded.
Verified directly:
Change
Drop the word when the replacement holds no non-whitespace character. The test
is the whitespace-stripped string, not
-n, because whitespace-only splits tothe same single blank word and would otherwise slip through.
The same split affects
ZI[annex-before-load:new-global-ices]at the siblingcall site: a blank ice-list became a one-element array, failed the even-count
check, and cost a spurious
Bad new-ices returnedwarning plus 7 added to thereturn status. Same guard applied there.
Quoted non-empty replacements, following requests, and odd hook failure
statuses are unchanged.
Verification
tests/suite: 26 files, all pass.zsh -nclean on both changed files.scripts/public-contract-impact.zshagainstnext: no public-contractchanges detected.
new-@fails the plain-empty casenew-global-icesfails the blank-ice-list case-nfails the whitespace case, which is what makesthe widening load-bearing rather than cosmetic
Acceptance
arguments and execute normally.
against the corrected dispatcher.
Open item for review
The last box is deliberately unchecked. It is a cross-repository recheck that
belongs to z-shell/z-a-meta-plugins#60, which is blocked by this issue and runs
after it. A synthetic zi-plus-annex harness did not reach the all-members-loaded
state: with
._zimarkers present and members listed inzsh_loaded_plugins,the handler still queued every member, so
$loaded_plugins[(I)$p]is notmatching as expected at handler line 200. That is a hint for whoever builds the
real integration fixture, not a defect claim in this change.
This pull request therefore references the issue rather than closing it. Leave
#511 open until that recheck lands alongside z-shell/z-a-meta-plugins#60.
Refs #511