Spike: PTY-based Claude Code integration with multi-agent concurrency
Proves that spawning `claude -p` in a pseudo-terminal from Rust gets Max subscription billing (apiKeySource: "none", rateLimitType: "five_hour") instead of per-token API charges. Concurrent agents run in parallel PTY sessions with session resumption via --resume for multi-turn conversations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -406,7 +406,8 @@ export function Chat({ projectPath, onCloseProject }: ChatProps) {
|
||||
const messageToSend = messageOverride ?? input;
|
||||
if (!messageToSend.trim() || loading) return;
|
||||
|
||||
if (model.startsWith("claude-")) {
|
||||
const isClaudeCode = model === "claude-code-pty";
|
||||
if (!isClaudeCode && model.startsWith("claude-")) {
|
||||
const hasKey = await api.getAnthropicApiKeyExists();
|
||||
if (!hasKey) {
|
||||
pendingMessageRef.current = messageToSend;
|
||||
@@ -426,8 +427,13 @@ export function Chat({ projectPath, onCloseProject }: ChatProps) {
|
||||
setStreamingContent("");
|
||||
|
||||
try {
|
||||
const provider = isClaudeCode
|
||||
? "claude-code"
|
||||
: model.startsWith("claude-")
|
||||
? "anthropic"
|
||||
: "ollama";
|
||||
const config: ProviderConfig = {
|
||||
provider: model.startsWith("claude-") ? "anthropic" : "ollama",
|
||||
provider,
|
||||
model,
|
||||
base_url: "http://localhost:11434",
|
||||
enable_tools: enableTools,
|
||||
|
||||
Reference in New Issue
Block a user