Skip to content

ci: add Braintrust evals GitHub Action workflow - #149

Merged
sweetmantech merged 15 commits into
testfrom
sweetmantech/myc-3988-evals-move-to-recoup-api-repo
Jan 21, 2026
Merged

sweetmantech merged 15 commits into
testfrom
sweetmantech/myc-3988-evals-move-to-recoup-api-repo

Conversation

@sweetmantech

Copy link
Copy Markdown
Contributor

Summary

  • Added Braintrust evals workflow that runs on PRs to main and test branches
  • Uses braintrustdata/eval-action@v1 with Node.js runtime
  • Follows the setup from Braintrust docs

Setup Required

Add BRAINTRUST_API_KEY to repository secrets in GitHub Settings:

  1. Go to Settings → Secrets and variables → Actions
  2. Click "New repository secret"
  3. Name: BRAINTRUST_API_KEY
  4. Value: Your Braintrust API key

Test plan

  • Add BRAINTRUST_API_KEY secret to repository
  • Verify workflow runs on PR creation
  • Check that eval results are posted as PR comments

🤖 Generated with Claude Code

Adds evaluation workflow that runs on PRs to main and test branches.
Uses braintrustdata/eval-action@v1 with Node.js runtime.

Requires BRAINTRUST_API_KEY secret to be configured in repository settings.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jan 21, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
recoup-api Ready Ready Preview Jan 21, 2026 10:32pm

@coderabbitai

coderabbitai Bot commented Jan 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread .github/workflows/evals.yml Resolved
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jan 21, 2026 •

Copy link
Copy Markdown

Braintrust eval report

Catalog Opportunity Analysis Evaluation (HEAD-1769034686)

Score Average Improvements Regressions
Catalog_availability 22% (-57.99999999999999pp) - 3 🔴
Llm_calls 0 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 45.55s (+45.23s) - 5 🔴

Catalog Songs Count Evaluation (HEAD-1769034687)

Score Average Improvements Regressions
AnswerCorrectness 19.5% (+3pp) 3 🟢 -
Factuality 66.7% (+67pp) 2 🟢 -
Llm_calls 4 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 14.9s (+14.31s) - 3 🔴

First Week Album Sales Evaluation (HEAD-1769034686)

Score Average Improvements Regressions
Factuality 55% (+55.00000000000001pp) 3 🟢 -
Llm_calls 1 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 13.23s (+12.59s) - 4 🔴

Memory & Storage Tools Evaluation (HEAD-1769034686)

Score Average Improvements Regressions
Tools_called 0% (+0pp) - -
Llm_calls 0 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 16.36s (+15.73s) - 1 🔴

Monthly Listeners Tracking Evaluation (HEAD-1769034686)

Score Average Improvements Regressions
AnswerSimilarity 80.5% (+15pp) 5 🟢 -
Llm_calls 2 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 10.58s (+10.16s) - 5 🔴

Search Web Tool Evaluation (HEAD-1769034686)

Score Average Improvements Regressions
AnswerCorrectness 26.4% (+11pp) 11 🟢 -
Llm_calls 3 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 27.32s (+26.95s) - 11 🔴

Social Scraping Evaluation (HEAD-1769034686)

Score Average Improvements Regressions
Tools_called 0% (+0pp) - -
Llm_calls 0 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 23.52s (+23.04s) - 6 🔴

Spotify Followers Evaluation (HEAD-1769034686)

Score Average Improvements Regressions
AnswerCorrectness 20.8% (+5pp) 5 🟢 -
Llm_calls 3 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 15.36s (+14.91s) - 5 🔴

Spotify Tools Evaluation (HEAD-1769034686)

Score Average Improvements Regressions
Tools_called 0% (+0pp) - -
Llm_calls 0 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 34.84s (+34.31s) - 2 🔴

TikTok Analytics Questions Evaluation (HEAD-1769034687)

Score Average Improvements Regressions
Question_answered 0% (+0pp) - -
Llm_calls 0 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 17.55s (+17.32s) - 2 🔴

- Copy evals/ directory with 10 evaluation scripts
- Copy lib/evals/ with helper functions and scorers
- Add braintrust and autoevals dependencies
- Add eval script to package.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add lib/consts.ts re-export file for Recoup-Chat compatibility
- Add lib/catalog/ files for catalog data fetching and formatting
- Add lib/spotify/getSpotifyFollowers.ts for Spotify follower evals
- Add EVAL_ACCOUNT_ID, EVAL_ACCESS_TOKEN, EVAL_ARTISTS to lib/const.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change accessToken to authToken (matching ChatRequestBody type)
- Add required orgId: null property

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
sweetmantech and others added 2 commits January 21, 2026 16:54
Required for lib/const.ts module loading during eval compilation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Match Recoup-Chat pattern for consistency.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add @composio/core and @composio/vercel to --external-packages
  (fixes createRequire(import.meta.url) bundler error)
- Add COMPOSIO_API_KEY, OPENAI_API_KEY, AI_GATEWAY_API_KEY env vars

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The braintrustdata/eval-action doesn't support --external-packages flag.
Running pnpm eval directly uses the package.json script with the flag.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use dynamic imports for @composio/core and @composio/vercel
- This avoids the createRequire(import.meta.url) error during bundling
- Update all callers to await getComposioClient()
- Revert to using braintrustdata/eval-action@v1

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Set paths: "evals/" to tell action where to find eval files
- Set package_manager: pnpm

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Handle cases where COMPOSIO_API_KEY is missing or @composio packages
fail to load (bundler incompatibility with createRequire). Returns
empty ToolSet instead of throwing, allowing evals to run without
Composio tools.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The @composio packages use createRequire(import.meta.url) which is
incompatible with Braintrust's bundler. By not setting COMPOSIO_API_KEY,
getComposioTools returns {} immediately without attempting to import
the incompatible packages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — ee8d4206 Deployed Jan 21, 2026 by vercel[bot]
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