Investigate code-level root causes with Qoder CLI through Satellite

Updated at:

After telemetry narrows a production incident to a specific service endpoint, confirming the root cause often requires inspecting application source code. Many enterprise repositories run on private networks without public internet exposure. By connecting a host that runs Qoder CLI (qodercli) through Satellite, a STAROps Digital Employee can dispatch read-only code investigation tasks to the host, locate defective files and line numbers in place, and return code-level evidence to the active troubleshooting session.

Architecture and workflow

Metrics and error logs identify which endpoint is failing and which dependency is timing out, yet rarely explain why a connection pool stops recovering after intermittent errors or which conditional branch bypassed an idempotency check. When source repositories reside exclusively on a private network, engineers must pivot manually between cloud dashboards and internal terminals, increasing mean time to resolution (MTTR).

Pairing STAROps Satellite with local qodercli connects cloud telemetry analysis directly to private code inspection:

  1. Narrow diagnostic questions in the cloud: The STAROps Digital Employee correlates alerts, metrics, and logs to formulate a focused code inspection query.

  2. Communicate over an outbound-only tunnel: The satellited daemon on the host establishes an outbound port 443 TLS connection to Alibaba Cloud. You need not open public inbound ports on the host or expose internal Git servers to the internet.

  3. Inspect repositories locally in read-only mode: satellited invokes qodercli in non-interactive read-only mode within the target repository directory, returning file paths, line numbers, and remediation code to the session.

Architecture for correlating STAROps telemetry with local Qoder CLI code investigation through Satellite

Depending on the security requirements of your host environment, choose one of two integration approaches:

Approach

Mechanism

Recommended environment

Option 1: Direct invocation with built-in bash

Enable the built-in bash capability on the Satellite so the Digital Employee runs read-only qodercli commands on demand

Personal development workstations or test bastion hosts for quick end-to-end validation

Option 2: Read-only wrapper in capabilities.json

Disable built-in bash and declare a controlled script capability with an enum repository allowlist and fixed read-only flags

Production diagnostic hosts or shared build servers to eliminate arbitrary shell execution and path traversal

Prerequisites

  • Your Alibaba Cloud account holds an Advanced or Ultimate STAROps subscription, and you have created a Digital Employee in a supported region. For plan details, see Subscription plans.

  • satellited is installed on the target host (Linux or Apple silicon macOS) and bound to a Satellite whose connection status is Online. For installation steps, see Satellite.

  • qodercli is installed on the target host (the flags in this guide are verified against version 1.1.104), and the OS user that executes satellited tasks is signed in to qodercli.

  • A local checkout of the target repository exists on the host, and the task execution user has read permission on that directory.

Option 1: Quick validation on a dev/test host with built-in bash

On a development or test host, enable the built-in bash capability on your Satellite to validate the workflow directly.

Step 1: Verify Satellite and local Qoder CLI status

  1. Log on to the STAROps console, select your Digital Employee, and choose Settings > Connectors > Satellite in the left-side navigation pane.

  2. Click the target Satellite name (code-host in this example) and confirm that Connection status is Online with the bash capability reported.

    Satellite online connection status and reported capability in the STAROps console

  3. Log on to the target host as the OS user that runs satellited tasks, and check the qodercli binary path, version, and authentication state:

    command -v qodercli
    qodercli --version
    qodercli status

Confirm that qodercli status reports an authenticated session. If the binary resides in a user-local directory such as ~/.local/bin/qodercli, note its full path.

Step 2: Review non-interactive read-only CLI flags

qodercli starts an interactive terminal UI by default, whereas satellited executes tasks in background subprocesses without a TTY. For automated remote runs, pass explicit non-interactive and read-only flags:

CLI flag

Purpose

-p (--print)

Run in non-interactive mode, print the analysis output, and exit immediately instead of waiting for a TTY

-w <dir> (--cwd)

Pin the working directory to the root of the target repository

--no-session-persistence

