agent-troubleshooting

A troubleshooting guide for developers working on XActions. It lists common failures in tests and integrations, explains likely causes, and gives corresponding fixes.

In plain words
What is it for?
Use it when tests fail because asynchronous calls were not awaited, pagination does not stop, or integration tests need a running API server.
Why use it?
It shortens debugging by connecting errors such as missing task IDs, timeouts, infinite pagination, or unexpected HTTP responses to specific implementation problems.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/nirholas/xactions/agent-troubleshooting
Clone the repo
git clone --depth 1 https://github.com/nirholas/XActions
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,374 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01374
Opus 5 $0.00000 $0.00687
Sonnet 5 $0.00000 $0.00275
Haiku 4.5 $0.00000 $0.00137

Measured 2d ago against content hash 255041d82e8a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agent-troubleshooting scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/agent-troubleshooting.md · 143 lines

How it starts

The opening of the file, as written. The whole thing — 143 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Troubleshooting Guide

Common issues agents encounter when working on XActions and how to resolve them.


Tests

Tests fail with "Task not found: undefined"

Cause: TaskStore methods are async — calling store.create() without await returns a Promise, not a task object. Passing the Promise as a task ID fails. Fix: Add await to all store.create(), store.get(), store.transition(), store.list() calls. Make test callbacks async.

Integration test worker crashes / times out

Cause: Usually an infinite pagination loop. scrapeUserList loops while (seen.size < limit). If the mock always returns the same response with a cursor and seen.size never reaches limit, it loops forever. Fix: Use a call counter in the mock. Return a no-cursor response after the first call per endpoint:

let callCount = 0;
const fetchMock = vi.fn(async (url) => {
  if (url.includes('Followers')) {
    callCount++;
    if (callCount > 1) return mockResponse({}); // no cursor → terminates
    return mockResponse(graphqlBody(FOLLOWERS_RESPONSE));
  }
});

x402-integration tests fail with 429 instead of 402

Cause: These tests require a running API server. Without the server, they hit a different endpoint. Fix: Start the server first: npm run dev. Then run: npx vitest run tests/x402-integration.test.js.

Mutation mock returns wrong shape

Cause: For GraphQL queries, client.graphql() wraps the response as { data: json, cursor }. For mutations (mutation: true), it returns the raw JSON directly. Fix: For mutation mocks, pass the full fixture with the data wrapper: mockResponse(TWEET_CREATE_RESPONSE), not mockResponse(graphqlBody(TWEET_CREATE_RESPONSE)).

Media upload test: "Cannot read properties of undefined (reading 'processing_info')"

Cause: MEDIA_FINALIZE_RESPONSE includes processing_info, which triggers a STATUS poll call. The mock has no response for this extra call, so it returns undefined. Fix: Add a STATUS mock after FINALIZE: .mockResolvedValueOnce({}). The pollProcessingStatus function returns immediately when processing_info is absent.

Read the full file on GitHub · 143 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 143 lines · 0 tokens per session scan A 255041d82e8a

Subscribe to this mod's changes

agent-troubleshooting is an agent published in the GitHub repository nirholas/XActions (496 stars, last pushed 4d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,374 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.