feat(T22): replace Anthropic SDK with OpenAI-compatible provider - #8
Merged
Conversation
Swap every agent off @langchain/anthropic onto any OpenAI-compatible endpoint, defaulting to OpenRouter with the free nemotron model. - add src/agent/llm.ts — single createLlm(temperature) factory, provider selected by LLM_BASE_URL (OpenRouter default, NVIDIA NIM supported) - drop the six duplicated ChatAnthropic instances across the agents - remove @langchain/anthropic; bump @langchain/core for the openai peer - swap ANTHROPIC_API_KEY for LLM_API_KEY in the three workflows - disable the mock user seeding cron (workflow_dispatch retained) Trending digest improvements: - align repo count at 5-8 across prompt, tool schema and user message; the schema description was silently overriding the prompt's "1-3" - bound summaries to 140 chars in code, not just in the prompt - restrict tags to a closed vocabulary so hashtags stay searchable - escape url and tags before rendering into the HTML message Fix total star counts always rendering as 0: GitHub puts an svg icon between the stargazers anchor and the number, so the regex never matched. Verified against the live page (0 matches before, 18 after). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CFr2cPw9xvDvStaya9sDW8
The v2 action verifies `fallow-lsp` and `fallow-mcp` binaries, but from fallow 3.x the platform packages ship a single multicall `fallow` binary. Since the action installs the latest CLI by default, every run failed with `binary-missing`. v3's verifier expects only `fallow`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CFr2cPw9xvDvStaya9sDW8
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
Moves every agent off the Anthropic SDK onto any OpenAI-compatible endpoint, defaulting to OpenRouter with
nvidia/nemotron-3-ultra-550b-a55b:free. Follows the pattern already used in thedamoproject'sKpiSummaryAgent.@langchain/anthropicis removed entirely — no references remain insrc/, the workflows,.env.example, or the README.Changes
Provider swap
src/agent/llm.ts— a singlecreateLlm(temperature)factory. Provider is chosen byLLM_BASE_URL; OpenRouter and the nemotron free model are the built-in defaults, so only the API key is required. NVIDIA NIM works by overridingLLM_BASE_URL/LLM_MODEL.new ChatAnthropic(...)instances across the agents.LLM_API_KEYis unset rather than failing deep inside an agent call.@langchain/corebumped to satisfy@langchain/openai's peer dependency.Mock users — seeding cron disabled,
workflow_dispatchretained. Code untouched.Trending digest prompt
.describe()said 5–8 while the prompt said 1–3; the schema was silently winning.urlandtagsare now escaped before going into the HTML message.Bug fix — star counts were always 0
The digest had been sending
⭐ 0for every repo. GitHub places a star<svg>between the stargazers anchor and the number, and the regex expected digits immediately after the opening tag. Against the live page: 0 matches before, 18 after.Testing
Ran
pnpm newsend to end against the free model. Verified from the database:stars = 0pnpm run tscTelegram delivery confirmed on each run.
Deploy notes
One secret change under Settings → Secrets and variables → Actions:
ANTHROPIC_API_KEYLLM_API_KEY(OpenRouter key)All other secrets are unchanged.
Known issue, not addressed here
The free model occasionally skips the tool call.
curateReposcannot distinguish that from "the model curated nothing" —toolOutputreturns'',parseJsonfalls back to{}, and the job exits quietly. On Actions that is a green check with no digest sent. Hit once during testing; an immediate re-run with identical input succeeded. Worth a retry-on-missing-tool-call in a follow-up.🤖 Generated with Claude Code
https://claude.ai/code/session_01CFr2cPw9xvDvStaya9sDW8