Skip to content

feat(prompts): pick predefined system prompts in experiments + agents, freeze version - #44

Merged
SushantGautam merged 3 commits into
mainfrom
agents/in-experiments-new-also-shodul-show-iption-to
Oct 13, 2026
Merged

SushantGautam merged 3 commits into
mainfrom
agents/in-experiments-new-also-shodul-show-iption-to

Conversation

@SushantGautam

Copy link
Copy Markdown
Collaborator

What

Adds a predefined system prompt picker to New Experiment and the Agent editor, reusing the same searchable list UI as the Models / Scenario-set pickers, and freezes the chosen prompt version into each run's reproducibility manifest.

Changes

  • New Experiment — "Predefined prompt" is now a searchable list (search box + radio rows) matching Models / Scenario sets. Picking one fills the system-prompt box; typing your own clears the selection.
  • Agent editor — same list picker with click-to-fill (was a plain <select> with no sync).
  • Frozen manifest — runs pin the exact SystemPromptVersion used (new nullable FK + migration audits/0009). The version shows in generation_parameters_snapshot.system_prompt_source, on the run detail page, and in comparisons, so historical runs stay reproducible.
  • Deletion protection — a system prompt can't be deleted while an audit run pins it or an agent uses its text (mirrors the scenario-set "in use" guard). Also fixes delete_prompt, which previously never actually deleted.

Tests

  • New/updated tests in test_experiments.py, test_agent_domain.py, test_prompts.py (picker renders as list, content + source baked into snapshot, FK pinned, review round-trip, deletion blocked when in use / allowed when unused).
  • Affected suites green: 115 passed (experiments + agents + prompts), ruff clean.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

SushantGautam and others added 3 commits October 13, 2026 21:31
…, freeze version

- New Experiment: "Predefined prompt" is now the same searchable list as
  Models / Scenario sets (search box + radio rows); picking one fills the
  system-prompt box, typing your own clears the selection.
- Agent editor: same list picker with click-to-fill (previously a plain
  select with no sync).
- Frozen manifest: runs pin the exact SystemPromptVersion used; the version
  appears in generation_parameters_snapshot.system_prompt_source and on the
  run detail + comparison views for reproducibility.
- Deletion protection: a system prompt cannot be deleted while an audit run
  pins it or an agent uses its text (mirrors scenario-set in-use guard).
  Fixes delete_prompt which previously never deleted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… select

The predefined system prompt picker on New Experiment and the agent editor
now mirrors the Scenario sets block: each prompt is a row with a radio on its
name (= latest version) and a "Versions" expander on the right listing every
version as a radio (with a View link). Selection is single — all radios share
one name so exactly one prompt/version is chosen; picking any fills the box
below and typing your own clears it. The agent editor still auto-preselects
the version whose content matches the agent's current prompt.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@SushantGautam
SushantGautam merged commit 13ca7d2 into main Oct 13, 2026
2 checks passed
@SushantGautam
SushantGautam deleted the agents/in-experiments-new-also-shodul-show-iption-to branch October 13, 2026 23:54
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