fix(inference): strip all CLAUDE_CODE_* env vars to prevent subprocess hang#934
Open
rikitikitavi2012-debug wants to merge 9 commits intodanielmiessler:mainfrom
Open
Conversation
Fix crash where String.prototype.slice splits UTF-16 surrogate pairs (like emojis) causing corrupted JSON output. Added a `safeSlice` utility function that checks if the boundary lands on a high surrogate and gracefully drops the incomplete pair. Replaced all truncation slice calls with `safeSlice` across releases. Also added tests to verify correct emoji truncation logic. Co-authored-by: rikitikitavi2012-debug <240362902+rikitikitavi2012-debug@users.noreply.github.com>
- Changed unresolved {PRINCIPAL.NAME} variable to 'User'
- Fixed PAI/USER/PROJECTS/README.md path to PAI/USER/TELOS/PROJECTS.md
Fixes danielmiessler#878, danielmiessler#879
Co-authored-by: rikitikitavi2012-debug <240362902+rikitikitavi2012-debug@users.noreply.github.com>
…-refs-3933133749775595210 docs: fix dead references in CONTEXT_ROUTING.md
…surrogate-pairs-7014975337557853207 Fix UTF-16 surrogate pair crash in RatingCapture.hook.ts
Added platform detection using process.platform to handle audio playback. For macOS, it uses afplay as before. For Linux, it detects and uses aplay or ffplay, and gracefully logs a warning if neither is found without throwing an error. Modified all release versions of server.ts. Co-authored-by: rikitikitavi2012-debug <240362902+rikitikitavi2012-debug@users.noreply.github.com>
Removed broken/dead links pointing to PAI/DEPLOYMENT.md, PAI/BROWSERAUTOMATION.md, FileBasedMCPs.md, and other unresolvable skill references across the v2, v3, and v4 documentation files. Co-authored-by: rikitikitavi2012-debug <240362902+rikitikitavi2012-debug@users.noreply.github.com>
…ver-playback-15212498456637421725 fix: support linux audio playback in VoiceServer
…ences-1436366211605020911 fix: remove dead file references from documentation across releases
…s hang Fixes danielmiessler#931. Claude Code 2.1.71+ sets additional CLAUDE_CODE_* env vars beyond CLAUDECODE that cause claude --print to hang silently inside hooks. Strip all matching vars with a prefix loop for future-proofing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rikitikitavi2012-debug
added a commit
to rikitikitavi2012-debug/PAI
that referenced
this pull request
Mar 10, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Inference.tsonly stripsCLAUDECODEenv var, but Claude Code 2.1.71+ sets additionalCLAUDE_CODE_*variables (CLAUDE_CODE_SSE_PORT,CLAUDE_CODE_ENTRYPOINT, etc.) that causeclaude --printsubprocess to hang silentlydelete env.CLAUDECODEwith a prefix-matching loop that strips bothCLAUDECODEand anyCLAUDE_CODE_*varsTest plan
claude --printsubprocess no longer hangs when invoked from within Claude Code 2.1.71+ hooksCLAUDECODEstripping still works on older Claude Code versions🤖 Generated with Claude Code