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
A headless Grok review can stop on a tool-permission request while the CLI exits 0. The runner previously reported malformed output, cleared model metadata, and hid the cancellation reason behind the first 4,000 characters of startup warnings.
Grok read-only lanes now expose only file-reading tools. The runner distinguishes provider cancellation and failure from malformed JSON, retains model/session/usage evidence, and saves complete stdout and stderr beside the receipt without overwriting existing files. Isolated-write permissions are unchanged.
Verification
Bun tests, strict typecheck, static invariants, and plugin validation pass.
The exact candidate is installed in every affected harness.
The changed behavior passes from each real user surface.
The installed version, action, and observed result appear below.
Validation on macOS with Bun 1.4.2:
Focused parser/command tests: 11 passed. New runner regressions: 6 passed.
Full Bun suite: 163 passed, 1 failed. The existing spends one explicit deadline across preflight and model execution test times out during preflight. The same isolated test fails against unchanged installed Open Pstack 1.4.1, with the expected preflight passed instead reported as timed-out. Its 1,200ms fake preflight leaves 300ms for process startup; no timing assertion was changed.
All strict typechecks, static invariants, manifest JSON validation, and diff whitespace checks passed.
Actual CLI replay before the fix: exit 65, malformed-output, null model, cancellation reason absent. After: exit 130, cancelled, verified grok-4.6-build, exact reason retained, full stdout and 6,401 stderr bytes saved.
A real Grok call through the candidate runner from Codex completed using only read_file and returned GROK_READ_ONLY_OK. The receipt reports complete, grok-4.6-build, modelVerified true, and saved stdout/stderr. The pre-existing bounded authentication preflight retry also recovered successfully.
Installed version remains Open Pstack 1.4.1. The modified runner was tested from its source worktree, not installed into the Claude Code or Codex plugin cache. This remains a draft pending the required installed live checks in both harnesses. No merge, release, or rollout is requested.
The PR appears safe to merge based on the reviewed changes, with no actionable correctness or security defects identified.
Summary
This PR narrows Grok read-only lanes to file-reading tools and improves runner evidence for provider-reported cancellation and failure.
Distinguishes well-formed Grok cancellation and provider failures from malformed output.
Preserves reported model, session, usage, cost, and provider error details on failed attempts.
Exclusively reserves and records complete per-run stdout and stderr sidecars.
Keeps isolated-write Grok terminal access unchanged and documents the revised dispatch contract.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Validate paths and reserve output artifacts] --> B[Run authentication preflight]
B -->|Fails| C[Write dropout receipt]
B -->|Passes| D[Run provider and capture stdout/stderr sidecars]
D --> E{Terminal outcome}
E -->|Successful, valid output| F[Verify model and write final output]
E -->|Grok cancellation| G[Preserve metadata and write cancelled receipt]
E -->|Grok provider failure| H[Preserve metadata and write child-failed receipt]
E -->|Malformed output| I[Write malformed-output receipt]
F --> J[Return mapped runner exit code]
G --> J
H --> J
I --> J
C --> J
Thanks for this, @cliffordfajardo. I appreciate the time you put into it. Open Pstack now accepts contributions as detailed issues rather than pull requests, so I'm closing this one. If it's still relevant, please open an issue describing the problem, how to reproduce it, and the change you'd suggest. I'll take it from there.
Follow-up to the close: this work is already tracked in #78, so there is no need to open a new issue. This PR is noted there as prior art and will be credited when the fix lands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #78
What changed
A headless Grok review can stop on a tool-permission request while the CLI exits 0. The runner previously reported malformed output, cleared model metadata, and hid the cancellation reason behind the first 4,000 characters of startup warnings.
Grok read-only lanes now expose only file-reading tools. The runner distinguishes provider cancellation and failure from malformed JSON, retains model/session/usage evidence, and saves complete stdout and stderr beside the receipt without overwriting existing files. Isolated-write permissions are unchanged.
Verification
Validation on macOS with Bun 1.4.2:
spends one explicit deadline across preflight and model executiontest times out during preflight. The same isolated test fails against unchanged installed Open Pstack 1.4.1, with the expected preflightpassedinstead reported astimed-out. Its 1,200ms fake preflight leaves 300ms for process startup; no timing assertion was changed.Installed version remains Open Pstack 1.4.1. The modified runner was tested from its source worktree, not installed into the Claude Code or Codex plugin cache. This remains a draft pending the required installed live checks in both harnesses. No merge, release, or rollout is requested.