Disable session persistence when paired with -p so diagnostic runs do not leave session files on disk

--permission-mode dont_ask

Reject actions that require extra confirmation instead of blocking on interactive prompts

--tools Read Grep Glob

Restrict built-in tools to file reading, content search, and file matching, disabling Bash, Edit, and Write

--strict-mcp-config

Ignore locally configured external MCP servers when --mcp-config is omitted so inspection stays confined to local files

Run a quick smoke test on the host terminal (replace /tmp/order-service with your repository path) and confirm that the command exits with code 0:

qodercli -w /tmp/order-service \
  --no-session-persistence \
  --permission-mode dont_ask \
  --tools Read Grep Glob \
  --strict-mcp-config \
  -p "List the module entry file and HTTP route registration locations with file paths and line numbers only."

Step 3: Run a correlated investigation from chat

Consider a typical production symptom: during peak traffic, /checkout on order-service returns frequent 502 errors and timeouts. Host metrics show that ESTABLISHED sockets climb to 50 after intermittent 502 responses from the upstream inventory service and never drop back down.

  1. Click New chat in the left-side navigation pane of your Digital Employee.

  2. Enter a prompt combining the observed telemetry symptom and the target repository path (you can also type @ to reference the Satellite explicitly):

    During peak traffic, order-service returned frequent 502s and timeouts on /checkout. Monitoring shows ESTABLISHED connections climbed to 50 after intermittent 502s from the upstream inventory service and never dropped. Use Satellite code-host to run local qodercli in read-only non-interactive mode (Read/Grep/Glob tools only, no session persistence) against /tmp/order-service to identify the exact file, line numbers, leak trigger chain, and fix.
  3. Review the root cause analysis returned by the Digital Employee. After running qodercli on the host and cross-checking the cited lines, the Digital Employee reports the complete evidence chain:

    • Defect location: client/inventory.go lines 54–57 return early when resp.StatusCode >= 500 before defer resp.Body.Close() is registered, leaking one underlying TCP connection on every upstream 502.

    • Metric correlation: MaxConnsPerHost: 50 on line 22 of client/inventory.go explains the plateau at 50 connections. Once all 50 slots are occupied by leaked connections, subsequent calls block until the 2-second context deadline in handler/checkout.go expires.

    • Remediation: Drain and close resp.Body immediately after http.Do succeeds before checking status codes, and configure explicit Transport timeouts.

    Digital Employee invoking local Qoder CLI through Satellite to pinpoint a connection leak

Option 2: Encapsulate a read-only capability for production hosts

On production diagnostic servers or shared build machines, avoid leaving arbitrary bash execution enabled. Instead, disable built-in bash and expose qodercli as a structured, read-only script capability in capabilities.json:

  • Repository allowlist: Restrict selectable services with an enum parameter and map each key to a fixed directory inside the script, rejecting arbitrary filesystem paths.

  • Injection-safe parameter passing: satellited executes the script binary path directly without /bin/sh -c concatenation, passing validated parameters through SATELLITE_PARAM_<UPPERCASE_NAME> environment variables.

  • Local enforcement: satellited enforces the local capabilities.json manifest on the host as the final authority.

Sequence diagram of read-only capability declaration and local Qoder CLI execution

Step 1: Create the controlled wrapper script

On the target host, create an administrator-owned directory /opt/starops-ops and write /opt/starops-ops/qoder_diagnose.sh (replace QODER_BIN and the repository paths with your actual paths):

sudo install -d -m 0755 -o root -g root /opt/starops-ops

sudo tee /opt/starops-ops/qoder_diagnose.sh > /dev/null <<'EOF'
#!/usr/bin/env bash
set -euo pipefail

REPO_KEY="${SATELLITE_PARAM_REPO:-}"
QUESTION="${SATELLITE_PARAM_QUESTION:-}"
QODER_BIN="/usr/local/bin/qodercli"

