Skip to content

Fix monitor-poll next CLI action projection - #931

Merged
huangruiteng merged 2 commits into
mainfrom
codex/quota-monitor-poll-projection-20260630
Jul 3, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/quota-monitor-poll-projection-20260630

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

Summary

  • project monitor_quiet_skip next CLI actions as directly executable loopx quota monitor-poll --goal-id ... [--agent-id ...] --execute commands
  • preserve registered agent identity in the projected monitor-poll and follow-up should-run commands
  • extend heartbeat/quota smokes so one projected monitor-poll command is parsed and executed, and side-agent projection keeps --agent-id

Product / Architecture Judgment

  • Motivation: heartbeat/operator packets should emit copy-pasteable LoopX CLI actions that match the current quota parser and registered-agent routing.
  • User/operator impact: side-agent heartbeat guidance no longer drops the agent identity or emits a redundant source flag for monitor-poll.
  • Main risk: low but runtime-adjacent; changes interaction-contract command projection only, not quota eligibility or monitor accounting semantics.
  • Design: focused projection fix with executable smoke coverage instead of ad hoc docs-only guidance.

Validation

  • python3 examples/heartbeat-quota-flow-smoke.py
  • python3 examples/monitor-poll-writeback-smoke.py
  • python3 examples/work-lane-contract-smoke.py
  • python3 examples/quota-plan-smoke.py
  • python3 -m py_compile loopx/quota.py examples/heartbeat-quota-flow-smoke.py examples/quota-plan-smoke.py
  • git diff --check
  • loopx check --scan-path loopx/quota.py --scan-path examples/heartbeat-quota-flow-smoke.py --scan-path examples/quota-plan-smoke.py

Merge

  • Runtime/control-plane behavior change; not self-merging. Please review/merge via codex-main-control.

…oll-resolve-20260703

# Conflicts:
#	examples/heartbeat-quota-flow-smoke.py
#	examples/quota-plan-smoke.py
@huangruiteng

Copy link
Copy Markdown
Collaborator Author

Self-review after resolving conflicts against current main.

Decision: this PR still has value, but only as a narrow kernel projection fix. The durable behavior is that interaction_contract.cli_channel.next_cli_actions for monitor_quiet_skip must be directly executable and must preserve the registered --agent-id when present. Without that, a side-agent monitor lane can project a follow-up monitor-poll / should-run command that silently loses lane identity.

Implementation choice: kept the fix in loopx/quota.py::_interaction_next_cli_actions, which is the right projection seam. I did not move this into scheduler/replan/heartbeat prompt logic. The scheduler decides cadence; this projection formats the concrete CLI recovery/action command.

Conflict resolution: current main now correctly promotes an exhausted monitor-only lane to autonomous_replan_required before quiet polling. I kept that newer behavior and moved the direct projected-command execution coverage to the later post-ack state where monitor_quiet_skip is actually valid again. This avoids resurrecting the old “quiet poll several times before replan” flow.

Validation:

  • python3 -m py_compile loopx/quota.py examples/heartbeat-quota-flow-smoke.py examples/quota-plan-smoke.py
  • PYTHONPATH=. python3 examples/heartbeat-quota-flow-smoke.py
  • PYTHONPATH=. python3 examples/monitor-poll-writeback-smoke.py
  • direct assert_monitor_poll_next_cli_action_preserves_agent_id() smoke invocation
  • git diff --check
  • loopx check --scan-path loopx/quota.py --scan-path examples/heartbeat-quota-flow-smoke.py --scan-path examples/quota-plan-smoke.py

Note: full examples/quota-plan-smoke.py currently trips an unrelated pre-existing expectation around outcome-floor monitor lanes now being preempted by autonomous replan. The #931-specific projection assertion passes, and heartbeat e2e covers the executable projected monitor-poll command.

@huangruiteng
huangruiteng merged commit 02d1da6 into main Jul 3, 2026
@huangruiteng
huangruiteng deleted the codex/quota-monitor-poll-projection-20260630 branch July 3, 2026 03:26
liubf21 pushed a commit to liubf21/loopx that referenced this pull request Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant