Troubleshooting
Start with the command that matches the failing surface, then inspect the effective settings and credentials.
Baseline Checks
Section titled “Baseline Checks”kosmo --versionkosmokrator smoke:startup --jsonkosmo config paths --jsonkosmo settings:doctor --jsonFor source checkouts:
composer installphp vendor/bin/phpunitphp vendor/bin/pint --testProvider Or Model Fails
Section titled “Provider Or Model Fails”kosmo providers:list --jsonkosmo providers:status --jsonkosmo providers:status openai --jsonkosmo settings:get agent.default_provider --jsonkosmo settings:get agent.default_model --jsonkosmo settings:options agent.default_model --provider openai --jsonCommon fixes:
| Symptom | Fix |
|---|---|
| Missing API key | `printf %s “$OPENAI_API_KEY” |
| Wrong default model | kosmo settings:set agent.default_model <model> --provider <provider> --json |
| OAuth provider not logged in | kosmo providers:configure codex --device --json |
| Custom provider unreachable | Verify providers:custom:list --json, URL, auth mode, and model ID. |
Headless Run Hangs Or Exits Early
Section titled “Headless Run Hangs Or Exits Early”Use explicit guards:
kosmo -p "Run tests" --max-turns 10 --timeout 600 --output-format stream-jsonChecks:
| Symptom | Fix |
|---|---|
| Needs an approval modal | Use a policy that fits automation, or configure permissions. |
| Writes are denied | Verify --mode edit, tools.denied_tools, blocked paths, and permission mode. |
| Too many repeated tool calls | Check stream JSON for stuck detection nudges and lower task scope. |
| No session should be persisted | Add --no-session. |
Permission Denied
Section titled “Permission Denied”kosmo settings:get tools.default_permission_mode --jsonkosmo settings:get tools.denied_tools --jsonkosmo settings:get tools.blocked_paths --jsonkosmo settings:get tools.allowed_paths --jsonRemember:
denied_toolsalways wins.- Blocked paths always win unless explicitly allowed.
- Plan and Ask modes remove write tools before permission evaluation.
- Prometheus auto-approves governed calls, but does not bypass hard denies.
- Integration and MCP read/write permissions are separate from native tool approval.
Integrations Fail
Section titled “Integrations Fail”kosmo integrations:list --jsonkosmo integrations:status --jsonkosmo integrations:doctor plane --jsonkosmo integrations:fields plane --jsonkosmo integrations:schema plane.list_issuesCommon fixes:
| Symptom | Fix |
|---|---|
| Integration not active | kosmo integrations:configure plane --enable --json |
| Missing credentials | Use integrations:fields then integrations:configure --set key=value. |
| Named account not found | Pass --account <alias> consistently. |
| Write denied in headless mode | Set write permission to allow or use --force only for trusted automation. |
| Function name unknown | Use integrations:search <query> --json. |
MCP Fails
Section titled “MCP Fails”kosmo mcp:list --all --jsonkosmo mcp:status --jsonkosmo mcp:doctor --jsonkosmo mcp:tools <server> --jsonCommon fixes:
| Symptom | Fix |
|---|---|
| Project server is untrusted | Review command, then run kosmo mcp:trust <server> --project --json. |
| Env token missing | `printf %s “$TOKEN” |
| Tool discovery fails | Confirm server command exists in PATH and can run outside KosmoKrator. |
| Tool treated as write | Set --read allow --write ask/allow explicitly; tools without readOnlyHint are conservative. |
| Config shape not detected | Use top-level mcpServers, or import compatible servers JSON with mcp:import. |
Web Search Or Fetch Fails
Section titled “Web Search Or Fetch Fails”kosmokrator web:providers --jsonkosmokrator web:doctor --jsonkosmo settings:list --category web --jsonCommon fixes:
| Symptom | Fix |
|---|---|
| Search tool unavailable | kosmo settings:set web.search.enabled on --json and restart. |
| Provider unconfigured | Use web:configure <provider> --api-key-env ... --enable. |
| External fetch unavailable | Set web.fetch.allow_external to on and choose a provider. |
| Crawl unavailable | Set web.crawl.enabled and choose Tavily or Firecrawl. |
Telegram Gateway Fails
Section titled “Telegram Gateway Fails”kosmo gateway:telegram:status --jsonkosmo settings:list --category gateway --jsonkosmo secrets:status gateway.telegram.token --jsonCommon fixes:
| Symptom | Fix |
|---|---|
| Gateway disabled | kosmo gateway:telegram:configure --enabled on --json |
| Missing token | Set kosmo.gateway.telegram.token or KOSMO_TELEGRAM_BOT_TOKEN. |
| Bot ignores group | Mention/reply to the bot, or configure free_response_chats. |
| Unauthorized chat/user | Check allowed_chats and allowed_users. |
Terminal UI Looks Wrong
Section titled “Terminal UI Looks Wrong”kosmo --renderer=ansi --no-animationkosmo settings:set ui.renderer ansi --global --jsonChecks:
| Symptom | Fix |
|---|---|
| TUI rendering glitches | Use a modern terminal, or force ANSI. |
| Animation causes startup issues | Use --no-animation or set ui.intro_animated off. |
| Colors are unreadable | Try ANSI mode and check terminal theme contrast. |
| Readline issues in remote shell | Force --renderer=ansi. |
Docs Site Build
Section titled “Docs Site Build”cd websitenpm cinpm run buildIf syntax highlighting or MDX fails, check fenced code blocks first. Astro/Starlight treats MDX as JSX, so raw < and { in prose sometimes need escaping or code fences.