Skip to content

feat: zsh autoload compatability - #49208

Closed
gigamonster256 wants to merge 1 commit into
openclaw:mainfrom
gigamonster256:gigamonster256/push-pmuqnromwtyx
Closed

gigamonster256 wants to merge 1 commit into
openclaw:mainfrom
gigamonster256:gigamonster256/push-pmuqnromwtyx

Conversation

@gigamonster256

@gigamonster256 gigamonster256 commented Mar 17, 2026 •

Copy link
Copy Markdown

Summary

  • Problem: zsh completions do not work when auto loaded
  • Why it matters: zsh completions must have the #compdef directive on the first line to work properly (works fine when sourced but not loaded automatically from fpath)
  • What changed: zsh completion output
  • What did NOT change (scope boundary):

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

User-visible / Behavior Changes

None

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)

Repro + Verification

Environment

  • OS: NixOS
  • Runtime/container: N/A
  • Model/provider: N/A
  • Integration/channel (if any): N/A
  • Relevant config (redacted): N/A

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: zsh completions now load automatically from the file openclaw completion --shell zsh outputs

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)

Risks and Mitigations

List only real risks for this PR. Add/remove entries as needed. If none, write None.

None

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS labels Mar 17, 2026
@greptile-apps

greptile-apps Bot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a one-line bug in the zsh completion generator: the #compdef directive was previously emitted on the second line of the generated script (due to a leading newline in the template literal), but zsh requires it to be on the very first line for autoloading from $fpath to work. The fix removes the leading newline so the directive is now correctly positioned.

  • Moves #compdef ${rootCmd} to the first line of the generated zsh completion script by eliminating the leading newline in the template literal
  • No logic, behavior, or API surface is otherwise changed
  • The fix is minimal, correct, and well-scoped

Confidence Score: 5/5

  • Safe to merge — the change is a single-character fix with no functional side effects beyond the intended behavior.
  • The PR makes a trivially correct one-line change: removing a leading newline from a template literal so that the #compdef directive lands on line 1 of the generated zsh completion file. This is a well-known zsh requirement and the fix is accurate. No tests, APIs, or other logic are touched.
  • No files require special attention.

Last reviewed commit: a0b8870

@gigamonster256
gigamonster256 marked this pull request as draft March 17, 2026 19:32
@gigamonster256
gigamonster256 force-pushed the gigamonster256/push-pmuqnromwtyx branch 2 times, most recently from 2b75af6 to 43d7d4c Compare March 17, 2026 19:37
@gigamonster256
gigamonster256 force-pushed the gigamonster256/push-pmuqnromwtyx branch from 43d7d4c to 9097bb0 Compare March 17, 2026 19:40
@gigamonster256 gigamonster256 changed the title fix: zsh compdef directive on first line feat: zsh autoload compatability Mar 17, 2026
@clawsweeper clawsweeper Bot mentioned this pull request Apr 29, 2026
4 of 16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant