yixiuzhemu/dsh-redis-plugin ↗★ 0

dsh-redis-plugin

DeepSeek Harness (dsh) Redis plugin: connection, codec, thread-pool governance, query operations, distributed lock with watchdog, and model-visible tools. 适合需要在 DSH 中集成 Redis 缓存、队列、分布式锁或提供模型工具的开发者。

パッケージ
dsh-redis-plugin
互換性
未検証
Harness ピア範囲
*
Cordis ピア範囲
*
バージョン
0.1.0
最終更新
2026/09/23

インストール

検証済み bundle がないか、互換性チェックに失敗しています。先にリポジトリの説明を読んでください。 README 全文を読む ↗

ドキュメント

README 全文を読む ↗

Configuration

Config is declared in the plugin's cordis.patch.yml line (or passed to apply). Every field is optional — a bare - name: dsh-redis-plugin works with the defaults below. The shipped cordis.patch.yml reads the connection from REDIS_* environment variables (see Multi-environment) so no host/port/secret is hardcoded.

- id: redis
  name: dsh-redis-plugin
  config:
    connection:
      topology: standalone            # standalone | sentinel | cluster (only standalone implemented)
      # url wins over host/port/db/password when present:
      url: !!js "process.env.REDIS_URL || undefined"
      host: !!js "process.env.REDIS_HOST || '127.0.0.1'"
      port: !!js "Number(process.env.REDIS_PORT || 6379)"
      password: !!js "process.env.REDIS_PASSWORD || undefined"
      db: !!js "Number(process.env.REDIS_DB || 0)"
    pool:
      min: 2
      max: 16
      idleTimeoutMs: 30000
      healthCheckMs: 15000            # 0 disables the PING health check
    executor:
      coreSize: 8
      maxSize: 32
      queueCapacity: 1024
      keepAliveMs: 60000
      timeoutMs: 3000                 # per-command timeout
      rejectPolicy: abort             # abort | discardOldest | callerRuns
      retry:
        maxAttempts: 3                # idempotent commands only
        backoffMs: 200
    codec:
      keyPrefix: ''                   # optional namespace prefix for all keys
      value: json                     # json | string | raw
      typeHint: false                 # embed @type for Date/Map/Set/Buffer round-trips
      offloadThresholdBytes: 1048576
    lock:
      defaultTtlMs: 30000
      watchdogIntervalMs: 1000
      renewAheadMs: 10000             # renew when < this much TTL remains
      releaseOnDispose: false         # true = actively release locks on shutdown
    tools:
      enabled: true                   # register model-visible tools
      allowDestructive: false         # gate redis_del behind pre-execute permission

Multi-environment (dev / test / uat / prod)

The connection is environment-driven: cordis.patch.yml resolves each field from a REDIS_* env var (via the loader's !!js tag), so you switch stages by injecting different values — never by editing code. Copy .env.example to .env (git-ignored) or set the vars in your deployment pipeline.

VariablePurposeDefault
REDIS_ENVStage label (dev/test/uat/prod); logged at startup, unknown values warn. Does not itself change the address.default
REDIS_URLFull connection URL. If set, wins over host/port/db/password.(unset)
REDIS_HOST / REDIS_PORTDiscrete address.127.0.0.1 / 6379
REDIS_PASSWORD / REDIS_DBAuth + logical DB.(none) / 0
REDIS_KEY_PREFIXOptional key namespace — recommended when stages share one Redis so keys never collide.(none)

Precedence: REDIS_URL → REDIS_HOST/PORT/PASSWORD/DB → built-in default (127.0.0.1:6379/0). Each stage simply exports its own values, e.g.: