Skip to content

fix(claude): use host invocation for auth detection - #2411

Closed
xing-qnex wants to merge 1 commit into
garrytan:mainfrom
xing-qnex:codex/claude-cross-review-mechanism
Closed

xing-qnex wants to merge 1 commit into
garrytan:mainfrom
xing-qnex:codex/claude-cross-review-mechanism

Conversation

@xing-qnex

Copy link
Copy Markdown

Summary

Fix the generated gstack-claude skill so Codex and other sandboxed hosts use the real host Claude Code invocation as the authentication check.

Root cause

The skill previously inferred authentication from $HOME/.claude/.credentials.json or ANTHROPIC_API_KEY. That is unreliable when Claude Code uses the macOS Keychain and the calling agent's sandbox cannot see host credentials. The temp-file templates also appended suffixes after XXXXXX, which is not accepted by macOS mktemp.

Changes

  • Resolve claude and invoke the same binary in the host execution context.
  • Do not report an auth blocker until the actual claude -p invocation returns an auth/login error.
  • Keep review/challenge calls tool-less with --disable-slash-commands --tools "".
  • Use macOS-compatible mktemp templates with XXXXXX at the end.
  • Add deterministic generated-skill and real host mktemp regression tests.

Validation

  • bun test test/gen-skill-docs.test.ts: 403 passed, 0 failed
  • macOS smoke for prompt/response/error/diff temp templates: passed
  • git diff --check: passed

The full repository suite was also sampled, but it contains unrelated environment-dependent failures involving gbrain fixtures, local ports, ~/.gstack sandbox writes, and SwiftPM. This PR's targeted generation suite is green.

@trunk-io

trunk-io Bot commented Jul 31, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@xing-qnex
xing-qnex marked this pull request as ready for review July 31, 2026 10:27
@xing-qnex

Copy link
Copy Markdown
Author

/trunk merge

@trunk-io

trunk-io Bot commented Jul 31, 2026

Copy link
Copy Markdown

An error occurred while submitting your PR to the queue: Only users that are a part of this repo's Trunk organization or have write permissions to the repo can submit a PR to the queue

@garrytan

Copy link
Copy Markdown
Owner

Closing: this was absorbed or superseded on main by v1.67.0.0 or earlier (see the v1.67 tracker-wave receipts in PR #2604). Thank you!

@garrytan garrytan closed this Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants