Repository navigation
Closed
Description
Plan (maintainer, 2026-10-12)
Eric chose this plan on 2026-10-12. The original report follows below, unchanged.
Scope (revised after the 2026-10-12 design pass)
- Wrapper. Take the whole superpowers 7.0.0
hooks/run-hook.cmd(bb92a77), keeping the port's adaptation header, and update itsNOTICE.mdrow. session-start. Read the adjacent context file with Bash built-ins, so a Git Bash without/usr/binonPATHstill prints the context. Exit nonzero when the file is missing.hooks.json. Add the CodexcommandWindowsoverride that runs the wrapper throughcmd.exe, and keep the genericcommand.resumeis deferred (see the design-pass comment).- Verifier. A startup-hook case for Claude Code and for Codex in
.claude/skills/verify-open-pstack/features/recipes.ts, asserting from the native record that the pstack context reached the session. Map the new workflow file infeatures/registry.jsonunderproject. - Windows CI job on GitHub's
windows-latestrunner:- On every PR, run the wrapper directly with no login: it exits 0 and prints the context, with an ordinary and a restricted
PATHand a plugin path containing spaces, and it exits nonzero when the context file or the script is missing. - The interactive Codex login job is dropped (2026-10-12). Unfret showed that a real login on a runner that runs pull request code exposes the credential, so CI never holds a login.
- On every PR, run the wrapper directly with no login: it exits 0 and prints the context, with an ordinary and a restricted
Acceptance criteria
- The wrapper checks pass on
windows-latest. The labeled Codex run onDropped with the login job. The reporter confirms the Codex desktop app on the exact head; that confirmation is evidence, not a merge gate.windows-latestshows the SessionStart context in a real session.- The Mac live gate passes the new startup-hook case in Claude Code and Codex, plus
project-skillin both under--self-test, from the candidate head. - Bun tests, strict typecheck, static invariants and plugin validation pass.
Constraints
- The workflow change sits under
.github/, so Eric queues the PR by hand. - The Windows run is evidence beside the Mac
live-gate, which stays the merge gate. The verifier refuses non-Darwin hosts. - Not covered: the Codex desktop app on Windows. The reporter can confirm it on the exact head.
Original report
Environment
- Windows Codex desktop app
pstack@open-pstack1.5.0, enabled and hook trusted- Git for Windows installed at
C:\Program Files\Git
Actual behavior
Starting a Codex chat shows one failed plugin SessionStart run: hook exited with code 1. The pstack context is absent from the chat. The user can run a locally patched hook directly and get the expected You have pstack. context. The stock 1.5.0 script fails when run directly with Git Bash on this machine.
Expected behavior
The automatic SessionStart run should exit 0 and add the pstack context to the new or resumed chat.
Reproduction
- Install and enable pstack 1.5.0 on Windows and trust its hook.
- Start a new Codex chat and inspect Hook stats. The plugin
SessionStartrun fails with exit code 1. - Run the stock
hooks/session-startwith Git Bash. It reportsdirname: command not foundandcat: not foundand exits 127. The stockrun-hook.cmd session-startwrapper reports exit 0 despite those errors. - Repair the script locally and call it directly. It prints the expected context, but a plugin cache refresh restores the stock files and the automatic failure returns.
Findings
hooks/hooks.jsonsupplies only a genericcommandcontaining${CLAUDE_PLUGIN_ROOT}. Codex supports a Windows-specificcommandWindowsfield, but pstack does not set it. The missing override is a likely cause of the automatic launch failure; the desktop Hook stats do not expose stderr, so this particular cause is not yet directly confirmed from that run.- The matcher is
startup|clear|compact, so it omits Codex'sresumesource. - Git Bash on this machine starts without
/usr/binonPATH. Thesession-startscript then cannot finddirnameorcatand exits 127. run-hook.cmduses%ERRORLEVEL%inside parenthesized blocks.cmd.exeexpands that value before Bash runs, so the wrapper can report 0 even when the script fails. A missing script reproduced this false success.- The installed plugin cache was refreshed after a local patch. This restored the three stock files and made the failure recur.
Proposed fix
- Add
commandWindowsthat invokes the wrapper throughcmd.exeand%PLUGIN_ROOT%. - Include
resumein the matcher. - Make
session-startread its adjacent context file using Bash built-ins, without depending onPATH. - Use delayed expansion for
!ERRORLEVEL!in the Windows wrapper.
A local source patch is prepared in plugins/pstack/hooks/{hooks.json,session-start,run-hook.cmd}.
Verification performed
- The configured Windows command exits 0 and prints the expected context.
- A missing context file exits 1; a missing script exits 127.
- In a fresh ephemeral Codex session using the patched local plugin and one-run hook-trust bypass, the agent confirmed that the
You have pstack.developer context was present. This test did not use the desktop app's installed cache.
Changing the hook definition changes its trust hash, so users need to review and trust the updated hook before normal automatic runs resume.
Metadata
Metadata
Assignees
Labels
No labels
Activity
ericlitman commentedon Oct 12, 2026
Thanks for the detailed report and the patch. Here's the plan:
run-hook.cmd, which already fixes the%ERRORLEVEL%expansion you found.resumematcher, and makesession-startindependent ofPATH, along the lines you proposed.The plan is now at the top of this issue. When the PR is up, it would help a lot if you could install that exact head in the Codex desktop app on your machine and confirm the hook runs. CI covers the CLI, not the desktop app.
ericlitman commentedon Oct 12, 2026
Design pass (2026-10-12, Astra high, read-only at
a41d063)Record:
~/projects/docs/projects/open-pstack/records/2026-10-12-batch-153/design-127.md(private docs repo).Accepted
run-hook.cmd(bb92a77), keeping the port's adaptation header and updating itsNOTICE.mdrow. It already fixes exit propagation, adds per-user Git discovery and skips the WSL launchers, so delayed expansion is unnecessary.session-start: use upstream's adjacent-file path and built-in read techniques, but keep pstack's nonzero exit when the context file is missing. Upstream prints error text and succeeds. Do not import its multi-platform JSON output.hooks.json: add the CodexcommandWindowsoverride that runs the wrapper throughcmd.exe, and keep the genericcommand. Claude Code does not documentcommandWindows. The PR shows that Claude still loads the hook.Unmapped pathin the verifier. Map it underproject, which makes this PR a verifier change: the live run uses the candidate head as publisher revision with--self-test.session-starttoday. Add a startup-hook case for each harness. First establish that the native Claude stream and the Codex rollout show the injected context. If either does not, stop and report.workflow_dispatchonly for a workflow on the default branch, so a new workflow cannot prove itself before merge. The Windows Codex job also runs onpull_requestwhen Eric adds a label, for same-repository PRs only, so fork code never runs beside his login. Manual dispatch stays for later runs. Upload only the intended evidence, never the Codex home.Rejected or deferred
resumein the matcher, deferred. Superpowers' matcher also leaves it out. Adding it changes Claude Code, which would re-inject the context on every resumed session. No resumed session has been shown missing the context. This also drops the resume recipes. Reopened if a resumed Codex session shows the context missing.ericlitman commentedon Oct 12, 2026
This PR will also carry one line for #166: removing the unexplained 5,000-byte cap on the Claude Reflect report (
f7c9c3a, Eric 2026-10-12). It edits the same verifier file,features/recipes.ts.ci(windows): drop the Codex login job and keep the login-free wrapper…
docs(reference): name Bash as the Windows prerequisite for the Sessio…
fix(hooks): start the Windows SessionStart hook through an explicit c…
fix(hooks): run the Windows SessionStart hook the same way in PowerSh…
Merge pull request #171 from ericlitman/fix/127-windows-session-start
fix(hooks): run the SessionStart hook on Windows Codex and read its c…
test(verify): check the SessionStart hook natively and on a Windows r…
test(verify): give the runner writer test record the new context field (
release: Open Pstack 1.8.0 with the model catalog and the Windows Ses…