AI-powered virtual executive team — a single coherent executive persona backed by 8 specialist agents (FastAPI + Next.js).
Stop forcing committee review on inbound email turns (#140)
Rufus8c0af2eebd9f
diff --git a/packages/core/openexecutive/architecture/architecture-facts.yaml b/packages/core/openexecutive/architecture/architecture-facts.yamlindex 32ee8ee7..c93a899b 100644--- a/packages/core/openexecutive/architecture/architecture-facts.yaml+++ b/packages/core/openexecutive/architecture/architecture-facts.yaml@@ -2714,6 +2714,13 @@ integrations:to-roster) instead of wasting a turn discovering the outboundblock. The outbound gate at ``mcp_gateway._check_gmail_recipients``is the actual security boundary against auto-replying to spam.+ Like every other channel adapter, the poller calls+ ``Executive.chat`` on the standard path — it does NOT force+ ``committee_review=True``. Committee review is a per-request+ opt-in on ``/chat`` only; it was previously forced on for every+ inbound email (at least 5 model calls per message, ``medium`` Honcho+ prefetch) and removed because the revision pass never reaches+ Gmail anyway (outbound mail is sent from the draft's tool loop).slack: |openexecutive.integrations.slack_bot — async Bolt socket-modeadapter (``AsyncApp`` + ``AsyncSocketModeHandler``) embedded in thediff --git a/packages/core/openexecutive/integrations/email_poller.py b/packages/core/openexecutive/integrations/email_poller.pyindex 99d38197..961f3991 100644--- a/packages/core/openexecutive/integrations/email_poller.py+++ b/packages/core/openexecutive/integrations/email_poller.py@@ -409,16 +409,16 @@ async def _run_executive()executive = Executive(mcp_gateway=gateway)- # Default committee review on for inbound email. Emails tend to be- # higher-stakes than ad-hoc chat (a recipient is going to read the- # reply with no chance to interactively refine it), and the +5–12s- # latency does not matter on a 60s poll cycle.+ # Standard (non-committee) path, same as the Slack and Discord+ # adapters. Committee review (draft + 3 critiques + revision, and a+ # deeper Honcho prefetch) is a per-request opt-in on /chat only; it+ # was previously forced on here for every inbound email, including+ # off-roster senders the gateway will not let us reply to anyway.await executive.chat(user_message=base_message,session=session,retrieved_context=retrieve(query=raw_email[:500]),episodic_context=format_for_prompt(),- committee_review=True,person_id=person_id,co_present_person_ids=co_present_person_ids or None,)diff --git a/packages/core/openexecutive/orchestrator/executive.py b/packages/core/openexecutive/orchestrator/executive.pyindex 67649757..015aaf07 100644--- a/packages/core/openexecutive/orchestrator/executive.py+++ b/packages/core/openexecutive/orchestrator/executive.py@@ -1479,9 +1479,9 @@ class Executive:When ``committee_review=True`` the call routes through``stream_chat_with_committee`` so the answer is the revised- response, not the raw draft. Used by non-HTTP callers (e.g.- the email poller) that want committee output without holding- an SSE stream open.+ response, not the raw draft. Lets non-HTTP callers get+ committee output without holding an SSE stream open; the+ channel adapters (Slack, Discord, email) all use the default.``attachment_blocks`` is a list of Anthropic content blocks (imagetype) assembled by the caller from inbound file attachments. Text@@ -1491,8 +1491,8 @@ class Executive:``person_id`` / ``co_present_person_ids`` / ``peer_memory_reasoning_level``thread through to the Honcho memory layer — see ``stream_chat``for details. ``peer_memory_reasoning_level=None`` (default)- keeps each underlying entry point's own default (``"low"`` for- the streaming path, ``"medium"`` for the committee path).+ keeps each underlying entry point's own default (``"minimal"``+ for the streaming path, ``"medium"`` for the committee path)."""# Build the kwargs dict so we can conditionally include the# reasoning_level only when caller specified one — otherwisediff --git a/packages/core/tests/unit/test_email_poller_committee_default.py b/packages/core/tests/unit/test_email_poller_no_committee.pysimilarity index 71%rename from packages/core/tests/unit/test_email_poller_committee_default.pyrename to packages/core/tests/unit/test_email_poller_no_committee.pyindex dcdc987e..2ccafac8 100644--- a/packages/core/tests/unit/test_email_poller_committee_default.py+++ b/packages/core/tests/unit/test_email_poller_no_committee.py@@ -1,6 +1,10 @@-"""The email poller must default ``committee_review=True`` when invoking-the Executive on an inbound email. Skipping this would silently route the-unrevised draft to a real recipient over Gmail.+"""The email poller must invoke the Executive on the standard path, like+the Slack and Discord adapters — it must not force ``committee_review=True``.++Committee review (draft + three critiques + revision, plus a deeper Honcho+prefetch) is a per-request opt-in on ``/chat``. Forcing it on every inbound+email multiplied model calls for every message, including ones from+off-roster senders the gateway will never let the Executive reply to."""from __future__ import annotations@@ -28,7 +32,7 @@ def _settings() -> Any:)-def test_run_executive_passes_committee_review_true() -> None:+def test_run_executive_does_not_force_committee_review() -> None:captured: list[_CapturingExecutive] = []def _factory(**kwargs: Any) -> _CapturingExecutive:@@ -66,7 +70,7 @@ def test_run_executive_passes_committee_review_true() -> None:assert len(captured) == 1kwargs = captured[0].chat_kwargsassert kwargs is not None- assert kwargs.get("committee_review") is True, (- "Email poller must default committee_review=True so the reply "- "Gmail sees is the reviewed revision, not the raw draft."+ assert kwargs.get("committee_review", False) is False, (+ "Email poller must use the standard chat path like the other "+ "channel adapters; committee review is a per-request /chat opt-in.")diff --git a/packages/core/tests/unit/test_executive_chat_committee_routing.py b/packages/core/tests/unit/test_executive_chat_committee_routing.pyindex 1d463ceb..f7e4848e 100644--- a/packages/core/tests/unit/test_executive_chat_committee_routing.py+++ b/packages/core/tests/unit/test_executive_chat_committee_routing.py@@ -1,8 +1,10 @@"""``Executive.chat(committee_review=...)`` must pick the right stream method.-Non-HTTP callers (the email poller, the eval harness) use ``chat()`` rather-than going through the SSE route. The committee flag has to be honored at-this level too — otherwise emails would silently bypass review.+Non-HTTP callers (the channel adapters, the eval harness) use ``chat()``+rather than going through the SSE route. The flag has to be honored at this+level so a caller that opts in gets the revised response; the default must+stay ``False`` because the channel adapters (Slack, Discord, email) rely on+it — committee review is a per-request opt-in on ``/chat``."""from __future__ import annotations