Introduction

DeepSeek Harness (DSH) integrates external capabilities into agent workflows through its plugin system. When processing error monitoring data, raw Sentry API responses are often very large (a single event can reach 2MB). Passing them directly to an LLM can cause context overflow or loss of critical information. The dsh-sentry plugin aims to solve this problem by connecting to the Sentry Web API in read-only mode and structurally pruning the data before it is returned, ensuring that the agent context receives sufficient debugging information without exceeding token limits.

Plugin Overview

maxmilian/dsh-sentry is an open-source DeepSeek Harness plugin focused on retrieving issue and event data from Sentry. Its core responsibility is not acting as an API proxy, but “pruning” the response body so it fits within the agent’s context window.

  • License: MIT
  • Maintainer: maxmilian
  • Core value: Provides a concise error-data view without modifying Sentry state.

Core Features

The plugin provides the following read-only tools:

  1. sentry_list_projects: Lists up to 100 projects under the configured organization.
  2. sentry_search_issues: Searches for issues using Sentry search syntax, supporting a single project or the entire organization scope.
  3. sentry_get_issue: Retrieves details for a single issue by numeric ID or short ID (excluding event bodies).
  4. sentry_get_latest_event: Retrieves the latest event for an issue, including pruned stack traces.
  5. sentry_get_event: Retrieves a single event by event ID under a specified project, also with pruning applied.

Environment and Dependencies

The plugin requires the following environment:

  • Node.js: 22.19 or higher (22.x line), or 24 or higher.
  • Bun: 1.3.5 or higher (for installing from source or local development).
  • DSH compatibility: Requires a Harness environment compatible with the @deepseek-ai/dsh-tools API.

Authentication Configuration

Using this plugin requires an authentication token from Sentry. The plugin does not support Organization Tokens (sntrys_); it must use a User Auth Token (sntryu_), because Organization Tokens have scopes locked to org:ci and cannot provide read permissions.

Required token scopes:
* org:read: For listing projects and issues.
* project:read: For retrieving issues within a project.
* event:read: For reading event details.

Environment Variables and Configuration

The plugin supports configuration through environment variables or a configuration file. Values in the configuration file take precedence over environment variables.

Configuration Item Environment Variable Default Value Description
baseUrl SENTRY_URL https://sentry.io/ Root address of the Sentry instance. For the EU region, use https://de.sentry.io/. A trailing /api/0 is removed automatically.
token SENTRY_AUTH_TOKEN Required User Auth Token (sntryu_). It is never returned or written to logs.
org SENTRY_ORG Required Organization identifier (slug), fixed for the plugin instance.
locale — en Language for tool descriptions (en, zh-TW, zh-CN, ja). Tool names remain in English.
includeFrameVars SENTRY_INCLUDE_FRAME_VARS false Whether to preserve local variables in stack frames. Enabled only by the string true.
requestTimeoutMs — 30000 Total timeout for a single tool call, including the additional request for short IDs. Range: 1–300000.
maxResponseBytes — 5242880 (5MB) Hard limit for a single HTTP response body. Range: 1–52428800.

Data Pruning Strategy

To control context size, the plugin applies strict cleaning and compression to Sentry responses.

Unconditionally removed:
* Request headers, Cookies, environment variables, and request bodies.
* Stack frame local variables (unless includeFrameVars is true).
* mechanism.data, contexts.state, packages, modules, and _meta.
* User-sensitive information: user.email, user.ip_address, and user.username; only user.id is retained.
* Tags that show secret or PII characteristics (such as token, secret, password, api_key, cookie, session, etc.).
* Frame fields that leak build paths (such as absPath).

Conditionally retained and reduced:
* Frames: Keeps up to max_frames. In-app frames are preferred, the two innermost frames are always included, and the remaining capacity is filled from the end.
* Source code context: Retains only the innermost three in-app frames, with a maximum of 11 lines per frame and 200 characters per line.
* Breadcrumbs: Keeps the last 20 entries, with messages limited to 200 characters.
* Strings: Exception values are limited to 2000 characters; titles, messages, and culprits are limited to 500 characters.

If the trimmed result still exceeds the 200KB budget, the plugin degrades in the following order: remove source context → remove breadcrumbs → remove frames (keeping a minimum of 10). The degradation state is recorded in meta.trimmed.degraded.

Limitations

  1. Read-only operations: The plugin exposes HTTP GET endpoints only. It will not resolve, assign, archive, merge, or delete issues, nor create releases.
  2. Single-organization limit: Each plugin instance can be bound to only one Sentry organization; the tools do not support dynamic organization switching.
  3. API limitations: Seer AI, performance monitoring, Discover, metrics, dashboards, replays, Traces, and Span endpoints are not currently supported.

Summary

maxmilian/dsh-sentry is a lightweight Sentry data integration tool designed for the DeepSeek Harness ecosystem. Through strict permission control (read-only access and User Tokens) and a data pruning strategy, it addresses context overflow caused by large error logs, making it suitable for scenarios that require error troubleshooting capabilities within agents.

  • GitHub repository: https://github.com/maxmilian/dsh-sentry
  • Directory page: https://www.skillhub.cn/plugins/maxmilian/dsh-sentry