Skip to content

feat(mcp): add compact monitoring relay views#483

Open
Q00 wants to merge 2 commits intomainfrom
feat/compact-monitoring-relay
Open

feat(mcp): add compact monitoring relay views#483
Q00 wants to merge 2 commits intomainfrom
feat/compact-monitoring-relay

Conversation

@Q00
Copy link
Copy Markdown
Owner

@Q00 Q00 commented Apr 22, 2026

Summary

  • Add compact and summary monitoring views for AC HUD and job status/wait tools to reduce token usage during long executions.
  • Surface Sub-AC progress separately from top-level AC roll-up so users can see useful progress even when AC completion is still 0/N.
  • Update the run skill to use low-token relay monitoring based on structured response.meta instead of repeated full-tree polling.

Changes

  • Added view modes for ouroboros_ac_tree_hud: compact, summary, and tree.
  • Added view modes for ouroboros_job_status and ouroboros_job_wait: compact, summary, and full.
  • Added Sub-AC event summarization and compact relay formatting helpers.
  • Updated session status progress metadata with Sub-AC summary counts.
  • Reworked skills/run/SKILL.md to define a harness-friendly relay loop using ouroboros_job_wait(view="summary").
  • Added regression coverage for compact rendering, Sub-AC progress summaries, cursor behavior, and tool definitions.

Verification

  • uv run ruff check src/ouroboros/mcp/tools/ac_tree_hud_handler.py src/ouroboros/mcp/tools/job_handlers.py src/ouroboros/mcp/tools/query_handlers.py tests/unit/mcp/tools/test_ac_tree_hud_handler.py tests/unit/mcp/tools/test_ac_tree_hud_handler_cursor_changed.py tests/unit/mcp/tools/test_ac_tree_hud_handler_completed.py tests/unit/mcp/tools/test_ac_tree_hud_max_nodes.py tests/unit/mcp/tools/test_definitions.py tests/unit/mcp/test_job_manager.py
  • uv run pytest tests/unit/mcp/tools/test_ac_tree_hud_handler.py tests/unit/mcp/tools/test_ac_tree_hud_handler_cursor_changed.py tests/unit/mcp/tools/test_ac_tree_hud_handler_completed.py tests/unit/mcp/tools/test_ac_tree_hud_max_nodes.py tests/unit/mcp/tools/test_definitions.py tests/unit/mcp/test_job_manager.py

Copy link
Copy Markdown
Contributor

@ouroboros-agent ouroboros-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — ouroboros-agent[bot]

Verdict: REQUEST_CHANGES

Reviewing commit c9f5cc9 for PR #483

Review record: c1d27dc3-de6a-4e7f-a001-f7c7d5c0653c

Blocking Findings

| # | File:Line | Severity | Finding |
|### Recovery Notes
First recoverable review artifact generated from codex analysis log.

