Introduction

DeepSeek Harness (DSH) uses a plugin-based architecture. When a session frequently triggers 429 TPM rate limiting due to an excessively long context, traditional retry strategies often just resend the oversized context, causing continuous failures and consuming quota. The legacy plugin dsh-auto-continue-429 only supports repeatedly sending continue, so it cannot fundamentally solve the problem.

dsh-migrate-on-429 aims to address this issue. It is a workflow plugin that, when frequent 429 errors are detected, automatically summarizes the current session and migrates the task to a new session to continue. Unlike the legacy plugin, it uses a serial handoff strategy of “cancel the old session first, then start the new session,” ensuring task transfer rather than parallel execution and avoiding wasted quota consumption in the rate-limit pool.

Core Features

This plugin provides the following core capabilities:

  • Intelligent rate-limit detection: Automatically monitors agent/request-error and session/event, and identifies RATE_LIMIT, QUOTA, or CONTEXT_WINDOW_EXCEEDED errors.
  • Pre-threshold retry: Before reaching the migration threshold, automatically sends continue messages to the current session to retry, with backoff delays.
  • Automatic handoff migration: After the threshold is reached, automatically generates a handoff summary, creates a fresh session, injects the task, and stops the old session.
  • Serial handoff: Enforces strict serial logic—abort the old session and wait until it is idle before creating the new session, preventing conflicts caused by parallel execution of old and new sessions.
  • Automatic workspace registration: After the new session is created, automatically registers it to the workspace of the source session via workspace.attachSession, ensuring visibility in the sidebar.
  • Multi-subagent cascading-handoff prevention: Introduces a global coordination mechanism to prevent cascading migrations and 429 loops when a parent agent spawns multiple subagents and all child sessions trigger 429 simultaneously.
  • Dual-side safety: Client-side code contains no Node builtins, and host entrypoints do not import @deepseek-ai, ensuring safe browser-side bundling.

Installation and Activation

Before installing this plugin, you must first remove the legacy plugin dsh-auto-continue-429. Both plugins listen to the same event source, and enabling them simultaneously will cause conflicts.

  1. Uninstall the legacy plugin: Remove dsh-auto-continue-429 from dependencies and dsh.profile.bundles.
  2. Install the new plugin: Run the following command to install the scoped package @minyang2026/dsh-migrate-on-429.
dsh plugin --profile web add @minyang2026/dsh-migrate-on-429

After restarting the DeepSeek Harness application, the plugin takes effect.

Configuration and Usage

The configuration file is located by default at ~/.dsh/migrate-on-429.json. You can also modify the configuration in the “429 Auto Migration” tab on the Web settings page, or specify a custom path via the environment variable DSH_MIGRATE_ON_429_CONFIG.

Main configuration options:

Configuration key Default Description
enabled true Main switch
quickOn true Quick toggle in the dialog
migrateThreshold 3 Trigger migration when consecutive failures reach this number (2-50 recommended)
windowMs 180000 Rolling statistics window for request-level 429 errors (milliseconds)
llmSummary true Attempt to refine the handoff summary using an LLM (automatically fall back to structured extraction on failure)
continueMessage "continue" Message content for automatic retry before the threshold
globalCooldownMs 60000 Global cooldown time after each migration (milliseconds)

Migration can also be triggered manually via the HTTP API:

POST /api/migrate-on-429/migrate-now
# Body optional { "sessionId" }

Important Notes

  1. Ecosystem listing status: This plugin has not yet been submitted for inclusion in the awesome-dsh-plugin.com marketplace, so it cannot be found and installed through the Web interface. Please use the command line to install it.
  2. Dependency requirements: The plugin depends on @deepseek-ai/cordis and @deepseek-ai/dsh-llm.
  3. Plugin mutual exclusion: Do not enable it together with dsh-auto-continue-429. It has been confirmed that the two plugins fight for control when both are active.
  4. Runtime permissions: The plugin runs under DSH process permissions. It is recommended to review the source code and license before installing it.

Summary

dsh-migrate-on-429 is an effective solution to the DeepSeek Harness long-context 429 rate-limiting issue. Through automatic summarization, serial handoff, and multi-subagent protection mechanisms, it ensures that tasks can transition smoothly to a new session when rate limiting is encountered, avoiding ineffective retry loops. For scenarios involving complex, long-conversation tasks, this plugin can significantly improve stability.