Skip to content

fix: consume empty before-load hook replacements successfully #511

Description

@ss-o

Problem

A before-load annex hook that consumes its final request successfully cannot return an empty replacement. The dispatcher converts an empty ZI[annex-before-load:new-@] into an array with one empty string, then reports No plugin or snippet ID given.

Verified in next 9278795 and stable main 56715fd. This blocks the repeated-group no-op contract in z-shell/z-a-meta-plugins#60.

Change

After parsing the replacement, clear the argument array when the replacement string is empty. Preserve quoted arguments in non-empty replacements and odd hook failure statuses. This is a narrow dispatcher correction with a focused runtime regression, without a new dependency or API.

Acceptance

  • Empty successful replacement returns zero and loads no object.
  • Empty failed replacement preserves the hook error.
  • A following request and a quoted non-empty replacement retain their arguments and execute normally.
  • Native Zsh syntax and the focused dispatcher/load tests pass.
  • Recheck meta-plugins first expansion, retry, and repeated-group behavior against the corrected dispatcher.

Delivery

Approved local implementation, issue creation, and Project 28 tracking. Intended integration target: next. No commit, push, or PR requested. Recommended triage: Bug, High impact, S effort, P1 - High priority, Human delivery.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ziZi core behavior, APIs, or documentation.meta:org-trackedIndicates this issue has cross-repository tracking implications (synced to Linear).priority:highNeeds prompt attention.type:bugSomething is broken or behaving incorrectly.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions