Open
Conversation
Add src/cli.ts as a new CLI entrypoint providing subcommands: - init: configure cashclaw without browser UI (reads ANTHROPIC/OPENAI/OPENROUTER_API_KEY from env) - start: start daemon with PID file, no browser auto-open - stop: stop daemon via PID file - status: show config and daemon running state - config show: display config with API key redacted Update tsup.config.ts and package.json to expose cashclaw-cli binary.
Add LLMConfig.apiKeyEnvVar field so API key can be read from environment variables at runtime instead of being stored in config.json. - config.ts: add apiKeyEnvVar field and resolveApiKey() helper - llm/index.ts: use resolveApiKey() instead of config.apiKey directly - cli.ts: add --use-env-key and --api-key-env-var flags to init command Usage (agent-gateway credentials, no key stored in config): cashclaw-cli init --agent-id <id> --provider anthropic --use-env-key
Implement ReAct-style claude CLI provider that spawns local `claude` binary as subprocess, eliminating the need for ANTHROPIC_API_KEY. - src/llm/claude-cli.ts: new provider using execFile with ReAct JSON protocol - src/llm/index.ts: route claude-cli provider, use resolveApiKey() everywhere - src/config.ts: add claude-cli provider type, apiKeyEnvVar field, resolveApiKey() - src/cli.ts: full CLI entrypoint (init/start/stop/status/config show)
Add full headless operation without ANTHROPIC_API_KEY: - claude-cli LLM provider (ReAct/subprocess pattern) - CLI entrypoint: init/start/stop/status/config show - PID-based daemon management - apiKeyEnvVar config field for runtime env resolution
- config/service.yaml: cashclaw service definition - scripts/register-service.sh: installs to ~/.agent-gateway/services.d/ - docs/service-manager.md: integration guide Closes moltlaunch#10
feat: service registration for universal service manager
- error イベントで scheduleWsReconnect() を呼ぶのを廃止 → ws.close() が close イベントを発火するため二重呼出しになりバックオフが加速していた - connectWs() で古い ws を removeAllListeners + terminate してから新規作成 → 再接続時に stale リスナーが残っていたバグを修正 - keepalive ping を 20s 間隔で追加(プロキシのアイドルタイムアウト対策) - pong タイムアウト 10s を追加: ping 後に pong が来なければ dead connection と判定して強制再接続 - disconnectWs() でも ping/pong タイマーをクリーンアップ Co-Authored-By: Claude <noreply@anthropic.com>
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.
問題
cashclaw が WebSocket 切断を頻発していた。原因は3点:
errorイベントがws.close()+scheduleWsReconnect()を呼び、その後closeイベントもscheduleWsReconnect()を呼ぶ。1回の切断でバックオフが2倍ずつ2回加速していたconnectWs()で前の ws をremoveAllListenersせずに新規作成していた修正内容
errorハンドラからscheduleWsReconnect()削除(closeイベントに任せる)connectWs()でws.removeAllListeners() + terminate()してから新規作成disconnectWs()で ping/pong タイマーもクリーンアップテスト計画
pnpm tsc --noEmitパス済み🤖 Generated with Claude Code