---|-----------|----------|---------|
| 1 | src/ouroboros/mcp/tools/ac_tree_hud_handler.py:1281 | BLOCKING | This changes ouroboros_ac_tree_hud's default response from the full tree to the new summary view whenever callers omit view. Existing call sites are already documented to use ouroboros_ac_tree_hud(session_id, cursor) without a view argument, so those clients will silently stop receiving the tree output they were built around. That is a public MCP contract break and should stay opt-in unless you version the tool behavior. |
| 2 | src/ouroboros/mcp/tools/job_handlers.py:474 | BLOCKING | ouroboros_job_status and ouroboros_job_wait now default to the compact summary format instead of the previous full markdown snapshot. Callers that omitted view and consumed the existing detailed body (## Job, ### Execution, recent subtasks, etc.) will now get a different unstructured payload, which is another silent API break. The new views are useful, but they need to be opt-in rather than replacing the default response shape. |

Non-blocking Suggestions

None.

Design Notes

The new compact/summary renderers are a sensible addition for low-token monitoring, and the Sub-AC aggregation looks directionally solid. The problem is rollout strategy: the PR introduces those modes by changing default tool behavior instead of adding them as explicit opt-ins, which makes the MCP surface less stable for existing clients.


Reviewed by ouroboros-agent[bot] via Codex deep analysis

@Q00 Q00 force-pushed the feat/compact-monitoring-relay branch from c9f5cc9 to 146ec0a Compare April 22, 2026 12:43
Copy link
Copy Markdown
Contributor

@ouroboros-agent ouroboros-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — ouroboros-agent[bot]

Verdict: REQUEST_CHANGES

Reviewing commit 146ec0a for PR #483

Review record: 980b5a7d-91ab-4f28-91f7-4ec6c98329ec

Blocking Findings

| # | File:Line | Severity | Finding |
|### Recovery Notes
First recoverable review artifact generated from codex analysis log.

---|-----------|----------|---------|
| 1 | src/ouroboros/mcp/tools/ac_tree_hud_handler.py:66 | BLOCKING | ouroboros_ac_tree_hud now defaults to summary output instead of the full tree (_DEFAULT_HUD_VIEW = "summary" and the tool definition advertises that default). That is a backward-incompatible MCP contract change: any existing caller that omits view and parses the rendered AC tree will silently stop receiving tree rows and max-node behavior, even though the tool name and required arguments are unchanged. |
| 2 | src/ouroboros/mcp/tools/job_handlers.py:36 | BLOCKING | ouroboros_job_status and ouroboros_job_wait now default to compact/summary rendering rather than the previous full job snapshot, and job_wait also swaps its unchanged response to unchanged cursor=.... Existing callers that invoke these tools without a new view argument will no longer get the prior ## Job / ### Execution sections or the old unchanged text, which is another silent API contract break for already-deployed clients. |

Non-blocking Suggestions

| 1 | src/ouroboros/mcp/tools/job_handlers.py:325 | Refactoring | _render_job_snapshot_inner() now replays the full execution event history on every status/wait render. That may be acceptable, but it is a meaningful performance regression risk for long-running jobs with large event streams; bounding or caching the subtask-summary source data would make the new polling path safer. |

Design Notes

The sub-AC progress model is directionally good: it exposes useful structured progress without mutating top-level AC semantics. The main issue is that the PR ships it by changing default text contracts on existing MCP tools instead of adding opt-in views while preserving the old default behavior.


Reviewed by ouroboros-agent[bot] via Codex deep analysis

Restore omitted view arguments on ac_tree_hud to render the full AC tree and on job_status/job_wait to render the detailed job snapshot. Keep compact and summary renderers opt-in so existing MCP callers do not silently receive a different text contract.

Preserve legacy unchanged text for tree/full defaults while still allowing compact unchanged cursor lines for explicit low-token views. Limit job execution monitor reads to recent events instead of replaying full execution history on each status render.

Services: shared

Affected files:

- skills/run/SKILL.md

- src/ouroboros/mcp/tools/ac_tree_hud_handler.py

- src/ouroboros/mcp/tools/job_handlers.py

- tests/unit/mcp/test_job_manager.py

- tests/unit/mcp/tools/test_ac_tree_hud_handler.py

- tests/unit/mcp/tools/test_definitions.py
Copy link
Copy Markdown
Contributor

@ouroboros-agent ouroboros-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — ouroboros-agent[bot]

Verdict: REQUEST_CHANGES

Reviewing commit 3de0eb2 for PR #483

Review record: cb49d17e-75ce-45e2-bf02-89f9c33118f0

Blocking Findings

| # | File:Line | Severity | Finding |
|### Recovery Notes
First recoverable review artifact generated from codex analysis log.

---|-----------|----------|---------|
| 1 | src/ouroboros/mcp/tools/job_handlers.py:328 | BLOCKING | ouroboros_job_status / ouroboros_job_wait now compute Sub-AC progress from only the latest 250 execution events (query_events(..., limit=250) at lines 328-338). Once a long-running execution emits more than 250 execution.subtask.updated events, older subtasks fall out of the window and summarize_subtask_events() undercounts sub_ac_total/sub_ac_completed, so the new low-token monitor can report regressing or flatly wrong progress for exactly the large jobs this PR is targeting. |

Non-blocking Suggestions

None.

Design Notes

The new split between full/tree, summary, and compact monitor views is directionally good, and reusing the Sub-AC summarization logic across HUD, job status, and session status keeps the surface area coherent. The main issue is that the job-monitor path derives progress from a truncated execution history, which breaks the correctness of the new recommended polling flow under realistic long-running workloads.


Reviewed by ouroboros-agent[bot] via Codex deep analysis

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