conductor-oss/conductor · error · IllegalArgumentException

inspectPlan: agentConfig.strategy must be 'plan_execute', go

Error message

inspectPlan: agentConfig.strategy must be 'plan_execute', got '${strategy}'

What it means

Thrown by AgentService.inspectPlan when the AgentConfig.strategy is not PLAN_EXECUTE. The inspect path specifically exercises the PLAN_EXECUTE harness compile flow (it replicates what MultiAgentCompiler.compilePlanExecute does), so only plan_execute agents can be inspected. The message includes the actual strategy value (or 'null' if strategy was unset). IllegalArgumentException maps to HTTP 400.

Source

Thrown at agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/AgentService.java:141

     * inspect-only divergence.
     *
     * <p>Caller must supply both the agent config (so the compile knows about the tool list, model,
     * harness timeout) and the plan (typically what the planner LLM emitted, but can be a
     * hand-rolled static plan for offline validation).
     */
    public PlanAndCompileTask.InspectResult inspectPlan(InspectPlanRequest request) {
        if (request == null || request.getAgentConfig() == null) {
            throw new IllegalArgumentException("inspectPlan: agentConfig is required");
        }
        if (request.getPlan() == null) {
            throw new IllegalArgumentException("inspectPlan: plan is required");
        }
        AgentConfig config = request.getAgentConfig();
        if (config.getName() == null || config.getName().isEmpty()) {
            config.setName("agent_inspect");
        }
        if (config.getStrategy() != AgentConfig.Strategy.PLAN_EXECUTE) {
            throw new IllegalArgumentException(
                    "inspectPlan: agentConfig.strategy must be 'plan_execute', got '"
                            + (config.getStrategy() == null
                                    ? "null"
                                    : config.getStrategy().toValue())
                            + "'");
        }

        // Replicate what MultiAgentCompiler.compilePlanExecute computes
        // before calling PAC at runtime — so the inspect compile sees the
        // same inputs the real one would.
        String workflowName = MultiAgentCompiler.planWorkflowName(config.getName());
        String model = config.getModel() != null ? config.getModel() : "";
        int harnessTimeout = config.getTimeoutSeconds();
        List<ToolConfig> parentTools = config.getTools() != null ? config.getTools() : List.of();
        Set<String> knownToolNames = new HashSet<>();
        for (ToolConfig t : parentTools) {
            if (t.getName() != null && !t.getName().isEmpty()) {
                knownToolNames.add(t.getName());

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Set config.setStrategy(AgentConfig.Strategy.PLAN_EXECUTE) before calling inspectPlan.
  2. If you need to inspect a non-plan_execute agent, use the compile() method instead — inspectPlan only supports the plan_execute path.
  3. Verify the framework normalizer output has strategy=PLAN_EXECUTE when targeting the inspect endpoint.

Example fix

// before
AgentConfig config = new AgentConfig();
config.setStrategy(AgentConfig.Strategy.REACT);
req.setAgentConfig(config);
service.inspectPlan(req); // -> error

// after
AgentConfig config = new AgentConfig();
config.setStrategy(AgentConfig.Strategy.PLAN_EXECUTE);
req.setAgentConfig(config);
service.inspectPlan(req);
Defensive patterns

Strategy: validation

Validate before calling

AgentConfig config = request.getAgentConfig();
if (config.getStrategy() != AgentConfig.Strategy.PLAN_EXECUTE) {
    // Use compile() for non-plan_execute strategies
    throw new UnsupportedOperationException(
        "inspectPlan only supports plan_execute; use compile() for "
            + config.getStrategy());
}
service.inspectPlan(request);

Prevention

When it happens

Trigger: Passing an AgentConfig with strategy=REACT or strategy=ROUTER to inspectPlan; the strategy enum was not set at all (null); a framework normalizer produced a config with a non-PLAN_EXECUTE strategy.

Common situations: Developer tries to inspect-plan a react-mode agent not realizing inspect only supports plan_execute; SDK defaults the strategy to something other than PLAN_EXECUTE; a normalizer for a non-conductor SDK emits a config whose strategy doesn't map to PLAN_EXECUTE.

Related errors


AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14). Data as JSON: /api/errors/1a2541b97aa4dc22. Report an issue: GitHub.