Remove unconditional stateful-turn truncation
This commit is contained in:
+28
-3
@@ -140,7 +140,7 @@ def test_unrecovered_major_issue_is_locally_invalid() -> None:
|
||||
|
||||
|
||||
@pytest.mark.parametrize("resolved", [0, -1])
|
||||
def test_non_success_outcome_is_capped_before_first_stateful_turn(resolved: int) -> None:
|
||||
def test_non_success_outcome_is_not_capped_at_first_stateful_turn(resolved: int) -> None:
|
||||
record = _record()
|
||||
record["resolved"] = resolved
|
||||
record["tools"] = [
|
||||
@@ -159,9 +159,34 @@ def test_non_success_outcome_is_capped_before_first_stateful_turn(resolved: int)
|
||||
result = _boundary()
|
||||
result.update(decision="KEEP_FULL", truncate_before_turn=None)
|
||||
policy = effective_boundary_policy(record, result)
|
||||
assert policy["decision"] == "KEEP_FULL"
|
||||
assert policy["truncate_before_turn"] is None
|
||||
assert policy["source"] == "MODEL_DECISION"
|
||||
assert policy["first_stateful_turn"] == 3
|
||||
|
||||
|
||||
def test_semantic_boundary_is_not_replaced_by_earlier_stateful_turn() -> None:
|
||||
record = _record()
|
||||
record["resolved"] = 0
|
||||
record["tools"] = [
|
||||
{"type": "function", "function": {"name": "str_replace_editor"}}
|
||||
]
|
||||
record["trajectory"][2]["tool_calls"] = [
|
||||
{
|
||||
"id": "call-1",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "str_replace_editor",
|
||||
"arguments": '{"command":"str_replace","path":"src/a.py"}',
|
||||
},
|
||||
}
|
||||
]
|
||||
result = _boundary()
|
||||
policy = effective_boundary_policy(record, result)
|
||||
assert policy["decision"] == "TRUNCATE"
|
||||
assert policy["truncate_before_turn"] == 3
|
||||
assert policy["source"] == "NON_SUCCESS_FIRST_STATEFUL_CAP"
|
||||
assert policy["truncate_before_turn"] == 5
|
||||
assert policy["source"] == "MODEL_BOUNDARY"
|
||||
assert policy["first_stateful_turn"] == 3
|
||||
|
||||
|
||||
def test_boundary_payload_hides_outcome_and_patch_metadata() -> None:
|
||||
|
||||
Reference in New Issue
Block a user