{"record":{"id":"0dac7a814dc69cd7","repo":"can1357/oh-my-pi","slug":"async-bash-execution-is-disabled-enable-async-ena","errorCode":null,"errorMessage":"Async bash execution is disabled. Enable async.enabled to use async mode.","messagePattern":"Async bash execution is disabled\\. Enable async\\.enabled to use async mode\\.","errorType":"exception","errorClass":"ToolError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/tools/bash.ts","lineNumber":929,"sourceCode":"\t\tctx?: AgentToolContext,\n\t): Promise<AgentToolResult<BashToolDetails>> {\n\t\tlet command = rawCommand;\n\t\tconst env = normalizeBashEnv(rawEnv);\n\n\t\t// Extract a leading `cd <path> && ...` into cwd when the model ignores the\n\t\t// cwd parameter. The scanner captures only a single path token and defers\n\t\t// to the shell for anything else (redirects, extra args, shell expansion),\n\t\t// so it never absorbs shell syntax like `cd /tmp 2>/dev/null && ...` into\n\t\t// the structured cwd. Constrained to a top-level `&&` on the first line.\n\t\tif (!cwd) {\n\t\t\tconst cd = extractLeadingCdTarget(command);\n\t\t\tif (cd) {\n\t\t\t\tcwd = cd.path;\n\t\t\t\tcommand = cd.rest;\n\t\t\t}\n\t\t}\n\t\tif (asyncRequested && !this.#asyncEnabled) {\n\t\t\tthrow new ToolError(\"Async bash execution is disabled. Enable async.enabled to use async mode.\");\n\t\t}\n\n\t\t// Check both the original command and the cwd-normalized command so\n\t\t// leading `cd ... &&` wrappers do not hide either shell-navigation rules\n\t\t// or the dedicated-tool command that follows the directory change.\n\t\tif (this.session.settings.get(\"bashInterceptor.enabled\")) {\n\t\t\tconst rules = this.session.settings.getBashInterceptorRules();\n\t\t\tconst commandsToCheck = rawCommand === command ? [command] : [rawCommand, command];\n\t\t\tfor (const commandToCheck of commandsToCheck) {\n\t\t\t\tconst interception = checkBashInterception(commandToCheck, ctx?.toolNames ?? [], rules, rawCommand);\n\t\t\t\tif (interception.block) {\n\t\t\t\t\tthrow new ToolError(interception.message ?? \"Command blocked\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst internalUrlOptions: InternalUrlExpansionOptions = {\n\t\t\tskills: this.session.skills ?? [],","sourceCodeStart":911,"sourceCodeEnd":947,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/tools/bash.ts#L911-L947","documentation":"The bash tool only permits async execution when the session setting async.enabled is true. If the caller passes async=true while the setting is off, the tool rejects the call before doing any work. This keeps opt-in background execution from running in configurations that haven't enabled it.","triggerScenarios":"Calling bash with async=true (or relying on auto-backgrounding, which requests async internally) while the `async.enabled` setting is false/unset in omp.json or the session's settings.","commonSituations":"Users upgrading from versions where async defaulted differently; prompts that instruct the agent to 'run this in the background' on installs where the feature was never enabled; shared config files that omit the setting.","solutions":["Enable the setting: set \"async\": { \"enabled\": true } in the omp settings file.","Or remove async=true from the tool call and run the command in the foreground.","Check which settings file applies (project vs user) with `omp settings` / the config docs if you believe it is already enabled."],"exampleFix":"// before: omp.json\n{ \"tools\": { \"maxTimeout\": 600 } }\n\n// after: opt into async bash\n{ \"async\": { \"enabled\": true }, \"tools\": { \"maxTimeout\": 600 } }","handlingStrategy":"validation","validationCode":"if (wantAsync && !session.settings.get(\"async.enabled\")) {\n  // run foreground instead or tell the user to enable async.enabled\n}\nawait bash.execute(id, { command, async: session.settings.get(\"async.enabled\") });","typeGuard":null,"tryCatchPattern":"try {\n  await bash.execute(id, { command, async: true });\n} catch (e) {\n  if (e instanceof ToolError && e.message.includes(\"async.enabled\")) {\n    return bash.execute(id, { command }); // foreground fallback\n  }\n  throw e;\n}","preventionTips":["Enable async.enabled in your omp settings before using background features.","Check the setting programmatically before prompting the agent to background commands.","Keep project and user settings consistent to avoid surprises across machines."],"tags":["configuration","async","feature-flag"],"backgroundTag":"feature-disabled-config","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}