Skip to content

Commit fc4df26

Browse files
authored
Merge pull request #7734 from loopx-project/codex/release220-heartbeat-regressions-20261030
test: reconcile release regressions with shipped contracts
2 parents 428f711 + 3acecea commit fc4df26

6 files changed

Lines changed: 23 additions & 11 deletions

‎tests/control_plane/test_heartbeat_agent_input.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test_thin_cli_preserves_readable_admission_and_authority_with_host_scope(tmp
6565
packet = json.loads(subprocess.check_output(command, text=True))
6666
assert packet["ok"] is True
6767
budget = packet["interface_budget"]
68-
assert budget["max_chars"] == 4500
68+
assert budget["max_chars"] == 4900
6969
assert budget["budget_char_count"] <= budget["max_chars"]
7070
assert budget["within_budget"] is True
7171
body = packet["task_body"]

‎tests/control_plane/test_heartbeat_envelope_transport.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ def test_capture_preserves_full_dispatcher_and_envelope_needs_explicit_opt_in(tm
8282
no_memory = dict(args, reward_memory_enabled=False)
8383
ordinary = build_heartbeat_prompt(**no_memory)
8484
captured_only = build_heartbeat_prompt(**no_memory, decision_output_root=tmp_path)
85-
assert ordinary['interface_budget']['max_chars'] == 4_500
86-
assert captured_only['interface_budget']['max_chars'] == 4_500
85+
assert ordinary['interface_budget']['max_chars'] == 4_900
86+
assert captured_only['interface_budget']['max_chars'] == 4_900
8787
oversized = build_heartbeat_prompt(
8888
**no_memory, decision_output_root=tmp_path, turn_envelope=True,
89-
agent_scopes=[letter * 320 for letter in 'stu'],
89+
agent_scopes=[letter * 320 for letter in 'stuv'],
9090
)
91-
assert oversized['interface_budget']['max_chars'] == 4_900
91+
assert oversized['interface_budget']['max_chars'] == 5_300
9292
assert oversized['interface_budget']['within_budget'] is False
9393
for overrides in (dict(turn_instance_id=None), dict(thin=False, full=True),
9494
dict(runtime_profile='codex_app_ssh_goal')):
@@ -163,7 +163,7 @@ def test_bound_captured_prompt_fits_budget_without_reward_memory(
163163
assert '--reward-memory-reflection-json' not in body
164164
assert str(runtime) in body and str(capture) in body
165165
assert payload['turn_instance_id'] == TURN_ID
166-
assert payload['interface_budget']['max_chars'] == 4_900
166+
assert payload['interface_budget']['max_chars'] == 5_300
167167
assert payload['interface_budget']['within_budget'], payload['interface_budget']
168168
assert len(result.stdout) <= 5_400 # Shipped Agent JSON, not generator metadata.
169169
assert 'using inline ACK argv' in body

‎tests/control_plane/test_heartbeat_registry_route.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def _route(command: str, registry: Path, runtime: Path) -> None:
2626

2727

2828
def test_budget_normalizes_shell_quoted_registry_before_goal_substrings():
29-
registry = "/fixture/route-fixture's authority/" + "long-directory/" * 300 + "registry.json"
29+
# The raw route must still exceed thin's current allowance before normalization.
30+
registry = "/fixture/route-fixture's authority/" + "long-directory/" * 400 + "registry.json"
3031
body = "loopx --registry " + shlex.quote(registry) + " quota should-run --goal-id route-fixture"
3132
budget = build_interface_budget(
3233
task_body=body, goal_id="route-fixture", active_state="/fixture/state.md",

‎tests/control_plane/test_quota_settlement_cli.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2057,7 +2057,7 @@ def test_receipt_retry_keeps_open_vision_quiet_through_real_cli(
20572057
if human_item == "user_action":
20582058
assert waiting["interaction_contract"]["user_channel"]["non_gating_notice"] is True
20592059
assert "response_plan" not in waiting["interaction_contract"]
2060-
assert waiting["scheduler_hint"]["reason_code"] == "blocked_wait"
2060+
assert waiting["scheduler_hint"]["reason_code"] == "interaction_agent_scope_wait"
20612061
assert waiting["scheduler_hint"]["action"] != "backoff_waiting_for_user"
20622062
assert waiting["scheduler_hint"]["pending_retry"]["due_at"] == closed["blocked_retry"]["due_at"]
20632063
envelope = build_turn_envelope(waiting)

‎tests/control_plane/test_replan_successor_durable_ack.py‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import pytest
1010

1111
from loopx.cli import main as cli_main
12+
from loopx.control_plane.effect_runtime import EffectRuntimeRejected
1213
from loopx.control_plane.status.autonomous_replan_projection import (
1314
AUTONOMOUS_REPLAN_PERIODIC_RUN_THRESHOLD,
1415
autonomous_replan_obligation_from_runs,
@@ -107,10 +108,18 @@ def test_cli_completed_todo_successor_refresh_resets_periodic_window(tmp_path: P
107108
def test_transition_cannot_settle_a_different_turn_guard(guard) -> None:
108109
runs = history()
109110
obligation = autonomous_replan_obligation_from_runs(runs, agent_todos={}, agent_id=AGENT)
110-
assert enforce_open_replan_writeback(newest_first_runs=runs,
111+
kwargs = dict(newest_first_runs=runs,
111112
state_text=successor_state(obligation["obligation_id"]), agent_id=AGENT,
112113
goal_id=GOAL, guard_scoped=True,
113-
guard_semantic_replan_obligation_id=guard) is None
114+
guard_semantic_replan_obligation_id=guard)
115+
if guard is None:
116+
assert enforce_open_replan_writeback(**kwargs) is None
117+
else:
118+
# An explicitly selected identity must reconstruct its receipt-bound
119+
# source; it cannot silently fall through to an unselected obligation.
120+
with pytest.raises(EffectRuntimeRejected) as rejected:
121+
enforce_open_replan_writeback(**kwargs)
122+
assert rejected.value.diagnostic_code == "heartbeat_receipt_identity_conflict"
114123

115124

116125
def test_transition_settles_only_exact_guard_and_owner() -> None:

‎tests/control_plane/test_scheduler_arbitration_transport.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ def observe(method, params, **kwargs):
160160
assert error.value.diagnostic_code == "runtime_request_failed"
161161
assert isinstance(error.value.__cause__, RecursionError)
162162
assert modes == [True]
163-
assert snapshot_directories == []
163+
# The shared transport may allocate its response sink before encoding.
164+
# Rejected input must still remove every private directory and file.
165+
assert all(not directory.exists() for directory in snapshot_directories)
164166
assert_private_files_removed(Path(tempfile.gettempdir()))
165167
assert effect_runtime.effect_runtime_result("runtime.ping", {})["pid"] == pid
166168

0 commit comments

Comments
 (0)