Skip to content

Support safer custom Claude Code wrappers#650

Draft
xiaobaifly7 wants to merge 1 commit into
tiann:mainfrom
xiaobaifly7:codex/custom-claude-binary
Draft

Support safer custom Claude Code wrappers#650
xiaobaifly7 wants to merge 1 commit into
tiann:mainfrom
xiaobaifly7:codex/custom-claude-binary

Conversation

@xiaobaifly7
Copy link
Copy Markdown
Contributor

Summary

  • make HAPI_CLAUDE_PATH a safer Claude Code executable/wrapper override
  • preflight custom paths for missing files, likely wrapper recursion, and Windows PATH wrapper loops
  • support Windows command/script wrappers by choosing shell mode only when needed
  • document Claude-compatible wrapper usage and add focused tests

Why

HAPI already supports HAPI_CLAUDE_PATH, but custom wrappers can fail opaquely when the configured path is missing, recursively invokes itself through a PATH shim, or needs Windows shell execution. This keeps the default Claude discovery behavior unchanged while making opt-in wrappers easier to diagnose.

Validation

  • ..\\node_modules\\.bin\\vitest.exe run src\\claude\\sdk\\utils.test.ts src\\claude\\sdk\\query.test.ts
  • rtk git diff --check
  • tsc --noEmit -p cli\\tsconfig.json --pretty false currently fails on upstream type drift unrelated to this PR (capabilities, message-cancelled, and scheduledAt typing errors outside the changed files).

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.

1 participant