Synthèse automatique
Cette skill guide l'investigation d'un run d'agent échoué ou suspect en interrogeant les tables de télémétrie `agent_runs` et `llm_call_metrics` de la base D1 de production `cat_factory`.
Points forts
- Fournit des requêtes SQL prêtes à l'emploi, étape par étape (trouver le run, lire le verdict d'échec, lire les appels LLM).
- Explique comment interpréter chaque colonne : `ok=0` ou `http_status` non-2xx signalent un problème d'infrastructure, tandis que `finish_reason='length'` indique une troncature de sortie.
- Relie le verdict structuré de `agent_runs.failure` aux corps complets de prompts/réponses de `llm_call_metrics` via `execution_id`.
- Rappelle la fenêtre de rétention courte des métriques d'appels LLM, ce qui pousse à investiguer rapidement.
Limites
- Suppose un accès authentifié à la base D1 de production `cat_factory` via wrangler depuis `deploy/backend`.
- Fortement lié au schéma propre à ce projet (`agent_runs`, `llm_call_metrics`) et donc peu réutilisable ailleurs.
- Le texte des prompts et réponses n'est conservé que quelques jours (3 par défaut), ce qui rend l'analyse de runs plus anciens impossible.
À utiliser lorsqu'un run d'agent a échoué, s'est interrompu avec « no progress », est resté bloqué ou en boucle, ou a produit une sortie de mauvaise qualité et qu'il faut en trouver la cause racine.
À ne pas utiliser pour de la supervision en temps réel, ni pour des runs d'un autre projet ou plus anciens que la fenêtre de rétention des métriques.
Analyse de sécurité
PrudenceThe skill performs read-only SQL queries on production telemetry data via wrangler, which is a legitimate investigative purpose but involves network access to a remote database and exposure of potentially sensitive LLM I/O. The instruction to skip auth pre-check adds a mild risk, but the actions are non-destructive and do not exfiltrate data outside the local analysis. Overall it is caution, not risky.
- •Instructs executing remote wrangler d1 queries against a production database (cat_factory) using --remote and --json.
- •Accesses full prompt_text and response_text from llm_call_metrics, which may contain sensitive data such as internal prompts, tool results, or secrets.
- •Tells the agent to assume Cloudflare authentication is already correct and not to pre-check it, which could lead to unauthorized access if the environment is misconfigured.
- •Uses bash command execution (npx wrangler, node -e) even though no allowed-tools are declared, meaning the skill may not be executable in gated environments.
Exemples
What went wrong with the latest implementer run? Pull the telemetry from D1 and tell me the root cause.A run aborted with a ProgressGuard 'no progress' failure. Query agent_runs and llm_call_metrics for that run and explain why the agent stalled.Look into the coder step of my most recent run — I suspect the model was being cut off. Check finish_reason and completion_tokens versus request_max_tokens.name: investigate-telemetry
description: Investigate a failed or suspicious agent run (implementer/coder, bootstrap, reviewer, etc.) using the production telemetry in D1. Use when asked to look into a run failure, "no progress" abort, a stuck/looping agent, model output quality, token/truncation issues, or "what went wrong with the latest run". Pulls the run lifecycle from agent_runs and the per-LLM-call prompt/response/usage from llm_call_metrics, then reads the tool-call loop to find the root cause.
Investigate run telemetry (from D1)
Telemetry lives in the production D1 database cat_factory, NOT (primarily) in
Cloudflare Workers Observability. Two tables carry everything you need:
agent_runs— one row per container-backed run (kind='execution'for the task pipeline / implementer,kind='bootstrap'for repo bootstrap). Holdsstatus, the structuredfailureJSON (kind/message/hint/lastSubtasks), and adetailJSON with every pipeline step (agentKind, state, model, approvals, per-stepmetrics). This is the lifecycle + the failure verdict.llm_call_metrics— one row per proxied LLM call (migration 0026). Holdsagent_kind,provider,model,ok,http_status,finish_reason, token counts,request_max_tokens, the latency split (upstream_ms/overhead_ms),error_message, and the fullprompt_text+response_text. Linked to a run byexecution_id. This is what the model actually saw and produced.
Retention: llm_call_metrics is pruned aggressively (default 3 days,
LLM_CALL_METRICS_RETENTION_DAYS) because the full bodies are heavy; agent_runs
lives longer. Investigate recent runs promptly.
How to query
Run wrangler from deploy/backend (its wrangler.toml defines the cat_factory
binding). Always pass --remote (production) and --json (parseable). Do NOT
pre-check Cloudflare auth — assume the login is correct (see CLAUDE.md).
cd deploy/backend
npx wrangler d1 execute cat_factory --remote --json --command "SELECT ..."
Parse the JSON with node -e (Python is not on PATH here). The result shape is
[{ results: [...rows], success, meta }].
Step 1 — find the run
Latest implementer/pipeline runs (drop the WHERE kind to see bootstrap too):
SELECT id, kind, status, block_id,
datetime(created_at/1000,'unixepoch') AS created,
datetime(updated_at/1000,'unixepoch') AS updated
FROM agent_runs
WHERE kind='execution'
ORDER BY created_at DESC LIMIT 10;
Take the id (e.g. exec_44c8387cac02) of the run in question.
Step 2 — read the failure verdict and step list
SELECT failure, detail FROM agent_runs WHERE id='<run id>';
failure(JSON):kind(job_failed,evicted,timeout,agent, …),message(the abort reason — e.g. theProgressGuardtext),hint, andlastSubtasks. This tells you HOW the run died.detail.steps[](JSON): which step was running at failure (state:'working'), themodeleach step used, and each step's rolled-upmetrics(calls,truncatedCalls,errors,warnings,peakCompletionTokens,maxOutputTokens). The step withjobId === <run id>is the container step.
Step 3 — read the per-call LLM telemetry
Overview of every call for the failing step's kind (usually coder):
SELECT agent_kind, provider, model, ok, http_status, finish_reason,
prompt_tokens, completion_tokens, request_max_tokens, upstream_ms,
datetime(created_at/1000,'unixepoch') AS t, substr(error_message,1,300) AS err
FROM llm_call_metrics
WHERE execution_id='<run id>' AND agent_kind='coder'
ORDER BY created_at ASC;
Read the columns as signals:
ok=0/ non-2xxhttp_status/ non-nullerror_message→ transport, proxy, or spend-gate failure (an infra problem, not a model problem).finish_reason='length'orcompletion_tokensnearrequest_max_tokens→ output truncation; the model was cut off mid-answer (raise the output limit or shrink the task).truncatedCallsin the step metrics counts these.ok=1+finish_reason='tool_calls'everywhere → the LLM side is healthy; the failure is in tool EXECUTION inside the container (see step 4). TheProgressGuard(harnesspi.ts) counts failing tool calls from Pi's event stream — those tool errors are NOT rows here, only the LLM calls that drove them.
Step 4 — read the actual tool-call loop (the root cause)
prompt_text is stored as a DELTA vs the previous call (migration 0027), so each
call's prompt_text contains the new assistant message(s) plus the tool RESULT
messages returned to the model — including tool validation errors. response_text
is the model's text content (tool-call arguments are echoed inside the assistant
message in the next call's prompt delta).
Dump responses to see what the model was trying to do:
SELECT completion_tokens, response_text
FROM llm_call_metrics
WHERE execution_id='<run id>' AND agent_kind='coder'
ORDER BY created_at ASC;
Dump the tail of the final prompt to see the last tool result/error the model got:
SELECT prompt_text FROM llm_call_metrics
WHERE execution_id='<run id>' AND agent_kind='coder'
ORDER BY created_at DESC LIMIT 1;
Look for, in prompt_text: Validation failed for tool "<tool>" /
must have required properties <field> (the model is emitting malformed tool
args), repeated identical tool calls (a stuck loop), or <tool_call>…</tool_call>
appearing as literal TEXT in response_text (the model emitted a tool call as
prose instead of through the structured channel — fragile parsing, a model-quality
smell). In response_text: garbled token-soup completions point at a Workers AI
decode bug for that model (cf. the streaming token-doubling fix, commit 23b9fb6).
Step 5 — classify and report
Decide whether the failure is:
- Model quality — malformed/looping tool calls, garbled output, ignored validation errors. Fix: don't default that role to that model; pin a stronger tool-calling model or denylist it for code steps.
- Truncation —
finish_reason='length'. Fix: raise output limit / split task. - Infra —
ok=0, HTTP errors, spend-gate refusals, eviction/timeout (failure.kind). Fix: the proxy/runner/budget, not the prompt. - Working as designed — the
ProgressGuardaborting a genuinely stuck run is the safety net doing its job; the bug (if any) is upstream of it.
Report: the run id, the failing step + model, the abort reason, the root-cause
class with the evidence (quote the specific tool error or response), and a concrete
fix. Then the run can be retried (POST /workspaces/:ws/agent-runs/:id/retry,
or the board "retry" button) to spin a fresh container.
Notes
- Helper one-liner to scan all deltas for tool validation failures:
pipe the
prompt_textrows throughnodeandmatch(/must have required properties (\w+)/g). - The app also exposes this without SQL:
GET /executions/:id/llm-metrics(per-call list) andGET /executions/:id/llm-metrics/export(LLM-friendly JSON bundle). Use D1 directly when you need cross-run queries or the app is unreachable.
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/investigate-run-telemetry-mrx3xzxo/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/investigate-run-telemetry-mrx3xzxo' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/investigate-run-telemetry-mrx3xzxo/download' --output '.skill-downloads/investigate-run-telemetry-mrx3xzxo/SKILL.md.part' && mv '.skill-downloads/investigate-run-telemetry-mrx3xzxo/SKILL.md.part' '.skill-downloads/investigate-run-telemetry-mrx3xzxo/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/investigate-run-telemetry-mrx3xzxo/SKILL.md' && test -s '.skill-downloads/investigate-run-telemetry-mrx3xzxo/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/investigate-telemetry' && cp -R '.skill-downloads/investigate-run-telemetry-mrx3xzxo' '.claude/skills/investigate-telemetry'Cursor
test -f '.skill-downloads/investigate-run-telemetry-mrx3xzxo/SKILL.md' && test -s '.skill-downloads/investigate-run-telemetry-mrx3xzxo/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/investigate-telemetry' && cp -R '.skill-downloads/investigate-run-telemetry-mrx3xzxo' '.cursor/skills/investigate-telemetry'Codex
test -f '.skill-downloads/investigate-run-telemetry-mrx3xzxo/SKILL.md' && test -s '.skill-downloads/investigate-run-telemetry-mrx3xzxo/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/investigate-telemetry' && cp -R '.skill-downloads/investigate-run-telemetry-mrx3xzxo' '.agents/skills/investigate-telemetry'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/investigate-run-telemetry-mrx3xzxo'openskills read 'investigate-run-telemetry-mrx3xzxo'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/investigate-run-telemetry-mrx3xzxo/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Configurer un canal de discussion avec SecretRefs
DevOps
Configurez des canaux de discussion avec des commandes non interactives, les secrets étant uniquement des SecretRefs. Couvre les étapes de collecte, modification, réparation et vérification.
Enquêter sur les échecs CI de ClickHouse
DevOps
Investigue un échec CI de ClickHouse de bout en bout à partir d'une URL de PR ou de rapport S3. Récupère les tests échoués, classe flaky vs vraie régression, et cherche des issues/fixes existants.
Revue de PR Ansible
DevOps
Examine une PR Ansible selon le processus standardisé du projet, incluant la validation des changelogs, la couverture de tests et le suivi des commentaires.