Pi-mono Tier 0 #4 — manual port (sf went off-task; ported directly). undici's default 300s bodyTimeout aborts long local-LLM SSE streams (e.g. vLLM buffering a large tool call) with UND_ERR_BODY_TIMEOUT. retry.provider.timeoutMs cannot lift this cap — it controls the provider SDK's AbortController, not undici's per-socket idle timer. Pass {bodyTimeout: 0, headersTimeout: 0} to EnvHttpProxyAgent. Provider SDKs continue to enforce their own deadlines. Type-check passes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 lines
926 B
JavaScript
22 lines
926 B
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* CLI entry point for the refactored coding agent.
|
|
* Uses main.ts with AgentSession and new mode modules.
|
|
*
|
|
* Test with: npx tsx src/cli-new.ts [args...]
|
|
*/
|
|
process.title = "pi";
|
|
|
|
import { setBedrockProviderModule } from "@singularity-forge/pi-ai";
|
|
import { bedrockProviderModule } from "@singularity-forge/pi-ai/bedrock-provider";
|
|
import { EnvHttpProxyAgent, setGlobalDispatcher } from "undici";
|
|
import { main } from "./main.js";
|
|
|
|
// bodyTimeout/headersTimeout default to 300s in undici; long local-LLM stalls
|
|
// (e.g. vLLM buffering a large tool call) exceed that and abort the SSE stream
|
|
// with UND_ERR_BODY_TIMEOUT. Disable both — provider SDKs enforce their own
|
|
// AbortController-based deadlines via retry.provider.timeoutMs.
|
|
setGlobalDispatcher(new EnvHttpProxyAgent({ bodyTimeout: 0, headersTimeout: 0 }));
|
|
setBedrockProviderModule(bedrockProviderModule);
|
|
|
|
main(process.argv.slice(2));
|