case "$REPO_KEY" in
  order-service)    REPO_DIR="/srv/repos/order-service" ;;
  inventory-api)    REPO_DIR="/srv/repos/inventory-api" ;;
  payment-worker)   REPO_DIR="/srv/repos/payment-worker" ;;
  *)
    echo "Unsupported repository key: $REPO_KEY" >&2
    exit 2
    ;;
esac

if [ -z "$QUESTION" ] || [ "${#QUESTION}" -gt 2000 ]; then
  echo "question must be 1 to 2000 characters" >&2
  exit 2
fi

if [ ! -x "$QODER_BIN" ]; then
  echo "qodercli binary not executable at $QODER_BIN" >&2
  exit 3
fi

exec "$QODER_BIN" \
  -w "$REPO_DIR" \
  --no-session-persistence \
  --permission-mode dont_ask \
  --tools Read Grep Glob \
  --strict-mcp-config \
  -p "Perform a strictly read-only investigation on this repository. Provide a concise root cause, file paths, line numbers, and fix: ${QUESTION}"
EOF

sudo chown root:root /opt/starops-ops/qoder_diagnose.sh
sudo chmod 0755 /opt/starops-ops/qoder_diagnose.sh

Step 2: Declare the capability in capabilities.json

Warning

Inspect the existing capabilities.json on the host before editing (/etc/satellited/capabilities.json for system-level installs or ~/.satellited/capabilities.json for user-level installs; run satellited status to check). Merge qoder_diagnose into the existing capabilities array rather than overwriting other declared entries. Remove "id": "bash" if you want to disable arbitrary shell commands on this host.

Add qoder_diagnose to capabilities.json. Multi-file code search and model reasoning typically take 15–120 seconds depending on repository size, so set timeout_s to 180:

{
  "capabilities": [
    {
      "id": "qoder_diagnose",
      "type": "script",
      "exec": "/opt/starops-ops/qoder_diagnose.sh",
      "description": "Read-only source code investigation on allowlisted repositories to locate root causes, file paths, line numbers, and fixes",
      "execution_mode": "auto",
      "timeout_s": 180,
      "params": [
        {
          "name": "repo",
          "type": "enum",
          "required": true,
          "enum": ["order-service", "inventory-api", "payment-worker"],
          "help": "Target service repository identifier"
        },
        {
          "name": "question",
          "type": "string",
          "required": true,
          "help": "Observed failure symptom, endpoint path, error log, or stack trace to investigate"
        }
      ]
    }
  ]
}

Save the file and wait about 15 seconds for satellited to hot-reload and report the updated snapshot. Refresh the Capabilities tab on the Satellite details page and confirm that qoder_diagnose appears with mode Auto. When you ask the Digital Employee to investigate code issues for an allowlisted service, it invokes qoder_diagnose directly using the declared schema.

Advanced practice: Accelerate Qoder CLI calls with a Digital Employee Skill

When a prompt omits the Satellite ID, repository path, or CLI flags in a new chat session, the Digital Employee typically spends 3–4 tool rounds probing the environment from scratch. It runs starops satellite list to find online Satellites, checks which qodercli and filesystem paths on the host, and runs qodercli --help to test non-interactive flags—sometimes passing an unsupported --timeout flag to qodercli and retrying.

Packaging your verified host mapping and command template into a Digital Employee Skill eliminates repeated probing across every session:

  • Predefined host and repository map: Store service names, Satellite IDs, repository paths, and the qodercli binary path in SKILL.md so the agent skips list, which, and directory discovery.

  • Built-in flag and quoting rules: Fix -p --no-session-persistence --permission-mode dont_ask --tools Read Grep Glob --strict-mcp-config and --args-file JSON passing so commands succeed on the first run.

  • Progressive context loading: STAROps loads only the skill name and description at startup, reading the full SKILL.md instructions only when an incident requires source code inspection.

Comparison between multi-round probing without a skill and one-shot execution with a Digital Employee Skill

