mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-06 23:12:22 +02:00
Snapshot current maintainer-preview application changes and regression fixtures for integration into lab. Excludes local runtime data, evaluation outputs and source backups. Focused Python regression selection: 140 passed; full suite not certified.
25 lines
993 B
Python
25 lines
993 B
Python
import json
|
|
|
|
from src.clean_agent_preview import preview_tool_result_text
|
|
|
|
|
|
def test_successful_edit_exposes_saved_source_not_old_find():
|
|
observation = json.loads(preview_tool_result_text(
|
|
{'doc_id': 'fixture', 'applied': 1, 'version': 2, 'content': 'new wording'},
|
|
'edit_document', {'edits': [{'find': 'old wording', 'replace': 'new wording'}]},
|
|
))
|
|
assert observation['current_content'] == 'new wording'
|
|
assert observation['version'] == 2
|
|
assert 'Saved source' in observation['content_state']
|
|
|
|
|
|
def test_large_edit_observation_keeps_partial_failure_details():
|
|
observation = json.loads(preview_tool_result_text(
|
|
{'doc_id': 'fixture', 'applied': 1, 'content': 'a' * 10000,
|
|
'partial': True, 'rejected': 1, 'invalid_edits': [{'number': 2}]},
|
|
'edit_document', {},
|
|
))
|
|
assert 'current_content' not in observation
|
|
assert observation['invalid_edits'] == [{'number': 2}]
|
|
assert 'Retry only' in observation['instruction']
|