feat(T23): LangGraph retry loop for trending curator - #9
Merged
Conversation
Replaces the one-shot trendingCuratorAgent call with a small LangGraph StateGraph: on invalid/unparseable output, retries once with the validation error fed back into the prompt, then gives up and alerts via Telegram instead of silently returning an empty repo list. Also adds LangSmith tracing (env-var only, no code changes needed), a node:test + tsx unit test suite for the retry graph, and updates the README to match current setup (OpenRouter LLM provider, testing, observability). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CtRxtJgwNeyMyTnYxuxoH6
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CtRxtJgwNeyMyTnYxuxoH6
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
trendingCuratorAgentcall in the GitHub Trending pipeline with a small LangGraphStateGraph: on invalid/unparseable curator output, retries once with the validation error fed back into the prompt; after exhausting retries, alerts via Telegram (notifyError) instead of silently returning an empty repo listLANGSMITH_*env vars only — no code changes) across all three scheduled GitHub Actions workflowsnode:test+tsxunit test suite for the retry graph (happy path, retry-then-succeed, exhausted-retries)CuratedRepotype and extracts sharedtoolOutput/parseJson/notifyErrorhelpers intoagent/utils.tsTest plan
pnpm tsc— no errorspnpm test— all 3 unit tests passLLM_API_KEYfor onepnpm newsrun — confirmed real retry againsttrendingCuratorAgent, correct give-up after 2 attempts, and a real Telegram failure alertpnpm newswith valid credentials — confirmed full happy path (curate → Telegram digest → DB save)🤖 Generated with Claude Code
https://claude.ai/code/session_01CtRxtJgwNeyMyTnYxuxoH6