Skip to content

feat(T23): LangGraph retry loop for trending curator - #9

Merged
DamengRandom merged 2 commits into
masterfrom
feat/T23-curator-retry-graph
Jul 30, 2026
Merged

feat(T23): LangGraph retry loop for trending curator#9
DamengRandom merged 2 commits into
masterfrom
feat/T23-curator-retry-graph

Conversation

@DamengRandom

Copy link
Copy Markdown
Owner

Summary

  • Replaces the one-shot trendingCuratorAgent call in the GitHub Trending pipeline with a small LangGraph StateGraph: 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 list
  • Adds LangSmith tracing (LANGSMITH_* env vars only — no code changes) across all three scheduled GitHub Actions workflows
  • Adds a node:test + tsx unit test suite for the retry graph (happy path, retry-then-succeed, exhausted-retries)
  • Consolidates duplicate CuratedRepo type and extracts shared toolOutput/parseJson/notifyError helpers into agent/utils.ts
  • Updates README: correct LLM provider docs (OpenRouter, not Anthropic), removes stale demo video, adds LangSmith section + screenshot, testing instructions

Test plan

  • pnpm tsc — no errors
  • pnpm test — all 3 unit tests pass
  • Manual smoke test: forced invalid LLM_API_KEY for one pnpm news run — confirmed real retry against trendingCuratorAgent, correct give-up after 2 attempts, and a real Telegram failure alert
  • Manual smoke test: pnpm news with valid credentials — confirmed full happy path (curate → Telegram digest → DB save)

🤖 Generated with Claude Code

https://claude.ai/code/session_01CtRxtJgwNeyMyTnYxuxoH6

DamengRandom and others added 2 commits July 30, 2026 20:17
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
@DamengRandom
DamengRandom merged commit d8c501b into master Jul 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant