Agent Skillsdifferent-ai/openwork › hunt-a-prod-error

hunt-a-prod-error

GitHub

定位生产环境500错误,结合本地日志与Sentry分析根因,关联回归PR,复现问题并提交修复报告。

.opencode/skills/hunt-a-prod-error/SKILL.md different-ai/openwork

Trigger Scenarios

用户反馈生产环境出现内部错误或500状态码 需要排查线上不透明错误的根本原因

Install

npx skills add different-ai/openwork --skill hunt-a-prod-error -g -y
More Options

Non-standard path

npx skills add https://github.com/different-ai/openwork/tree/dev/.opencode/skills/hunt-a-prod-error -g -y

Use without installing

npx skills use different-ai/openwork@hunt-a-prod-error

指定 Agent (Claude Code)

npx skills add different-ai/openwork --skill hunt-a-prod-error -a claude-code -g -y

安装 repo 全部 skill

npx skills add different-ai/openwork --all -g -y

预览 repo 内 skill

npx skills add different-ai/openwork --list

SKILL.md

Frontmatter
{
    "name": "hunt-a-prod-error",
    "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: 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.

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_capabilitiessearch_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

Correlate Sentry firstSeen with git log --since=<firstSeen - 2d> on the files in the stack. Confirm the shipped code matches source before reasoning about it:

npx --yes @electron/asar extract-file /Applications/OpenWork.app/Contents/Resources/app.asar server/dist/server.js

4. Reproduce on the shipping runtime

Reduce the mechanism to a script and run it on the runtime the error occurred in (run-tests → Match the runtime). A repro that passes on Bun for a Node/undici bug has proven nothing.

5. File and reply

  • Linear (team Engineering): symptom with the exact user-facing string, route tally, Sentry issue ids with users and counts, mechanism, repro, regressing PR, proposed fix. Link the Sentry issues as attachments.
  • Reply in the thread where the error was reported with the issue link and a five-line summary: what fails, how often, who is affected, why, what fixes it.
  • The fix PR carries a spec that reproduces the exact string on dev and passes on the head (write-a-spec). CI publishes the evidence.

Version History

  • c26be48 Current 2026-09-23 01:45

Same Skill Collection

.opencode/skills/agent-first-screenshots/SKILL.md
.opencode/skills/browser-automation/SKILL.md
.opencode/skills/build-a-witness/SKILL.md
.opencode/skills/cloud-dashboard-walkthrough/SKILL.md
.opencode/skills/create-plugin/SKILL.md
.opencode/skills/daytona-chrome-cdp/SKILL.md
.opencode/skills/daytona-cloud-instance/SKILL.md
.opencode/skills/daytona-cloud-server/SKILL.md
.opencode/skills/daytona-dev/SKILL.md
.opencode/skills/daytona-electron-den/SKILL.md
.opencode/skills/daytona-electron-test/SKILL.md
.opencode/skills/daytona-flow-validator/SKILL.md
.opencode/skills/daytona-recording-artifacts/SKILL.md
.opencode/skills/daytona-secrets-volume/SKILL.md
.opencode/skills/daytona-seeded-cloud-demo/SKILL.md
.opencode/skills/daytona-windows-cert/SKILL.md
.opencode/skills/daytona/SKILL.md
.opencode/skills/diagnose-a-red-run/SKILL.md
.opencode/skills/fraimz/SKILL.md
.opencode/skills/get-env-var/SKILL.md
.opencode/skills/open-a-pr/SKILL.md
.opencode/skills/openwork-models/SKILL.md
.opencode/skills/preview-my-work/SKILL.md
.opencode/skills/product-tutorial-pipeline/SKILL.md
.opencode/skills/prove-a-pr/SKILL.md
.opencode/skills/publish-evidence/SKILL.md
.opencode/skills/record-a-demo/SKILL.md
.opencode/skills/release/SKILL.md
.opencode/skills/review-a-contributor-pr/SKILL.md
.opencode/skills/run-evals/SKILL.md
.opencode/skills/run-tests/SKILL.md
.opencode/skills/shadcn/SKILL.md
.opencode/skills/upload-photo/SKILL.md
.opencode/skills/validate-a-release/SKILL.md
.opencode/skills/write-a-spec/SKILL.md
.warden/skills/confidentiality-review/SKILL.md
.warden/skills/design-spec-review/SKILL.md
.warden/skills/desktop-den-sync-review/SKILL.md
.warden/skills/diff-security-review/SKILL.md
.warden/skills/spec-provenance-review/SKILL.md
integrations/agent-plugins/openwork-connect/skills/openwork-connect/SKILL.md

Metadata

Files
0
Version
c26be48
Hash
5b69ac0e
Indexed
2026-09-23 01:45

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-23 06:31
浙ICP备14020137号-1