Step 1: Create the Digital Employee Skill in the console

  1. Click Settings in the left-side navigation pane of your Digital Employee, and select the Skills tab at the top.

  2. Click Add Skill > New skill in the upper-right corner and stay on the Create Directly tab.

  3. Set Skill name to qodercli-code-triage and Display name to Qoder CLI Code Root-Cause Triage.

  4. Paste the following SKILL.md template into the editor, replacing the Satellite IDs, repository paths, and qodercli binary path with your environment values:

    ---
    name: qodercli-code-triage
    description: Locate code-level root causes through Satellite and local Qoder CLI (qodercli) when 5xx errors, endpoint timeouts, or connection leaks require source code inspection. Predefines Satellite IDs, repository paths, and read-only non-interactive flags.
    ---
    
    # Qoder CLI Code Root-Cause Triage
    
    When investigating 5xx errors, timeouts, or connection leaks that require source code inspection, execute the predefined mapping below directly. Do not run `starops satellite list`, `which qodercli`, `qodercli --help`, or directory discovery commands first.
    
    ## 1. Service and Satellite Mapping
    
    | Service | Satellite ID | Capability | Repository Path | qodercli Binary |
    | --- | --- | --- | --- | --- |
    | `order-service` | `sat-8f2a9c41d0e3b712` | `qoder_diagnose` | `/srv/repos/order-service` | `/usr/local/bin/qodercli` |
    | `inventory-api` | `sat-8f2a9c41d0e3b712` | `bash` | `/srv/repos/inventory-api` | `/usr/local/bin/qodercli` |
    
    ## 2. One-Shot Read-Only Invocation Templates
    
    - **When the host exposes `qoder_diagnose` (controlled production capability)**:
    
      ~~~bash
      starops satellite run \
        --satellite <SatelliteID> \
        --capability qoder_diagnose \
        --repo=<ServiceName> \
        --question="<endpoint path and telemetry symptom>" \
        --timeout 180s \
        -o json > /tmp/qoder-res.json
      jq -r '.result.stdout' /tmp/qoder-res.json
      ~~~
    
    - **When the host uses built-in `bash` (dev/test host)**: Pass JSON through `--args-file` to avoid nested shell quoting errors:
    
      ~~~bash
      cat > /tmp/qoder-args.json <<'JSON'
      {"command":"/usr/local/bin/qodercli -w /srv/repos/inventory-api --no-session-persistence --permission-mode dont_ask --tools Read Grep Glob --strict-mcp-config -p 'Inspect this repository in read-only mode. Return concise root cause, exact file paths, line numbers, and fix: <symptom>'"}
      JSON
      starops satellite run \
        --satellite <SatelliteID> \
        --capability bash \
        --args-file /tmp/qoder-args.json \
        --timeout 180s \
        -o json > /tmp/qoder-res.json
      jq -r '.result.stdout' /tmp/qoder-res.json
      ~~~
    
    ## 3. Execution Guardrails
    
    - `qodercli` (1.1.104) has no `--timeout` flag; always set the deadline on `starops satellite run --timeout 180s`.
    - Always pass `-p --no-session-persistence --permission-mode dont_ask --tools Read Grep Glob --strict-mcp-config` to prevent TTY hangs, enforce read-only inspection, and skip session files.
    - Satellite caps each stream at 64 KiB; summarize directly once `qodercli` returns exact file paths, line numbers, and code snippets without re-reading full files remotely.
  5. Click New skill at the bottom of the page and click OK in the confirmation dialog. Confirm that the skill card shows Enabled on the Skills tab.

    Enabled Qoder CLI Code Root-Cause Triage skill card and overview drawer in STAROps

Step 2: Trigger zero-flag code investigation in chat

Once enabled, you can activate the skill in two ways:

  • Automatic context matching: Describe the failing service and metric symptom directly in chat; the Digital Employee matches the skill description and loads qodercli-code-triage automatically.

  • Explicit selection: Click + (Add skill) in the lower-left corner of the chat input box to attach Qoder CLI Code Root-Cause Triage, or name qodercli-code-triage in your prompt.

