Skip to content

fix(Telos): replace subprocess spawn with direct inference() import#911

Open
rikitikitavi2012-debug wants to merge 1 commit intodanielmiessler:mainfrom
rikitikitavi2012-debug:fix/mineratings-argmax
Open

fix(Telos): replace subprocess spawn with direct inference() import#911
rikitikitavi2012-debug wants to merge 1 commit intodanielmiessler:mainfrom
rikitikitavi2012-debug:fix/mineratings-argmax

Conversation

@rikitikitavi2012-debug
Copy link

Summary

Root cause

route.ts spawned a subprocess passing system prompt and user message as positional CLI arguments. With rich TELOS context, these can approach OS ARG_MAX limits (128-256KB), causing silent failures.

Fix

Direct import of inference() function which handles prompts internally via stdin, bypassing any argument length limits.

Related to #905

Test plan

  • bash -n syntax check on modified file
  • Import path resolves correctly via dynamic import
  • Minimal diff — only inference invocation changed

🤖 Generated with Claude Code

Replace the spawn('bun', [...Inference.ts, systemPrompt, message])
pattern with a direct import of the inference() function. The old
approach passed both system prompt and user prompt as CLI positional
arguments, which risks hitting OS ARG_MAX limits when the TELOS
context grows large.

The inference() function already handles large inputs safely by
piping user prompts via stdin to the underlying claude process.
Using it directly eliminates the subprocess overhead and the
ARG_MAX surface entirely.

Closes danielmiessler#905

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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