{"record":{"id":"1a2541b97aa4dc22","repo":"conductor-oss/conductor","slug":"inspectplan-agentconfig-strategy-must-be-plan-ex","errorCode":null,"errorMessage":"inspectPlan: agentConfig.strategy must be 'plan_execute', got '${strategy}'","messagePattern":"inspectPlan: agentConfig\\.strategy must be 'plan_execute', got '(.+?)'","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/AgentService.java","lineNumber":141,"sourceCode":"     * inspect-only divergence.\n     *\n     * <p>Caller must supply both the agent config (so the compile knows about the tool list, model,\n     * harness timeout) and the plan (typically what the planner LLM emitted, but can be a\n     * hand-rolled static plan for offline validation).\n     */\n    public PlanAndCompileTask.InspectResult inspectPlan(InspectPlanRequest request) {\n        if (request == null || request.getAgentConfig() == null) {\n            throw new IllegalArgumentException(\"inspectPlan: agentConfig is required\");\n        }\n        if (request.getPlan() == null) {\n            throw new IllegalArgumentException(\"inspectPlan: plan is required\");\n        }\n        AgentConfig config = request.getAgentConfig();\n        if (config.getName() == null || config.getName().isEmpty()) {\n            config.setName(\"agent_inspect\");\n        }\n        if (config.getStrategy() != AgentConfig.Strategy.PLAN_EXECUTE) {\n            throw new IllegalArgumentException(\n                    \"inspectPlan: agentConfig.strategy must be 'plan_execute', got '\"\n                            + (config.getStrategy() == null\n                                    ? \"null\"\n                                    : config.getStrategy().toValue())\n                            + \"'\");\n        }\n\n        // Replicate what MultiAgentCompiler.compilePlanExecute computes\n        // before calling PAC at runtime — so the inspect compile sees the\n        // same inputs the real one would.\n        String workflowName = MultiAgentCompiler.planWorkflowName(config.getName());\n        String model = config.getModel() != null ? config.getModel() : \"\";\n        int harnessTimeout = config.getTimeoutSeconds();\n        List<ToolConfig> parentTools = config.getTools() != null ? config.getTools() : List.of();\n        Set<String> knownToolNames = new HashSet<>();\n        for (ToolConfig t : parentTools) {\n            if (t.getName() != null && !t.getName().isEmpty()) {\n                knownToolNames.add(t.getName());","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/AgentService.java#L123-L159","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set config.setStrategy(AgentConfig.Strategy.PLAN_EXECUTE) before calling inspectPlan.","If you need to inspect a non-plan_execute agent, use the compile() method instead — inspectPlan only supports the plan_execute path.","Verify the framework normalizer output has strategy=PLAN_EXECUTE when targeting the inspect endpoint."],"exampleFix":"// before\nAgentConfig config = new AgentConfig();\nconfig.setStrategy(AgentConfig.Strategy.REACT);\nreq.setAgentConfig(config);\nservice.inspectPlan(req); // -> error\n\n// after\nAgentConfig config = new AgentConfig();\nconfig.setStrategy(AgentConfig.Strategy.PLAN_EXECUTE);\nreq.setAgentConfig(config);\nservice.inspectPlan(req);","handlingStrategy":"validation","validationCode":"AgentConfig config = request.getAgentConfig();\nif (config.getStrategy() != AgentConfig.Strategy.PLAN_EXECUTE) {\n    // Use compile() for non-plan_execute strategies\n    throw new UnsupportedOperationException(\n        \"inspectPlan only supports plan_execute; use compile() for \"\n            + config.getStrategy());\n}\nservice.inspectPlan(request);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reserve inspectPlan for PLAN_EXECUTE agents only.","Use compile() for REACT/ROUTER strategies.","Default the strategy to PLAN_EXECUTE in the SDK builder if inspection is intended."],"tags":["validation","inspect-plan","strategy","bad-request"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}