Skip to content

🔨 chore: add agent eval experiment schema#14990

Closed
cy948 wants to merge 2 commits into
lobehub:canaryfrom
cy948:feat/bm29-eval-experiments
Closed

🔨 chore: add agent eval experiment schema#14990
cy948 wants to merge 2 commits into
lobehub:canaryfrom
cy948:feat/bm29-eval-experiments

Conversation

@cy948

@cy948 cy948 commented May 19, 2026

Copy link
Copy Markdown
Contributor

💻 Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • ✅ test
  • 📝 docs
  • 🔨 chore

🔗 Related Issue

🔀 Description of Change

外键 设置 原因
agent_eval_experiment_benchmarks.experiment_id -> agent_eval_experiments.id ON DELETE CASCADE experiment 删掉时关联关系应一起消失。
agent_eval_experiment_benchmarks.benchmark_id -> agent_eval_benchmarks.id ON DELETE CASCADE benchmark 删掉后关联行没有独立价值。
agent_eval_datasets.source_experiment_id -> agent_eval_experiments.id ON DELETE SET NULL 这是“来源”字段,不是所有权;experiment 没了,dataset 仍应保留。
agent_eval_runs.experiment_id -> agent_eval_experiments.id ON DELETE NO ACTION run 是历史快照,不应随experiment 被抹掉。
agent_eval_runs.parent_run_id -> agent_eval_runs.id ON DELETE NO ACTION 父子 run 是演进链,不能自动断链。

🧪 How to Test

  • Tested locally
  • Added/updated tests
  • No tests needed

📸 Screenshots / Videos

Before After
... ...

📝 Additional Information

@vercel

vercel Bot commented May 19, 2026

Copy link
Copy Markdown

@cy948 is attempting to deploy a commit to the LobeHub OSS Team on Vercel.

A member of the Team first needs to authorize it.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @cy948, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@lobehubbot

Copy link
Copy Markdown
Member

@nekomeowww @arvinxx - This PR adds the agent eval experiment schema with database migrations and schema changes under packages/database/. Please take a look.

@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.39%. Comparing base (f9b611b) to head (81f2833).
⚠️ Report is 2 commits behind head on canary.

Additional details and impacted files
@@           Coverage Diff            @@
##           canary   #14990    +/-   ##
========================================
  Coverage   66.39%   66.39%            
========================================
  Files        2995     2995            
  Lines      266178   266178            
  Branches    26337    27244   +907     
========================================
+ Hits       176737   176742     +5     
+ Misses      89278    89273     -5     
  Partials      163      163            
Flag Coverage Δ
app 61.06% <ø> (-0.01%) ⬇️
database 92.14% <ø> (ø)
packages/agent-runtime 80.48% <ø> (ø)
packages/builtin-tool-lobe-agent 18.33% <ø> (ø)
packages/context-engine 84.07% <ø> (+0.12%) ⬆️
packages/conversation-flow 91.28% <ø> (ø)
packages/file-loaders 87.83% <ø> (ø)
packages/memory-user-memory 75.01% <ø> (ø)
packages/model-bank 99.94% <ø> (ø)
packages/model-runtime 83.51% <ø> (ø)
packages/prompts 71.60% <ø> (ø)
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/types 35.10% <ø> (-0.04%) ⬇️
packages/utils 88.02% <ø> (ø)
packages/web-crawler 87.74% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 67.74% <ø> (ø)
Services 54.53% <ø> (ø)
Server 71.88% <ø> (-0.01%) ⬇️
Libs 56.16% <ø> (ø)
Utils 82.65% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cy948 cy948 marked this pull request as ready for review May 19, 2026 15:52
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 19, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @cy948, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 81f283318d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

ALTER TABLE "agent_eval_runs" DROP CONSTRAINT IF EXISTS "agent_eval_runs_experiment_id_agent_eval_experiments_id_fk";--> statement-breakpoint
ALTER TABLE "agent_eval_runs" ADD CONSTRAINT "agent_eval_runs_experiment_id_agent_eval_experiments_id_fk" FOREIGN KEY ("experiment_id") REFERENCES "public"."agent_eval_experiments"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "agent_eval_runs" DROP CONSTRAINT IF EXISTS "agent_eval_runs_parent_run_id_agent_eval_runs_id_fk";--> statement-breakpoint
ALTER TABLE "agent_eval_runs" ADD CONSTRAINT "agent_eval_runs_parent_run_id_agent_eval_runs_id_fk" FOREIGN KEY ("parent_run_id") REFERENCES "public"."agent_eval_runs"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Allow deleting parent eval runs

Defining agent_eval_runs.parent_run_id with ON DELETE no action makes deleteRun fail whenever the target run has child runs. The existing deletion flow (AgentEvalRunService.deleteRunrunModel.delete(id)) assumes a single run can always be removed, so once parent_run_id is populated this introduces runtime FK violations and prevents users from deleting parent runs (and from reaching the orphan-topic cleanup path). Use a non-blocking policy such as ON DELETE set null (or explicit child cleanup) for this self-reference.

Useful? React with 👍 / 👎.

arvinxx added a commit that referenced this pull request May 22, 2026
…tables (#15126)

🔨 chore(db): combine llm_generation_tracing and agent eval experiment tables into 0103

Merges the schema work from #14990 with the new llm_generation_tracing
table into a single idempotent 0103 migration so the two streams can
land together without a migration-number conflict.

Also adds user_id (FK + index) to agent_eval_experiment_benchmarks so
the junction table is scoped per user, matching agent_eval_run_topics.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
@arvinxx arvinxx closed this May 22, 2026
@cy948 cy948 deleted the feat/bm29-eval-experiments branch May 23, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants