addyosmani / addyosmani/agent-skills

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

Aperta
#475 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
93.8k
Fork
10k
Merge medio
3g 15h
PR unite (30g)
23

Descrizione

## 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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.