{"record":{"id":"5ae6dd0e396eec3c","repo":"multica-ai/multica","slug":"no-agent-found-matching-q","errorCode":null,"errorMessage":"no agent found matching %q","messagePattern":"no agent found matching %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_autopilot.go","lineNumber":803,"sourceCode":"\tvar agents []map[string]any\n\tagentPath := \"/api/agents?\" + url.Values{\"workspace_id\": {client.WorkspaceID}}.Encode()\n\tif err := client.GetJSON(ctx, agentPath, &agents); err != nil {\n\t\treturn \"\", fmt.Errorf(\"fetch agents: %w\", err)\n\t}\n\n\tnameLower := strings.ToLower(nameOrID)\n\ttype match struct{ ID, Name string }\n\tvar matches []match\n\tfor _, a := range agents {\n\t\taName := strVal(a, \"name\")\n\t\tif strings.Contains(strings.ToLower(aName), nameLower) {\n\t\t\tmatches = append(matches, match{ID: strVal(a, \"id\"), Name: aName})\n\t\t}\n\t}\n\n\tswitch len(matches) {\n\tcase 0:\n\t\treturn \"\", fmt.Errorf(\"no agent found matching %q\", nameOrID)\n\tcase 1:\n\t\treturn matches[0].ID, nil\n\tdefault:\n\t\tvar parts []string\n\t\tfor _, m := range matches {\n\t\t\tparts = append(parts, fmt.Sprintf(\"  %q (%s)\", m.Name, truncateID(m.ID)))\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"ambiguous agent %q; matches:\\n%s\", nameOrID, strings.Join(parts, \"\\n\"))\n\t}\n}\n","sourceCodeStart":785,"sourceCodeEnd":814,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_autopilot.go#L785-L814","documentation":"After fetching the workspace's agents, resolveAgent matched the given name (case-insensitive substring) against zero agent names. The agent either does not exist in that workspace or its name shares no substring with the query.","triggerScenarios":"`--agent staging-bot` when no agent in the target workspace has 'staging-bot' in its name; agent belongs to a different workspace than workspace_id; agent was deleted or renamed.","commonSituations":"Renamed agents; environments (dev/staging/prod workspaces) each having differently named agents; typos in automation scripts.","solutions":["List the workspace's agents to see exact names: GET /api/agents?workspace_id=<id> (or the corresponding list command).","Check you are targeting the right workspace_id.","Or use the agent's UUID directly, which skips name matching."],"exampleFix":"# before\nmultica autopilot trigger create --name t1 --agent triagebot\n# after (after checking the real name via agent list)\nmultica autopilot trigger create --name t1 --agent triage-bot","handlingStrategy":"validation","validationCode":"# fail fast if the name matches no agent in the target workspace\nmultica api get \"/api/agents?workspace_id=$WS\" | jq -e --arg n \"$AGENT\" '.[] | select((.name | ascii_downcase | contains($n | ascii_downcase)))' >/dev/null \\\n  || { echo \"no agent matches '$AGENT' in $WS\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Store agent UUIDs (not names) in automation config; rename-proof and bypasses matching.","After renaming/deleting agents, grep your scripts for the old name."],"tags":["cli","agents","resolution","go"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}