{"record":{"id":"9d0f3d3ec3b35b0e","repo":"Hmbown/CodeWhale","slug":"workflow-dispatch-requires-sub-agents-for-provider","errorCode":null,"errorMessage":"Workflow dispatch requires sub-agents for provider {} ({})","messagePattern":"Workflow dispatch requires sub-agents for provider (.+?) \\((.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":12475,"sourceCode":"    plugin_registry: std::sync::Arc<crate::plugins::PluginRegistry>,\n) -> Result<(\n    crate::tools::workflow::WorkflowTool,\n    crate::tools::ToolContext,\n)> {\n    use std::sync::Arc;\n\n    use crate::client::CodewhaleClient;\n    use crate::core::authority::shell_policy_for_mode;\n    use crate::tools::AgentToolSurfaceOptions;\n    use crate::tools::goal::new_shared_goal_state;\n    use crate::tools::subagent::{SubAgentRuntime, new_shared_subagent_manager_with_timeout};\n    use crate::tools::todo::new_shared_todo_list;\n    use codewhale_config::AppMode;\n    use codewhale_execpolicy::ApprovalMode;\n\n    let provider = config.api_provider();\n    if !config.subagents_enabled_for_provider(provider) {\n        bail!(\n            \"Workflow dispatch requires sub-agents for provider {} ({})\",\n            provider.as_str(),\n            config\n                .subagents_disabled_reason()\n                .unwrap_or(\"provider-specific sub-agent configuration disabled it\")\n        );\n    }\n\n    let yolo = config.yolo.unwrap_or(false);\n    let mode = AppMode::Operate;\n    let allow_shell = yolo || config.allow_shell();\n    let shell_policy = shell_policy_for_mode(mode, allow_shell);\n    let trusted = crate::workspace_trust::WorkspaceTrust::load_for(workspace);\n    let mut context = crate::tools::ToolContext::with_auto_approve(\n        workspace.to_path_buf(),\n        yolo,\n        config.notes_path(),\n        config.mcp_config_path(),","sourceCodeStart":12457,"sourceCodeEnd":12493,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lib.rs#L12457-L12493","documentation":"Workflow dispatch spawns sub-agents, so the active provider must have sub-agents enabled. Before dispatching, the code checks config.subagents_enabled_for_provider(api_provider()) and bails with the provider name and its configured disable reason when sub-agents are turned off for that provider.","triggerScenarios":"Running a workflow (dispatch) while the resolved provider has sub-agents disabled in config — either globally via sub-agents settings or by a provider-specific override; the reason string comes from subagents_disabled_reason() or defaults to 'provider-specific sub-agent configuration disabled it'.","commonSituations":"User switched to a provider (e.g. one without sub-agent support configured) and tried to run a workflow; fresh config on a new machine missing the sub-agent enablement for the chosen provider; a provider-specific disable flag left over from earlier tuning.","solutions":["Enable sub-agents for the active provider in your Codewhale config","Switch to a provider whose sub-agent configuration is enabled (check config.api_provider())","Read the disable reason in the error message and remove the matching provider-specific override","Confirm the config file the CLI loads is the one you edited (workspace vs user config merge)"],"exampleFix":"// before (config)\nsubagents = \"disabled\"\n// after (config)\nsubagents = \"enabled\"  # for the provider you dispatch workflows on","handlingStrategy":"validation","validationCode":"if (!config.subagents_enabled_for_provider(config.api_provider())) {\n  throw new Error(`enable sub-agents for provider ${config.api_provider().as_str()} before dispatching workflows`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  dispatchWorkflow(cfg);\n} catch (e) {\n  if (String(e).includes(\"requires sub-agents\")) {\n    // surface subagents_disabled_reason() to the user, do not retry\n  }\n  throw e;\n}","preventionTips":["Check subagents_enabled_for_provider() in preflight before any workflow run","Keep provider-specific sub-agent flags consistent when switching providers","Log subagents_disabled_reason() alongside provider at session start"],"tags":["config","subagents","provider"],"backgroundTag":"feature-not-enabled","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}