Skip to content

fix(cleanup): preserve baseline seed experiments on standard cleanup#12

Merged
Robert Xu (xuro-langchain) merged 1 commit into
langchain-samples:mainfrom
stephen-chu:fix/cleanup-preserve-baseline-experiments
Jun 11, 2026
Merged

fix(cleanup): preserve baseline seed experiments on standard cleanup#12
Robert Xu (xuro-langchain) merged 1 commit into
langchain-samples:mainfrom
stephen-chu:fix/cleanup-preserve-baseline-experiments

Conversation

@stephen-chu

Copy link
Copy Markdown
Contributor

Problem

scripts/cleanup.pydelete_ci_experiments() deletes every experiment linked to the dataset:

experiments = list(ls_client.list_projects(reference_dataset_id=datasets[0].id))
for exp in experiments:
    ls_client.delete_project(project_name=exp.name)   # deletes ALL, incl. baselines

That includes the baseline-haiku-… / baseline-sonnet-… experiments setup.py seeds as the demo's Haiku-vs-Sonnet "before" reference. So a standard cleanup empties the dataset's experiment list — even though the README promises "After cleanup, the demo is ready to run again — no need to re-run setup.py." The presenter has to reseed baselines manually after every cleanup.

Fix

Skip experiments whose name starts with baseline- (the prefix setup.py uses). CI/Engine experiments (engine-…) are still swept as before. Docstring, the [2/3] step message, and the README Cleanup section updated to say baselines are preserved.

Testing

Verified against a live dataset with two baseline seeds present:

[2/3] Removing CI/Engine experiments (keeping baseline seeds)...
  Deleted 0 experiment(s), kept 2 baseline seed(s).

Both baseline-haiku-… and baseline-sonnet-… survived; a non-baseline- experiment would still be deleted (logic unchanged for those).

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

delete_ci_experiments() deleted every experiment linked to the dataset,
including the baseline-haiku / baseline-sonnet seeds that setup.py creates
as the demo's Haiku-vs-Sonnet "before" reference. So a standard cleanup
emptied the experiment list even though the README says setup does not need
to be re-run afterward.

Skip experiments whose name starts with "baseline-" so the seeds survive;
CI/Engine experiments are still swept. Updates the docstring, step message,
and README Cleanup section to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@xuro-langchain Robert Xu (xuro-langchain) merged commit bf14f0b into langchain-samples:main Jun 11, 2026
1 check 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.

2 participants