# Hunt A Prod Error

A user saw internal_error, "Unexpected server error", a 500, or an opaque failure in a...

- Repository: https://github.com/different-ai/openwork (24362 stars)
- Category: Git and review
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add different-ai/openwork --skill hunt-a-prod-error -g -a claude-code -y`
Codex: `npx skills add different-ai/openwork --skill hunt-a-prod-error -g -a codex -y`
Cursor: `npx skills add different-ai/openwork --skill hunt-a-prod-error -g -a cursor -y`
Gemini CLI: `npx skills add different-ai/openwork --skill hunt-a-prod-error -g -a gemini-cli -y`

## Description

A user saw internal_error, "Unexpected server error", a 500, or an opaque failure in a shipped OpenWork build. Find the cause from local logs and Sentry, name the regressing PR, file the issue, and reply where it was reported.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Skill: Hunt a Prod Error

An opaque error has two halves. Local logs say **where** (route, status,
timing, burst shape). Sentry says **what** (the exception and stack). You need
both before naming a cause; either alone produces a guess.

## 1. Local logs: where and how often

Desktop server log (OTLP JSON, one record per request):

```
~/Library/Application Support/com.differentai.openwork/logs/openwork-server.log{,.1}
```

Engine log: `~/.local/share/opencode/log/opencode.log`.

Tally 5xx by route, then compare against the same route family that did
**not** fail. A failure rate on one route and zero on its siblings isolates the
code path; a burst of failures in the same millisecond points at a shared
event (GC, rollover, socket), not per-request data.

```bash
rg '"status":5' ~/Library/Application\ Support/com.differentai.openwork/logs/openwork-server.log* \
  | python3 -c 'import sys,json,re,collections; c=collections.Counter()
for l in sys.stdin:
  a=json.loads(l)["attributes"]; c[(a["method"], re.sub(r"(ses|ws|msg)_[A-Za-z0-9]+", r"\1_*", a["path"]), a.get("error.code"))]+=1
[print(v,k) for k,v in c.most_common()]'
```

Know the blind spot: the OpenCode proxy catch blocks in
`apps/server/src/server.ts` forward the real exception to Sentry only; the
local record carries the synthetic `Unexpected server error` and no cause.

## 2. Sentry: what threw

Sentry is connected through OpenWork Connect (`search_capabilities` →
`search_issues`, `get_sentry_resource`). Org `different-ai-inc`, project
`desktop-app`, region `https://us.sentry.io`.

Filter by the tags the server sets: `surface:server` and the templated
`route` (for example `route:"/workspace/:id/opencode/*"`), plus `release`.
Read the top issue's stack, `firstSeen`, users, and event count. The exact
exception message is the string a regression spec must reproduce.

## 3. Name the regression

The rest: https://github.com/different-ai/openwork/blob/HEAD/.opencode/skills/hunt-a-prod-error/SKILL.md
