debugging-local-task-agent-runs

Diagnose local PostHog task runs by reading wizard and agent logs inside Docker sandboxes.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill debugging-local-task-agent-runs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debugging-local-task-agent-runs
Source: https://github.com/PostHog/posthog-foss/tree/main/.agents/skills/debugging-local-task-agent-runs
Command: npx skills add https://github.com/PostHog/posthog-foss --skill debugging-local-task-agent-runs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Local PostHog task runs execute inside Docker sandbox containers under the Temporal process-task workflow, and their output is invisible in the Temporal UI because workflow payloads are binary/encrypted. This Skill shows how to find the task UUID, tail live wizard and agent logs inside the sandbox, and read the durable per-run console log after teardown.

Core Features & Use Cases

  • Environment validation: Lists the required .env.local keys (SANDBOX_PROVIDER, SANDBOX_LLM_GATEWAY_URL, GitHub App credentials, LLM gateway key) plus the ai_features intent needed for local cloud runs.
  • Live log tailing: Locates the task-sandbox container via docker ps or the Temporal CLI and tails /tmp/posthog-wizard.log and /tmp/agent-server.log while the run executes.
  • Durable log retrieval: Reads the persisted per-run console log from object storage (tasks/logs/team_<id>/task_<id>/run_<run_id>.jsonl) after the sandbox is torn down.
  • Use Case: A local cloud run appears stuck with no output. Use this Skill to find the task UUID from the container name, tail the agent-server log to see the CI wait loop, and confirm the LLM gateway is running on port 3308.

Quick Start

Debug my stuck local PostHog task run by finding the sandbox container and showing me the wizard and agent logs.

Frequently Asked Questions about debugging-local-task-agent-runs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I see logs from a local PostHog task run?

Find the task UUID from the sandbox container name with docker ps, then run docker exec on the container to tail /tmp/posthog-wizard.log and /tmp/agent-server.log. These files stream live while the run executes and vanish when the sandbox is torn down.

Why does the Temporal UI not show my task run output?

The Temporal UI cannot display run output because workflow result and failure payloads are binary/encrypted, and the activity captures wizard and agent output to the run's logs rather than the timeline. Read the logs inside the sandbox container or from object storage instead.

How do I find the task UUID for a running sandbox?

Run docker ps and grep for task-sandbox, since the container name contains the task UUID. Alternatively, list process-task workflows with the Temporal CLI or open the Temporal UI at localhost:8081, where the workflow id is task-processing-<TASK_ID>-<RUN_ID>.

Why does my local cloud run fail with ConnectionRefused from the agent?

ConnectionRefused means the LLM gateway is not reachable on port 3308. Verify SANDBOX_LLM_GATEWAY_URL is set in .env.local and enable the ai_features intent via hogli dev:setup so the llm-gateway process actually starts, then restart the stack.

Can I read task run logs after the sandbox container is gone?

Yes, the run's console log persists in object storage at tasks/logs/team_<id>/task_<id>/run_<run_id>.jsonl. Use a Django shell snippet with TaskRun and object_storage.read to print console events and tool calls, though agent prose is filtered out of the durable log.