Skip to content

Fix Codex setup with Claude JSON event arrays and Grok API-key authentication #58

Closed

Description

@AojdevStudio

Codex setup against pstack 1.3.0 fails at two provider boundaries. Claude Code 2.1.263 emits a JSON event array containing a successful terminal result, while parseClaude accepts only a single object. Grok models exits successfully, lists grok-4.6, and reports You are using XAI_API_KEY., while the preflight requires logged in. Preserve legacy result objects, terminal failure handling, exact model evidence, and authenticated live probes. Add regression coverage for both cases and verify the installed candidate from the real Codex surface. Optional Astra support overlaps PR #55; model extension routing will align with that work.

Activity

  1. ericlitman commented on Oct 1, 2026

    @ericlitman
    Owner

    Prior art: #59 (Claude event arrays) and #75 (Grok XAI_API_KEY auth). Planned as one PR with the stdin part of #94.

  2. Repository owner deleted a comment from mast-factory on Oct 2, 2026
  3. ericlitman commented on Oct 4, 2026

    @ericlitman
    Owner

    Factory plan verdict: revise

    • Card: Delivery 8ea81502, plan-review revision 8.
    • Plan reviewed: the plan posted 2026-09-09.
    • Planner model: gpt-5.6-sol.
    • Reviewer model: Claude Opus 5.5, reviewing in a separate context.
    • Rubric: the factory-adjudicate plan checklist.

    The design for both defects is sound: Claude JSON event arrays parsed by their final type:"result" event, and Grok XAI_API_KEY preflight accepted only with the exact model listed. Three gates fail.

    1. Stale base. The plan says "Implement from current main". The runner files it edits have changed a great deal since 2026-09-09, and two open PRs change them further:

      What passes: build on origin/factory/issue-124 (e257bad), which contains Preserve Grok terminal failures and complete runner evidence [#78] #126, and land after Preserve Grok terminal failures and complete runner evidence [#78] #126 and Explain Codex sandbox restrictions before pstack setup probes [#124] #129. Update by merging, never by rebasing or force-pushing. Re-anchor every finding and line reference to that base, and recompute the pre-fix baseline there.

    2. Missing scope. On 2026-10-01, triage put the stdin EPERM part of Fix runner subprocess I/O for Codex provider probes #94 into this PR. Bun's child-stdin write fails with EPERM on some hosts, while Node's child-process path succeeds. The Cursor status-pipe part of Fix runner subprocess I/O for Codex provider probes #94 moved to Support Cursor CLI as an external worker provider #71.

      What passes: add a phase for Fix runner subprocess I/O for Codex provider probes #94's stdin finding. Send the prompt through a child-stdin path that works where Bun's stdin pipe write fails. Add regression coverage for the write path, and classify the failure accurately. Keep the explicit-timeout and no-fallback behaviour unchanged. Name the exact mechanism in the plan. If it needs an empirical check on a host that reproduces EPERM, list that under Open questions; don't guess.

    3. Grok preflight against Preserve Grok terminal failures and complete runner evidence [#78] #126. Preserve Grok terminal failures and complete runner evidence [#78] #126 changed how Grok failures are classified. Show that XAI_API_KEY acceptance composes with it:

      • API-key auth with the exact model listed reaches model execution.
      • An explicit "not supported" or "unauthenticated" message still fails closed before launch.

      Add a regression for each against the new base.

    Keep the 4-file budget as a guide; #94 adds run.ts/run.test.ts work, not new files. Prior art: #59, #75.

  4. ericlitman commented on Oct 4, 2026

    @ericlitman
    Owner

    Factory plan verdict: approve, with Phase 4 removed

    • Card: Delivery 8ea81502, plan-review revision 11.
    • Planner model: gpt-6.1-sol.
    • Reviewer model: Claude Opus 5.5, reviewing in a separate context.
    • Rubric: the factory-adjudicate plan checklist.

    The open question, resolved by the maintainer's delegate

    The plan asked which host reproduces #94's Bun child-stdin EPERM. I tested the plan's exact control on the operator's Mac with Bun 1.4.0. Bun.spawn(["cat"], {stdin:"pipe"}), then stdin.write, returned "STDIN_CONTROL\n" with exit 0:

    • directly;
    • inside a Codex 0.160.0 workspace-write session with network disabled;
    • inside a danger-full-access session.

    The report names Bun 1.4.2 on an unspecified host. No accessible host reproduces it.

    Decision: remove Phase 4 (the regular-file stdin transport) and the #94 rows from this PR's scope. Changing transport with no reproduction would be a speculative change that the plan's own empirical gate forbids. #94's stdin part stays open until someone reproduces it on a known host.

    Why approve the rest

    Build conditions

    1. Drop Phase 4 and its acceptance rows. Make no change to runProcess stdin handling.
    2. In the PR body, write "Fix runner subprocess I/O for Codex provider probes #94 stdin: not reproducible on available hosts (Bun 1.4.0, macOS, Codex sandboxes); left open". Do not write "Fixes Fix runner subprocess I/O for Codex provider probes #94".
    3. Before opening the PR, run the Phase 5 automated gates and report each exit status. Push normally.
    4. The live test runs after review, from both parents:
      • a real Codex-parent external Claude lane whose output is a JSON event array;
      • a real Grok lane authenticated by XAI_API_KEY, if the operator provides a key. Otherwise the plan records that as blocked.
  5. added 3 commits that reference this issue on Oct 4, 2026
  6. added a commit that references this issue on Oct 4, 2026
  7. added 2 commits that reference this issue on Oct 4, 2026
  8. ericlitman commented on Oct 4, 2026

    @ericlitman
    Owner

    Acceptance amendment for #58, approved by the maintainer on 2026-10-04

    The plan's live Claude JSON event-array item is accepted as covered by regression tests. Claude Code 2.1.289 emits a single result object under the runner's --output-format json flags. It emits the event-array form only with --verbose, which the runner doesn't pass. So a real-surface array can't be produced. The live gate on PR #130 (heads 5d75866 and 927a7b6) covered the legacy-object path, and Grok XAI_API_KEY preflight from both parents. #94's stdin part stays open, as approved. The post-merge checks passed on main 67c08fa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions