microsoft/semantic-kernel · error · RuntimeError

The Magentic manager is not started yet. Make sure to send a

Error message

The Magentic manager is not started yet. Make sure to send a start message first.

What it means

_handle_response_message is the actor callback for MagenticResponseMessage. It reads self._context and self._task_ledger, both of which are populated only by _handle_start_message. If a response message arrives before the start message was processed, the actor is in an uninitialized state and cannot proceed, so it raises.

Source

Thrown at python/semantic_kernel/agents/orchestration/magentic.py:554

        """Handle the start message for the Magentic One manager."""
        logger.debug(f"{self.id}: Received Magentic One start message.")

        self._context = MagenticContext(
            task=message.body,
            participant_descriptions=self._participant_descriptions,
        )

        # Initial planning
        self._task_ledger = await self._manager.plan(self._context.model_copy(deep=True))

        await self._run_outer_loop(ctx.cancellation_token)

    @message_handler
    @ActorBase.exception_handler
    async def _handle_response_message(self, message: MagenticResponseMessage, ctx: MessageContext) -> None:
        """Handle the response message for the Magentic One manager."""
        if self._context is None or self._task_ledger is None:
            raise RuntimeError("The Magentic manager is not started yet. Make sure to send a start message first.")

        if message.body.role != AuthorRole.USER:
            self._context.chat_history.add_message(
                ChatMessageContent(
                    role=AuthorRole.USER,
                    content=f"Transferred to {message.body.name}",
                )
            )
        self._context.chat_history.add_message(message.body)

        logger.debug(f"{self.id}: Running inner loop.")
        await self._run_inner_loop(ctx.cancellation_token)

    async def _run_outer_loop(self, cancellation_token: CancellationToken) -> None:
        if self._context is None or self._task_ledger is None:
            raise RuntimeError("The Magentic manager is not started yet. Make sure to send a start message first.")

        # 1. Publish the rendered task ledger to the group chat.

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Start the orchestration only via `await orchestration.invoke(task, runtime)` so the start message is always sent first.
  2. Do not publish MagenticResponseMessage/MagenticRequestMessage to the internal topic yourself.
  3. Ensure the start handler ran without exception; check the exception_callback registered with the manager actor.

Example fix

// before
# manually publishing to internal topic before start -> raises
await runtime.send_message(MagenticResponseMessage(body=msg), manager_id)

// after
result = await orchestration.invoke(task, runtime)
await result.get()
Defensive patterns

Strategy: validation

Validate before calling

# Don't publish MagenticResponseMessage yourself; start via invoke()
result = await orchestration.invoke(task_msg, runtime)
# The actor only receives response messages after the start handler initialized state.

Try / catch

try:
    result = await orchestration.invoke(task_msg, runtime)
    await result.get()
except RuntimeError as e:
    if "not started yet" in str(e):
        log.error("Start handshake failed; inspect exception_callback.")
    raise

Prevention

When it happens

Trigger: The Magentic manager actor receives a MagenticResponseMessage before _handle_start_message has run — i.e. self._context or self._task_ledger is None. Typically only happens if messages are published to the internal topic manually or start-message delivery/processing failed.

Common situations: Publishing MagenticResponseMessage directly to the orchestration's internal topic. A failed/canceled start handler that left state half-initialized. Custom actor wiring that bypasses the standard start handshake.

Related errors


AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13). Data as JSON: /api/errors/70523494e10c4361. Report an issue: GitHub.