Skip to content

Commit eed02b7

Browse files
committed
test(control-plane): cover scheduler ack and failure hints
1 parent 2a1617e commit eed02b7

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

tests/control_plane/test_effect_interpreter_packet.py

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,78 @@ def test_effect_turn_keeps_monitor_quiet_around_decision_data_visible() -> None:
142142
assert turn.next_effect.cadence_class == "monitor_wait"
143143
assert turn.next_effect.ack_cli_args == ()
144144
assert turn.next_effect.failure_cli_args == ()
145+
146+
147+
def test_effect_turn_carries_scheduler_ack_and_failure_hints() -> None:
148+
packet = {
149+
"decision": "run",
150+
"should_run": True,
151+
"effective_action": "normal_run",
152+
"recommended_action": "advance the bounded segment",
153+
"interaction_contract": {
154+
"mode": "bounded_delivery",
155+
"cli_channel": {
156+
"next_cli_actions": [
157+
"loopx refresh-state --goal-id effect-interpreter-fixture",
158+
"loopx quota spend-slot --goal-id effect-interpreter-fixture",
159+
]
160+
},
161+
},
162+
"work_lane_contract": {
163+
"lane": "advancement_task",
164+
"obligation": "advance_one_bounded_segment",
165+
"must_attempt_work": True,
166+
},
167+
"scheduler_hint": {
168+
"action": "apply_rrule",
169+
"cadence_class": "active_work",
170+
"codex_app": {
171+
"ack_hint": {
172+
"cli_args": [
173+
"quota",
174+
"scheduler-ack-current",
175+
"--goal-id",
176+
"effect-interpreter-fixture",
177+
"--execute",
178+
]
179+
},
180+
"failure_hint": {
181+
"cli_args": [
182+
"quota",
183+
"scheduler-ack-current",
184+
"--goal-id",
185+
"effect-interpreter-fixture",
186+
"--failure",
187+
"--execute",
188+
]
189+
},
190+
},
191+
},
192+
}
193+
turn = interpret_quota_should_run_packet(
194+
packet,
195+
goal_id=GOAL_ID,
196+
agent_id="codex-fixture",
197+
)
198+
199+
assert turn.next_effect.cli_actions == (
200+
"loopx refresh-state --goal-id effect-interpreter-fixture",
201+
"loopx quota spend-slot --goal-id effect-interpreter-fixture",
202+
)
203+
assert turn.next_effect.scheduler_action == "apply_rrule"
204+
assert turn.next_effect.cadence_class == "active_work"
205+
assert turn.next_effect.ack_cli_args == (
206+
"quota",
207+
"scheduler-ack-current",
208+
"--goal-id",
209+
"effect-interpreter-fixture",
210+
"--execute",
211+
)
212+
assert turn.next_effect.failure_cli_args == (
213+
"quota",
214+
"scheduler-ack-current",
215+
"--goal-id",
216+
"effect-interpreter-fixture",
217+
"--failure",
218+
"--execute",
219+
)

0 commit comments

Comments
 (0)