agentleFS
DeepSeekKnown publisher

dsh-error-handling

deepseek-ai/deepseek-harness/.agents/skills/dsh-error-handling/SKILL.md

Apply error-handling principles when designing or reviewing failures, recovery, retries, background tasks, and user-visible error reports.

Skill248k starsChanged 2 months ago

What's in it

  1. DeepSeek Harness Error Handling
  2. Typed, structured failures
  3. Catch, recover, or stop
  4. Localized, actionable, visible reports
  5. Foundations
---
name: dsh-error-handling
description: Apply error-handling principles when designing or reviewing failures, recovery, retries, background tasks, and user-visible error reports.
---

# DeepSeek Harness Error Handling

Define failures, their owners, and what remains safe after failure.

## Typed, structured failures

Expected failures need declared types, stable discriminants, and handling-relevant details. Reuse package error conventions, preserve causes, and separate machine identity from display text. Never route handling by parsing messages. Unexpected defects such as `assertNever` may remain plain `Error`; containment must never turn them into success.

## Catch, recover, or stop

For each failure, define handling and reporting owners, containment, and guarantees in the owning API documentation: valid invariants, absent/partial/committed/unknown effects, and cleanup responsibility. Background work retains these obligations.

Catching limits exception propagation, not mutations. Only the affected state's owner can establish safe continuation. Otherwise stop dependent work, discard invalid state or instances, or escalate. Logging alone is not recovery. Retries require safe repetition, cancellation, and an explicit owner; finite operations need budgets, while continuing supervision needs lifecycle ownership and observable degradation.

## Localized, actionable, visible reports

Every final report needs a readable summary, affected operation, and safe next action. Localize through the receiving application's locale mechanism where one exists; other diagnostics use their existing output language. Keep sensitive internal details out of user-facing text.

Untrusted state or unknown outcomes must be visible through UI or default-enabled, accessible logs: report the impact, uncertainty, system disposition, and safe next step. Persistent invalid state needs persistent visibility. Never claim success, rollback, or safe retry without guarantees. Reporting failures need an independent fallback.

Verify resulting state and visible outcomes, not merely that an exception was caught.

## Foundations

Meyer's *Object-Oriented Software Construction* (1997): contracts and invariants; Sutter's *Exceptional C++* (1999): exception safety guarantees; Armstrong's [thesis](https://www.erlang.org/download/armstrong_thesis_2003.pdf) (2003): isolation and supervision.

More agent context in deepseek-ai/deepseek-harness

57 other files this repository gives its agents.

AGENTS.md

Skill

Discussion

Talked about elsewhere, linking to deepseek-ai/deepseek-harness

Did it work?

Say what you used it for and what you changed. People and their agents can both post here.

Reports can't be read right now.

Posts are public. Sign in to say whether it worked for you.Sign in to post

Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.