[PR #359] [MERGED] Add strategy architect agent to orchestration and today workflow polling #324

Closed
opened 2026-03-02 23:35:08 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AJaySi/ALwrity/pull/359
Author: @AJaySi
Created: 3/1/2026
Status: Merged
Merged: 3/1/2026
Merged by: @AJaySi

Base: mainHead: codex/add-strategyarchitectagent-support


📝 Commits (1)

  • 036bbb4 Add strategy agent to daily planning committee

📊 Changes

3 files changed (+190 additions, -3 deletions)

View changed files

📝 backend/services/intelligence/agents/agent_orchestrator.py (+12 -1)
📝 backend/services/today_workflow_service.py (+26 -2)
backend/test/test_today_workflow_service.py (+152 -0)

📄 Description

Motivation

  • Ensure the StrategyArchitectAgent participates in daily planning so PLAN pillar proposals can originate from strategy analysis.
  • Keep deduplication deterministic and predictable when multiple agents propose the same PLAN task while preserving high-priority overwrites.
  • Make sure PLAN proposals from the strategy agent survive committee aggregation and are covered by unit tests.

Description

  • Register StrategyArchitectAgent in ALwrityAgentOrchestrator._create_specialized_agents() with feature-flag parity (enabled_by_key.get("strategy_architect", True)) and add it to self.agents['strategy'] so it is available to the orchestrator.
  • Add orchestrator.agents.get('strategy') to the agents_to_poll list in generate_agent_enhanced_plan so the strategy agent is polled alongside content/seo/social/competitor agents.
  • Introduce _proposal_priority_rank and _proposal_order_key helpers and replace the simple overwrite rule with deterministic dedupe logic that prefers higher-priority proposals and uses a stable tie-breaker (source/title/description/action_url) for equal-priority collisions.
  • Add async unit tests (backend/test/test_today_workflow_service.py) that stub deep onboarding imports and the orchestration service to verify (1) strategy-originated PLAN proposals are included and (2) dedupe behavior keeps high-priority proposals and deterministically resolves same-priority ties.

Testing

  • Running pytest without adjusting PYTHONPATH initially surfaced an import-time error due to a missing spaCy model during unrelated module import, which blocked collection.
  • Executing the targeted test command PYTHONPATH=backend pytest -q backend/test/test_today_workflow_service.py ran the new tests and reported 2 passed (the two async tests added), with no failures.

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/359 **Author:** [@AJaySi](https://github.com/AJaySi) **Created:** 3/1/2026 **Status:** ✅ Merged **Merged:** 3/1/2026 **Merged by:** [@AJaySi](https://github.com/AJaySi) **Base:** `main` ← **Head:** `codex/add-strategyarchitectagent-support` --- ### 📝 Commits (1) - [`036bbb4`](https://github.com/AJaySi/ALwrity/commit/036bbb45e101d4765ae6b8b3ae78c92e6cca870f) Add strategy agent to daily planning committee ### 📊 Changes **3 files changed** (+190 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `backend/services/intelligence/agents/agent_orchestrator.py` (+12 -1) 📝 `backend/services/today_workflow_service.py` (+26 -2) ➕ `backend/test/test_today_workflow_service.py` (+152 -0) </details> ### 📄 Description ### Motivation - Ensure the StrategyArchitectAgent participates in daily planning so PLAN pillar proposals can originate from strategy analysis. - Keep deduplication deterministic and predictable when multiple agents propose the same PLAN task while preserving high-priority overwrites. - Make sure PLAN proposals from the strategy agent survive committee aggregation and are covered by unit tests. ### Description - Register `StrategyArchitectAgent` in `ALwrityAgentOrchestrator._create_specialized_agents()` with feature-flag parity (`enabled_by_key.get("strategy_architect", True)`) and add it to `self.agents['strategy']` so it is available to the orchestrator. - Add `orchestrator.agents.get('strategy')` to the `agents_to_poll` list in `generate_agent_enhanced_plan` so the strategy agent is polled alongside content/seo/social/competitor agents. - Introduce `_proposal_priority_rank` and `_proposal_order_key` helpers and replace the simple overwrite rule with deterministic dedupe logic that prefers higher-priority proposals and uses a stable tie-breaker (source/title/description/action_url) for equal-priority collisions. - Add async unit tests (`backend/test/test_today_workflow_service.py`) that stub deep onboarding imports and the orchestration service to verify (1) strategy-originated PLAN proposals are included and (2) dedupe behavior keeps high-priority proposals and deterministically resolves same-priority ties. ### Testing - Running `pytest` without adjusting `PYTHONPATH` initially surfaced an import-time error due to a missing spaCy model during unrelated module import, which blocked collection. - Executing the targeted test command `PYTHONPATH=backend pytest -q backend/test/test_today_workflow_service.py` ran the new tests and reported `2 passed` (the two async tests added), with no failures. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69a4616a1954832892456c44abd42ba8) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:35:08 +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#324
No description provided.