Troubleshooting
Start with the command that matches the failing surface, then inspect the effective settings and credentials.
Baseline Checks
Section titled “Baseline Checks”kosmokrator --versionkosmokrator smoke:startup --jsonkosmokrator config paths --jsonkosmokrator settings:doctor --jsonFor source checkouts:
composer installphp vendor/bin/phpunitphp vendor/bin/pint --testProvider Or Model Fails
Section titled “Provider Or Model Fails”kosmokrator providers:list --jsonkosmokrator providers:status --jsonkosmokrator providers:status openai --jsonkosmokrator settings:get agent.default_provider --jsonkosmokrator settings:get agent.default_model --jsonkosmokrator settings:options agent.default_model --provider openai --jsonCommon fixes:
| Symptom | Fix |
|---|---|
| Missing API key | `printf %s “$OPENAI_API_KEY” |
| Wrong default model | kosmokrator settings:set agent.default_model <model> --provider <provider> --json |
| OAuth provider not logged in | kosmokrator 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:
kosmokrator -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”kosmokrator settings:get tools.default_permission_mode --jsonkosmokrator settings:get tools.denied_tools --jsonkosmokrator settings:get tools.blocked_paths --jsonkosmokrator 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”kosmokrator integrations:list --jsonkosmokrator integrations:status --jsonkosmokrator integrations:doctor plane --jsonkosmokrator integrations:fields plane --jsonkosmokrator integrations:schema plane.list_issuesCommon fixes:
| Symptom | Fix |
|---|---|
| Integration not active | kosmokrator 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”kosmokrator mcp:list --all --jsonkosmokrator mcp:status --jsonkosmokrator mcp:doctor --jsonkosmokrator mcp:tools <server> --jsonCommon fixes:
| Symptom | Fix |
|---|---|
| Project server is untrusted | Review command, then run kosmokrator 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 --jsonkosmokrator settings:list --category web --jsonCommon fixes:
| Symptom | Fix |
|---|---|
| Search tool unavailable | kosmokrator 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”kosmokrator gateway:telegram:status --jsonkosmokrator settings:list --category gateway --jsonkosmokrator secrets:status gateway.telegram.token --jsonCommon fixes:
| Symptom | Fix |
|---|---|
| Gateway disabled | kosmokrator gateway:telegram:configure --enabled on --json |
| Missing token | Set gateway.telegram.token or KOSMOKRATOR_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”kosmokrator --renderer=ansi --no-animationkosmokrator 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.