Skip to content

fix: normalize subagent current-state visibility#472

Merged
ozand merged 1 commit into
mainfrom
fix/issue-471-subagents-current-state
May 2, 2026
Merged

fix: normalize subagent current-state visibility#472
ozand merged 1 commit into
mainfrom
fix/issue-471-subagents-current-state

Conversation

@ozand
Copy link
Copy Markdown
Owner

@ozand ozand commented May 2, 2026

Closes #471

Summary

Normalizes /api/subagents so the current/canonical eeepc state is readable without inferring it from nested fields.

Changes

  • Adds top-level /api/subagents aliases from summary:
    • state, status
    • total_requests, result_count
    • queued_request_count, stale_request_count
    • blocked_result_count, stale_result_count, fresh_result_count
  • Adds per-request current-state fields:
    • raw_request_status preserves the original request file state such as queued.
    • effective_status exposes the resolved current state after materialized result linking, e.g. completed or blocked.
    • status remains resolved/current for compatibility.
  • Refines source-skew classification:
    • if canonical eeepc is selected and local state also exists, report source_skew.state=dual_roots_available, severity=informational, authoritative_source=eeepc.
    • reserve skewed for non-authoritative dual-root/conflict situations.

TDD evidence

RED before fix:

FAILED test_app_api_subagents_prefers_materialized_blocked_result_over_stale_queued_request
KeyError: 'state'

FAILED test_subagent_visibility_prefers_canonical_eeepc_state_over_stale_local
assert 'skewed' == 'dual_roots_available'

FAILED test_subagent_visibility_uses_remote_canonical_state_when_not_local
assert 'skewed' == 'dual_roots_available'

Focused GREEN:

PYTHONPATH=ops/dashboard/src:ops/dashboard python3 -m pytest \
  ops/dashboard/tests/test_app.py::test_app_api_subagents_prefers_materialized_blocked_result_over_stale_queued_request \
  ops/dashboard/tests/test_dashboard_truth_audit_gaps.py::test_subagent_visibility_prefers_canonical_eeepc_state_over_stale_local \
  ops/dashboard/tests/test_dashboard_truth_audit_gaps.py::test_subagent_visibility_uses_remote_canonical_state_when_not_local -q
3 passed in 1.75s

PYTHONPATH=ops/dashboard/src:ops/dashboard python3 -m pytest \
  ops/dashboard/tests/test_app.py::test_app_subagents_summary_marks_blocked_dominant_results_as_degraded \
  ops/dashboard/tests/test_autonomy_stagnation_dashboard.py::test_api_subagents_returns_json_with_stale_queued_request \
  ops/dashboard/tests/test_autonomy_stagnation_dashboard.py::test_api_subagents_materializes_terminal_telemetry_for_queued_request -q
3 passed in 5.79s

Full local suites:

PYTHONPATH=ops/dashboard/src:ops/dashboard python3 -m pytest ops/dashboard/tests -q
169 passed in 194.51s

python3 -m pytest tests -q
699 passed, 5 skipped in 21.29s

@ozand ozand merged commit 882a8d6 into main May 2, 2026
3 checks passed
@ozand ozand deleted the fix/issue-471-subagents-current-state branch May 2, 2026 17:41
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.

Subagents API should expose coherent canonical current state and resolved statuses

1 participant