feat(tri-bot): Replace claude CLI with direct Anthropic API + SSE streaming (Issue #62)#63
Merged
Merged
Conversation
…eaming (Issue #62) BREAKING: tri-bot no longer depends on claude CLI (Node.js/TypeScript). Full pipeline: Telegram → Zig → api.anthropic.com (pure std.http.Client). Changes: - claude_stream.zig: REWRITE — POST with stream:true, parse SSE events inline - handlers.zig: /status uses git commands directly (no claude), /sessions stubbed - bot_loop.zig: /continue, /resume deferred to Phase 5 (sessions) - telegram_api.zig: add api_key to BotConfig - main.zig: read ANTHROPIC_API_KEY from env - /stop: cancel flag instead of SIGTERM (no child process) Zero references to "claude" binary remain in bot/. Net -88 lines. Closes #62 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
gHashTag
added a commit
that referenced
this pull request
Mar 18, 2026
…des) [Golden Chain #63] - Add 8 QuarkType variants (80-87): community_node, gossip_broadcast, dht_lookup, community_sync, gossip_propagate, dht_store, community_consensus, community_anchor (88/128 u7 capacity) - Add 4 types: CommunityNodeState27, GossipProtocolState, DHTState, CommunityNodeRecord - Add 5 agent methods: joinCommunity, gossipBroadcast, dhtLookup, registerCommunityNode, communityVerify (Phase N) - Update quark distribution 112→120 (15+15+15+16+15+14+15+15) - Add Phase N verification: N1 active>=10k, N2 gossip active, N3 DHT operational - Add 4 ChainMessageTypes: CommunityNode, GossipBroadcast, DHTLookup, CommunitySyncEvent - Export v11: 62-byte header (+4 bytes: community_active_nodes + dht_lookups) - Sync WASM stub with all v2.7 additions - Canvas: +4 ChatMsgType with colors (lime green, coral, dodger blue, orchid) - 20 new tests, 3054/3060 pass (pre-existing failures only) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
gHashTag
added a commit
that referenced
this pull request
Mar 18, 2026
…eaming (Issue #62) (#63) BREAKING: tri-bot no longer depends on claude CLI (Node.js/TypeScript). Full pipeline: Telegram → Zig → api.anthropic.com (pure std.http.Client). Changes: - claude_stream.zig: REWRITE — POST with stream:true, parse SSE events inline - handlers.zig: /status uses git commands directly (no claude), /sessions stubbed - bot_loop.zig: /continue, /resume deferred to Phase 5 (sessions) - telegram_api.zig: add api_key to BotConfig - main.zig: read ANTHROPIC_API_KEY from env - /stop: cancel flag instead of SIGTERM (no child process) Zero references to "claude" binary remain in bot/. Net -88 lines. Closes #62 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Antigravity Agent <antigravity@vibee.org> Co-authored-by: Claude <noreply@anthropic.com>
13 tasks
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
api.anthropic.com/v1/messageswithstream:true, parse SSEdata:lines inline, extractcontent_block_deltatext/statususesgitcommands directly (branch, log, status),/sessionsstubbed for Phase 5, dead code removed (old handleAsk/handleContinue)/continue+/resumedeferred to Phase 5, simplified dispatchapi_keyadded toBotConfigANTHROPIC_API_KEYfrom env/stop: cancel flag (atomic bool) instead of SIGTERM — no child process to killZero references to
"claude"binary remain in bot/.Net result: -88 lines. Pipeline:
Telegram → Zig → api.anthropic.com(purestd.http.Client).Before vs After
Test plan
zig build— all targets compile (0 errors)zig fmt— cleangrep "claude" bot/— zero matches (CLI fully removed)/askstreams via SSE with real API keyCloses #62
🤖 Generated with Claude Code