Skip to content

fix: zsh compdef directive on first line - #72267

Closed
gigamonster256 wants to merge 2 commits into
openclaw:mainfrom
gigamonster256:gigamonster256/push-pmuqnromwtyx
Closed

gigamonster256 wants to merge 2 commits into
openclaw:mainfrom
gigamonster256:gigamonster256/push-pmuqnromwtyx

Conversation

@gigamonster256

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
  • verified compinit -D loads openclaw completion file in addition to sourcing the file working

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 Apr 26, 2026
@greptile-apps

greptile-apps Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Removes the leading newline in generateZshCompletion so the #compdef directive is placed on line 1 of the generated script, satisfying the zsh autoload requirement for completion functions loaded from fpath.

Confidence Score: 5/5

Safe to merge — minimal, targeted one-line fix with no side effects.

Single-character change (removing a leading newline) that directly fixes the stated bug. No logic changes, no security impact, backward compatible.

No files require special attention.

Reviews (1): Last reviewed commit: "fix: zsh compdef directive on first line" | Re-trigger Greptile

@gigamonster256
gigamonster256 force-pushed the gigamonster256/push-pmuqnromwtyx branch from a0b8870 to 0be71c5 Compare April 26, 2026 16:17
@clawsweeper

clawsweeper Bot commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

The PR should stay open: current main and latest release still emit a blank line before the zsh #compdef directive, and this branch is the only open focused fix for that autoload requirement. The patch itself looks correct, but it remains non-merge-ready until the external contributor provides inspectable real zsh behavior proof and refreshes the branch/checks.

Root-cause cluster
Relationship: canonical
Canonical: #72267
Summary: This PR is the canonical open candidate for first-line #compdef placement in generated zsh completion output; related zsh completion PRs cover closed-unmerged attempts or adjacent compinit/escaping fixes.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

So I’m closing this here because the remaining work is already tracked in the canonical issue.

Review details

Best possible solution:

Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

Do we have a high-confidence way to reproduce the issue?

Yes by source inspection: current main and v2026.6.10 put a blank line before #compdef, while zsh compinit reads the first line of fpath completion files. I did not run an executed zsh fpath repro in this read-only review.

Is this the best way to solve the issue?

Yes. Starting the generated zsh script directly with #compdef is the narrowest maintainable fix for fpath autoloading; changing profile sourcing or compinit deferral does not correct the generated file directive placement.

Security review:

Security review cleared: Cleared: the diff only changes generated CLI completion text and does not touch dependencies, workflows, lockfiles, permissions, secrets, package scripts, or network behavior.

AGENTS.md: found and applied where relevant.

What I checked:

  • stale F-rated PR: PR was opened 2026-04-26T16:16:07Z, is older than 60 days, and the latest review rated it F.
  • proof blocker: real behavior proof is missing and proof tier is F, so this branch is not merge-ready without contributor follow-up.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • shakkernerd: The shell completion generator surface appears to originate in the original completion subcommand work that introduced zsh/bash/PowerShell/fish generation. (role: feature introducer; confidence: high; commits: 14c77f82959e; files: src/cli/completion-cli.ts)
  • hydro13: Authored the merged adjacent zsh compdef deferral fix and zsh integration coverage in the same source and test files. (role: recent zsh completion contributor; confidence: high; commits: 6be14ab388eb; files: src/cli/completion-cli.ts, src/cli/completion-cli.test.ts)
  • EdenKangdw: Authored the merged zsh completion escaping fix that recently touched the same generator and tests, though for a different zsh quoting invariant. (role: adjacent zsh completion contributor; confidence: medium; commits: 7c60379589d2; files: src/cli/completion-cli.ts, src/cli/completion-cli.test.ts)

Codex review notes: model internal, reasoning high; reviewed against 66e2fcc6f83e.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 20, 2026
@RomneyDa

Copy link
Copy Markdown
Member

Heads up: this PR needs to be updated against current main before the new required Dependency Guard check can pass.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels May 29, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 14, 2026
@gigamonster256

Copy link
Copy Markdown
Author

no updates are needed. it's a single character fix

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 15, 2026
@clawsweeper clawsweeper Bot mentioned this pull request Jun 21, 2026
3 tasks done
@clawsweeper

clawsweeper Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@gigamonster256

gigamonster256 commented Jun 26, 2026 •

Copy link
Copy Markdown
Author

@clawsweeper This or is neither a duplicate nor superseded

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

Labels

cli CLI command changes P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants