oneuptime icon indicating copy to clipboard operation
oneuptime copied to clipboard

AI does not know how to execute commands on host

Open weirdbiz opened this issue 1 month ago • 0 comments

Describe the bug AI does not know how to execute commands on host. Host AI agent is installed, and confirmed working, Test Connection and tests passed successfully, required env vars are in place. The problem is reproduced in 'Ask AI' and 'Incident investigation' services.

To Reproduce Steps to reproduce the behavior:

  1. In UI go to Hosts, click on Host item (for ex.: test01), go to 'AI - AI Agent'.
  2. Copy proposed docker compose configuration to yml file, create .env file with corresponded variables.
$ cat docker-compose.yml 
services:
  oneuptime-host-ai-agent:
    image: oneuptime/resource-ai-agent:release
    container_name: oneuptime-host-ai-agent
    user: "0:0"
    read_only: true
    tmpfs:
      - /tmp
    privileged: true
    pid: host
    network_mode: host
    environment:
      - ONEUPTIME_URL=${ONEUPTIME_URL}
      - ONEUPTIME_TELEMETRY_INGESTION_KEY=${ONEUPTIME_TELEMETRY_INGESTION_KEY:-}
      - ONEUPTIME_AI_AGENT_RESOURCE_TYPE=host
      - HOST_NAME=test01
      - ONEUPTIME_API_KEY=${ONEUPTIME_API_KEY:-}
      - PORT=${PORT:-3877}
      - TINI_SUBREAPER=1
      - ONEUPTIME_AI_INVESTIGATION=${ONEUPTIME_AI_INVESTIGATION:-}
      - ONEUPTIME_AI_FIXES=${ONEUPTIME_AI_FIXES:-}
      - ONEUPTIME_AI_ALLOW_WRITES=${ONEUPTIME_AI_ALLOW_WRITES:-false}
      - ONEUPTIME_AI_WRITE_TARGETS=${ONEUPTIME_AI_WRITE_TARGETS:-}
      - ONEUPTIME_AI_PROTECTED_TARGETS=${ONEUPTIME_AI_PROTECTED_TARGETS:-}
      - LOG_LEVEL=${LOG_LEVEL:-info}
    restart: unless-stopped
$ cat .env
ONEUPTIME_URL="http://example"
ONEUPTIME_TELEMETRY_INGESTION_KEY="example"
ONEUPTIME_AI_INVESTIGATION=true
ONEUPTIME_AI_FIXES=bypass-approval
ONEUPTIME_AI_ALLOW_WRITES=true
  1. Run Host AI Agent on host 'test01' with provided configuration.
  2. Ensure that agent is connected successfully via UI, refresh AI Agent section from step 1.
  3. Press '...' - 'Test Connection', then Press 'Logs' and ensure, that test commands executed successfully on the host.
  4. Ensure you are at the host page ('test01' in our case). Press 'Ask AI'. Send a message "Call 'uptime' command on remote host".
  5. Receive answer like "I don't have a tool that can execute commands on remote hosts."

Expected behavior Command 'uptime' executed successfully by asking AI, via Host AI agent on remote host.

Screenshots

Image Image

Desktop: OS: MacOS Browser: Chrome Version: 155.0.8059.85

Deployment Type: self hosted, docker run, VM Ubuntu 24.04 Version: 14.0.89 Commit: https://github.com/OneUptime/oneuptime/commit/7df7e324ef95e408b42f7f77490b6dbcf62da753

weirdbiz avatar Oct 25 '26 15:10 weirdbiz