Start a new chat and send a single-sentence symptom prompt without specifying any Satellite name, directory path, or CLI flag:

During peak traffic, /checkout on order-service returned frequent 502s and ESTABLISHED connections stayed stuck at 50 after intermittent upstream 502s. Find the code-level root cause.

Expanding the execution trace above the answer shows that the Digital Employee reads qodercli-code-triage/SKILL.md first, skips Satellite discovery and --help flag probing, and dispatches the read-only qodercli task directly to pinpoint the leak in client/inventory.go.

Digital Employee loading the qodercli-code-triage skill automatically and locating the code root cause without exploratory commands

Extending the pattern to other internal CLI tools

Integrating qodercli illustrates a broader operational pattern: correlate telemetry in STAROps while executing specialized CLI tools next to private assets. Repositories, internal databases, and credentials remain on controlled hosts, while Satellite exposes deterministic, allowlisted capabilities.

You can apply the same pattern to connect other engineering and operations tools on private networks:

Scenario

Local tool or command

Recommended encapsulation

Execution mode

Pre- and post-release security scanning

qodercli security scan

Expose an enum repository parameter and pair with Create and plan a mission for scheduled security audits

auto

Change correlation during incident windows

git -C <repo> log --since, git show --stat

Wrap a read-only Git history query to inspect commits within 1–2 hours before an alert alongside qodercli findings

auto

Private database slow-query and lock triage

psql or mysql (using a read-only DB role)

Map vetted diagnostic queries to enum keys (such as lock_wait or top_slow_sql) rather than accepting raw SQL

auto

Private Kubernetes cluster diagnostics and recovery

kubectl get/describe/logs, kubectl rollout restart

Set read-only inspection commands to auto and package namespace conventions in a Digital Employee Skill; set restart actions to hil for human approval

auto for reads, hil for changes

Limits and troubleshooting

  • Keep output concise: Satellite caps stdout and stderr at 64 KiB per stream by default, replacing excess middle bytes with ...[dropped N bytes].... Instruct qodercli to return concise root causes, file paths, line numbers, and focused snippets rather than dumping entire files.

  • Align task and capability timeouts: Effective execution timeout equals the smaller of the cloud task deadline and local timeout_s. Set --timeout to 180s or higher for built-in bash runs, and set timeout_s to 180–300 in capabilities.json.

  • Verify model endpoint compliance: While this workflow avoids exposing internal Git servers to STAROps, qodercli still communicates with its configured model service from the host and returns its text summary through Satellite. Verify that the model endpoint configured for qodercli meets your organization's data governance policy.

Symptom

Common cause

Resolution

Task hangs without output until timeout

-p (--print) was omitted so qodercli entered interactive TUI mode, or a permission prompt waited for terminal input

Always pass -p --no-session-persistence --permission-mode dont_ask in commands and wrapper scripts.

Task fails with qodercli: command not found

When run_as is set, subprocesses receive a minimal system PATH (/usr/local/bin, /usr/bin, and standard system directories) that excludes ~/.local/bin

Reference the absolute path to qodercli in your script or create a symlink at /usr/local/bin/qodercli.

qodercli reports unauthenticated or expired session

Login credentials reside under a personal user home directory while satellited runs as satellited or another run_as user

Sign in to qodercli under the actual task execution account and verify with qodercli status, or use a user-level install on personal dev hosts.

qoder_diagnose does not appear on the Capabilities tab

capabilities.json contains invalid JSON, or a capability id / parameter name does not start with a lowercase letter (satellited retains the last valid manifest)

Check satellited logs for validation warnings, fix the JSON syntax or identifier naming, and refresh after 15 seconds.

Digital Employee still probes paths and --help after adding the skill

The skill toggle is disabled, or the skill description does not match the symptom terms in the prompt

Enable the skill under Settings > Skills, refine its description keywords, or click + (Add skill) in the chat input box to select it explicitly.