Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/fi/alk/harness/call_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def _read_scenario_document(bundle_dir: Path, scenario_key: str) -> dict[str, An


# Edits a call actually plays; everything else is as sealed.
_EDITABLE_FIELDS = ("background_noise",)
_EDITABLE_FIELDS = ("background_noise", "max_turns")
_EDITABLE_PERSONA_FIELDS = (
"personality",
"communication_style",
Expand Down
20 changes: 17 additions & 3 deletions tests/harness/test_scenario_edits.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@
"scenario_edits": {
"book-ride": {
"background_noise": "street",
"max_turns": 4,
"tests": "unused by a call",
"instruction": "ignored",
"persona": {"personality": "impatient", "name": "ignored"},
"persona": {
"personality": "impatient",
"languages": ["English", "Hindi"],
"name": "ignored",
},
}
}
}
Expand All @@ -30,7 +35,13 @@ def test_edits_replace_only_what_a_call_plays():
merged = _with_scenario_edits(SEALED, EDITS, "book-ride")

assert merged["background_noise"] == "street"
assert merged["persona"] == {"name": "Asha", "accent": "Indian", "personality": "impatient"}
assert merged["persona"] == {
"name": "Asha",
"accent": "Indian",
"personality": "impatient",
"languages": ["English", "Hindi"],
}
assert merged["max_turns"] == 4
assert merged["tests"] == "books the ride"
assert merged["instruction"] == "book a ride"
assert SEALED["background_noise"] == "office"
Expand All @@ -47,7 +58,10 @@ def test_a_voice_call_plays_the_edited_place():
def test_a_chat_caller_is_the_edited_persona():
merged = _with_scenario_edits(SEALED, EDITS, "book-ride")

assert _conversation_scenario(merged).persona.personality == "impatient"
scenario = _conversation_scenario(merged)

assert scenario.persona.personality == "impatient"
assert scenario.max_turns == 4


def test_no_edits_leave_the_sealed_document():
Expand Down
Loading