addyosmani / addyosmani/agent-skills

SessionStart hook exits with code 1 on native Windows Codex (bash/jq-only hook)

Đang mở
#475 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
93.8k
Fork
10k
Merge trung bình
3 ngày 15 giờ
Pull request đã merge (30 ngày)
23

Mô tả

## Summary

The bundled `SessionStart` hook exits with code 1 when this plugin is used from Codex Desktop on native Windows.

The individual skills still load and remain usable, but Codex displays a plugin hook failure notification at session start and the `using-agent-skills` context is not injected.

## Current behavior

The current `hooks/hooks.json` only defines a POSIX `command`. It invokes `hooks/session-start.sh`, which requires Bash and `jq`, and resolves paths through Claude-specific environment variables.

There is no Windows-specific `commandWindows` handler.

## Reproduction

Environment:

- Codex Desktop on native Windows
- agent-skills plugin 0.6.6
- No working WSL distribution
- `bash` resolves to the Windows WSL launcher
- `jq` is not installed

Steps:

1. Enable the agent-skills plugin in Codex Desktop.
2. Start or resume a session.
3. Observe: `SessionStart plugin hook exited with code 1`.

A direct invocation of the resolved `bash.exe` also exits with code 1 because WSL cannot create a Linux instance.

## Expected behavior

Native Windows users should either:

- receive the same meta-skill context through a Windows-native hook; or
- have this optional hook skip cleanly without displaying a failure.

Installing WSL and `jq` should not be required merely to use the plugin from native Windows Codex.

## Suggested fix

Add a Windows-specific `commandWindows` handler, as supported by Codex hooks, using PowerShell without Bash or `jq`. Keep the existing POSIX command for macOS/Linux.

A Windows regression test would also prevent recurrence.

Codex hook reference: https://learn.chatgpt.com/docs/hooks

## Impact

Low severity but persistent UX issue:

- project work, builds, tests, and individual skills are unaffected;
- automatic `using-agent-skills` context injection fails;
- the warning appears at session start and looks more serious than the actual impact.

Editing the installed plugin cache is not a durable workaround because plugin updates or cache refreshes can overwrite it.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.