[PR #389] [MERGED] Add committee health precheck and orchestrator init state metadata #694

Closed
opened 2026-03-13 21:04:16 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AJaySi/ALwrity/pull/389
Author: @AJaySi
Created: 3/6/2026
Status: Merged
Merged: 3/8/2026
Merged by: @AJaySi

Base: mainHead: codex/add-pre-check-for-committee-health-in-workflow


📝 Commits (1)

  • 15a9eaa Add committee health precheck and orchestrator init state metadata

📊 Changes

2 files changed (+204 additions, -71 deletions)

View changed files

📝 backend/services/intelligence/agents/agent_orchestrator.py (+20 -0)
📝 backend/services/today_workflow_service.py (+184 -71)

📄 Description

Motivation

  • Prevent silent failures and make downstream logic explicit by surfacing orchestrator initialization state and committee health before attempting committee-based task generation.
  • Ensure the system can choose a controlled fallback path when the agent committee is under-capacity instead of inferring behavior from empty proposals.

Description

  • Added onboarding_gated_initialization and initialization_state (including active_agent_count and sorted active_agent_keys) to ALwrityAgentOrchestrator instances in AgentOrchestrationService.get_or_create_orchestrator so callers can branch intentionally when initialization was gated by onboarding or similar system checks.
  • In generate_agent_enhanced_plan introduced a committee health pre-check that computes active_agent_names and active_agents_count, compares against a configurable minimum (min_active_agents = 2), and marks generation as degraded when below the threshold.
  • When degraded, the service emits a structured committee_health activity event via AgentActivityService with payload metadata including missing agents, onboarding-gated init flag, and orchestrator initialization state.
  • All plan return paths now include explicit metadata.generation_path values (committee, llm_fallback, or controlled_fallback) and a committee block with context and degraded metadata to clearly communicate how the plan was produced.

Testing

  • Ran python -m compileall backend/services/today_workflow_service.py backend/services/intelligence/agents/agent_orchestrator.py and the files compiled successfully.
  • No unit test failures were observed as only static compilation was executed.

Codex Task


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AJaySi/ALwrity/pull/389 **Author:** [@AJaySi](https://github.com/AJaySi) **Created:** 3/6/2026 **Status:** ✅ Merged **Merged:** 3/8/2026 **Merged by:** [@AJaySi](https://github.com/AJaySi) **Base:** `main` ← **Head:** `codex/add-pre-check-for-committee-health-in-workflow` --- ### 📝 Commits (1) - [`15a9eaa`](https://github.com/AJaySi/ALwrity/commit/15a9eaa9a0fcf56d4e6604b3b479766f320d01e2) Add committee health precheck and orchestrator init state metadata ### 📊 Changes **2 files changed** (+204 additions, -71 deletions) <details> <summary>View changed files</summary> 📝 `backend/services/intelligence/agents/agent_orchestrator.py` (+20 -0) 📝 `backend/services/today_workflow_service.py` (+184 -71) </details> ### 📄 Description ### Motivation - Prevent silent failures and make downstream logic explicit by surfacing orchestrator initialization state and committee health before attempting committee-based task generation. - Ensure the system can choose a controlled fallback path when the agent committee is under-capacity instead of inferring behavior from empty proposals. ### Description - Added `onboarding_gated_initialization` and `initialization_state` (including `active_agent_count` and sorted `active_agent_keys`) to `ALwrityAgentOrchestrator` instances in `AgentOrchestrationService.get_or_create_orchestrator` so callers can branch intentionally when initialization was gated by onboarding or similar system checks. - In `generate_agent_enhanced_plan` introduced a committee health pre-check that computes `active_agent_names` and `active_agents_count`, compares against a configurable minimum (`min_active_agents = 2`), and marks generation as degraded when below the threshold. - When degraded, the service emits a structured `committee_health` activity event via `AgentActivityService` with payload metadata including missing agents, onboarding-gated init flag, and orchestrator initialization state. - All plan return paths now include explicit `metadata.generation_path` values (`committee`, `llm_fallback`, or `controlled_fallback`) and a `committee` block with context and `degraded` metadata to clearly communicate how the plan was produced. ### Testing - Ran `python -m compileall backend/services/today_workflow_service.py backend/services/intelligence/agents/agent_orchestrator.py` and the files compiled successfully. - No unit test failures were observed as only static compilation was executed. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69aaf8cf9ec88328b449c0f995d54f6c) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-13 21:04:16 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ALwrity#694
No description provided.