You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed in v0.6.4. The [ -f ] bash check has been replaced with a cross-platform Python one-liner — re-run graphify codex install after upgrading to regenerate the hook.
Re-opening — the python3 -c "..." fix in v0.6.4 still fails on Windows Conda (no python3 shim) and PowerShell (JSON brace/quote parsing). Root cause confirmed via #522.
Real fix (in next release): the hook command is now just graphify hook-check — a new shell-agnostic subcommand that prints the hookSpecificOutput JSON if graph.json exists and exits silently if not. No inline Python, no shell quoting, works on PowerShell, cmd.exe, macOS, and Linux.
After upgrading, re-run graphify codex install to regenerate the hook with the new command.
The hook command is now just graphify hook-check — no inline Python, no bash syntax, no JSON escaping. Should work cleanly on PowerShell and Conda.
We don't have a Windows machine to verify this ourselves, so your feedback is really valuable. If it still fails, please open a PR with the working command for your setup — even a one-line change to _CODEX_HOOK in graphify/__main__.py would be enough and we'll merge it straight away.
I can reproduce this on macOS as well, so it is not only the Windows `[ -f ... ]` hook issue.
Environment:
- OS: macOS
- Python: 3.14.2 via pyenv
- Package: graphifyy 0.6.5
- CLI: graphify
- Module path: `/Users/rikdoclo/.pyenv/versions/3.14.2/lib/python3.14/site-packages/graphify`- App/runtime: Codex Desktop
- Hook config path:
- project: `.codex/hooks.json`- global: `~/.codex/hooks.json`
Installed hook config:
```json
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "graphify hook-check"
}
]
}
]
}
}
Reproduction:
Install/run graphify so graphify-out/graph.json exists.
Run graphify codex install or otherwise install the Codex hook.
Start Codex Desktop in the project.
Any Bash tool call triggers the PreToolUse hook.
Observed error:
PreToolUse hook returned unsupported additionalContext
Direct command output:
graphify hook-check
prints:
{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"additionalContext": "graphify: Knowledge graph exists. Read graphify-out/GRAPH_REPORT.md for god nodes and community structure before searching raw files."
}
}
This means graphifyy 0.6.5 still emits hookSpecificOutput.additionalContext for Codex PreToolUse. Codex Desktop rejects that field.
This stops the hook failure by suppressing the unsupported JSON, but it also disables the graph reminder injection.
Suggested fix:
For Codex installs, graphify hook-check should not emit hookSpecificOutput.additionalContext for PreToolUse. Either emit the currently supported Codex hook schema, or make the Codex hook a no-op reminder-free hook until Codex supports context injection for this event.
PreToolUse hook returned unsupported additionalContext
Confirmed on:
macOS
Codex Desktop
Python 3.14.2 via pyenv
graphifyy 0.6.5
Recommended Code Change
In graphify/__main__.py, change the hook-check command so it exits successfully without printing unsupported hookSpecificOutput.additionalContext.
Current logic:
elifcmd=="hook-check":
graph=Path("graphify-out") /"graph.json"ifgraph.exists():
importjsonas_jsonprint(_json.dumps({
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"additionalContext": (
"graphify: Knowledge graph exists. ""Read graphify-out/GRAPH_REPORT.md for god nodes and ""community structure before searching raw files."
),
}
}))
sys.exit(0)
Proposed minimal fix:
elifcmd=="hook-check":
# Codex Desktop currently rejects `additionalContext` on PreToolUse.# Keep this hook as a cross-platform no-op so installed hooks do not# break Bash tool calls when graphify-out/graph.json exists.sys.exit(0)
Optionally, preserve old behavior behind an explicit opt-in flag/env var, but not by default:
Fixed in v6 (commit cf7ce3a). graphify hook-check is now a silent no-op — exits 0 without printing anything. Codex Desktop no longer rejects the hook. Graph guidance reaches the agent via AGENTS.md and the installed skill instead. Thanks @rikdoclo for the detailed diagnosis and suggested fix!
Also fixed the PATH issue you reported @rexkoh425 (commit 96267ad). graphify codex install now writes the absolute path to the graphify executable into hooks.json instead of the bare graphify command — so it works even when .venv/Scripts isn't on Codex's PATH in the VS Code extension. Re-run graphify codex install after upgrading to regenerate the hook with the full path.
Let me know if there any regressions yet again after the fix
Activity
Stef500 commentedon May 2, 2026
Hello, same problem here.
safishamsi commentedon May 2, 2026
Fixed in v0.6.4. The
[ -f ]bash check has been replaced with a cross-platform Python one-liner — re-rungraphify codex installafter upgrading to regenerate the hook.rexkoh425 commentedon May 2, 2026
#PreToolUse still fails after running upgrading to v0.6.4 and running "graphify codex install".
OS: Windows
Virtual Enviroment: Conda
CLI : Powershell
Python version: 3.14.0
Linking similar issue below
#522
@safishamsi
safishamsi commentedon May 2, 2026
safishamsi commentedon May 2, 2026
Re-opening — the
python3 -c "..."fix in v0.6.4 still fails on Windows Conda (nopython3shim) and PowerShell (JSON brace/quote parsing). Root cause confirmed via #522.Real fix (in next release): the hook command is now just
graphify hook-check— a new shell-agnostic subcommand that prints the hookSpecificOutput JSON ifgraph.jsonexists and exits silently if not. No inline Python, no shell quoting, works on PowerShell, cmd.exe, macOS, and Linux.After upgrading, re-run
graphify codex installto regenerate the hook with the new command.safishamsi commentedon May 2, 2026
v0.6.5 is now on PyPI with the updated fix. Please try:
The hook command is now just
graphify hook-check— no inline Python, no bash syntax, no JSON escaping. Should work cleanly on PowerShell and Conda.We don't have a Windows machine to verify this ourselves, so your feedback is really valuable. If it still fails, please open a PR with the working command for your setup — even a one-line change to
_CODEX_HOOKingraphify/__main__.pywould be enough and we'll merge it straight away.rikdoclo commentedon May 2, 2026
Reproduction:
graphify-out/graph.jsonexists.graphify codex installor otherwise install the Codex hook.Observed error:
Direct command output:
prints:
{ "hookSpecificOutput": { "hookEventName": "PreToolUse", "additionalContext": "graphify: Knowledge graph exists. Read graphify-out/GRAPH_REPORT.md for god nodes and community structure before searching raw files." } }This means
graphifyy 0.6.5still emitshookSpecificOutput.additionalContextfor CodexPreToolUse. Codex Desktop rejects that field.Local workaround:
This stops the hook failure by suppressing the unsupported JSON, but it also disables the graph reminder injection.
Suggested fix:
For Codex installs,
graphify hook-checkshould not emithookSpecificOutput.additionalContextforPreToolUse. Either emit the currently supported Codex hook schema, or make the Codex hook a no-op reminder-free hook until Codex supports context injection for this event.safishamsi commentedon May 2, 2026
Can you submit a PR for the same?
Thanks
rikdoclo commentedon May 2, 2026
Cannot create PR apparently -> info hereunder
PR Title
Fix Codex PreToolUse hook-check emitting unsupported
additionalContextProblem
graphify hook-checkis installed as the CodexPreToolUsehook command:When
graphify-out/graph.jsonexists, it prints:{ "hookSpecificOutput": { "hookEventName": "PreToolUse", "additionalContext": "graphify: Knowledge graph exists..." } }Codex Desktop rejects this with:
Confirmed on:
graphifyy 0.6.5Recommended Code Change
In
graphify/__main__.py, change thehook-checkcommand so it exits successfully without printing unsupportedhookSpecificOutput.additionalContext.Current logic:
Proposed minimal fix:
Optionally, preserve old behavior behind an explicit opt-in flag/env var, but not by default:
Test To Add
Add a regression test that creates
graphify-out/graph.json, runsgraphify hook-check, and verifies no unsupported JSON is printed.Example:
Acceptance Criteria
graphify hook-checkexits0.additionalContext..codex/hooks.jsoninstalls can keep using"graphify hook-check".graphify-out/graph.jsonexists.AGENTS.md/ installed skill instructions, not through unsupported PreToolUse context injection.safishamsi commentedon May 2, 2026
Fixed in v6 (commit cf7ce3a).
graphify hook-checkis now a silent no-op — exits 0 without printing anything. Codex Desktop no longer rejects the hook. Graph guidance reaches the agent via AGENTS.md and the installed skill instead. Thanks @rikdoclo for the detailed diagnosis and suggested fix!rexkoh425 commentedon May 2, 2026
OS: Windows
Virtual Enviroment: PyEnv
CLI : Powershell
Python version: 3.14.0
Agent: Codex
Agent platform: VSCode Codex Extension
Previous Issue
#651 (comment)
Hypothesis : Codex’s environment PATH does not include .venv/Scripts. Likely due to using codex's vscode extension instead of Codex CLI.
Tested Solution :
graphify hook-checkwith.venv/Scripts/graphify.exe hook-checkProposed Solution :
graphify codex installdynamically sources for graphify.exe and writes to hook```powershell $g = Get-ChildItem -Recurse -Filter graphify.exe -ErrorAction SilentlyContinue | Select-Object -First 1 if ($g) { Resolve-Path -Relative $g.FullName } else { "graphify.exe not found" } ```New Issue
Linked to #651 (comment)
Linked to #533
@safishamsi
fix #651: resolve absolute graphify path at codex install time for VS…
safishamsi commentedon May 2, 2026
Also fixed the PATH issue you reported @rexkoh425 (commit 96267ad).
graphify codex installnow writes the absolute path to the graphify executable intohooks.jsoninstead of the baregraphifycommand — so it works even when.venv/Scriptsisn't on Codex's PATH in the VS Code extension. Re-rungraphify codex installafter upgrading to regenerate the hook with the full path.Let me know if there any regressions yet again after the fix
mjjabarullah commentedon May 2, 2026
on fresh session i got
rexkoh425 commentedon May 2, 2026
Will run again after version 0.6.8 is released with the new changes. Thanks!
Edit:
PreHookUse successfully runs from v0.6.8 after running
#522 #533. Please verify. Thanks.
@safishamsi
fix Graphify-Labs#651: hook-check exits silently instead of emitting …
fix Graphify-Labs#651: resolve absolute graphify path at codex instal…