LeemanCheung/dsh-agent-arena 预览 preview

LeemanCheung/dsh-agent-arena

隔离的多模型编码匹配,附带确定性验证、评分与报告。

项目介绍Project Overview

dsh-agent-arena 是一个 DSH 编码竞技插件,可在隔离的 Git worktree 中并行比较 2 至 4 个配置模型,运行用户提供的验证命令并按通过权重百分比打分,平局按 ID 决出,支持差异审查与显式应用胜者改动。适用于需要在多个模型间客观对比同一编码任务并人工裁决的场景。注意:取消依赖提供商响应中止信号,含空格的验证参数会被拒绝,补丁超 1MB 将被拒收。

dsh-agent-arena is a DSH plugin that runs 2–4 configured models in parallel inside isolated Git worktrees, executes a user-supplied validation command, scores contestants by percentage of total positive weight passed (with id as deterministic tie-break), and lets the user diff and explicitly apply the winner. Use it to compare models objectively on one coding task. Caveats: cancellation depends on the provider honoring the abort signal, validation argv with whitespace is rejected, and patches over 1 MB are refused.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

dsh plugin --profile web add github:LeemanCheung/dsh-agent-arena

LeemanCheung/dsh-agent-arena 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-agent-arena

English | 中文

A DSH coding arena for comparing 2–4 configured models in isolated Git worktrees, validating their changes deterministically, reviewing every diff, and explicitly applying one winner.

Screenshot

Agent Arena results and diff review

Generated with GPT Image from the implemented Client layout and feature set; runtime appearance follows the active DSH theme and viewport.

Execution and persistence

  • Creates detached worktrees under the operating system temporary directory, outside the compared repository.
  • Starts each contestant with the public ctx.agents.create, SessionId, createUserMessage, and Agent.followup APIs.
  • Executes Git and validation argv through ctx.subprocess.spawn; a shell is never used and shell operators are rejected.
  • Persists match reports through storageDomain. An interrupted nonterminal match is marked failed after Host restart.
  • Polls the generated agentArena Remote namespace in Settings and supports Start, Cancel, diff review, and Apply winner without browser globals.

Scoring and application

Each validation has a positive weight. A contestant score is the percentage of total validation weight that exits successfully; score ties use contestant id as a stable deterministic tie-breaker. No LLM judge is used.

A match requires clean git status --porcelain=v1 before worktrees are created. The winner worktree remains available until explicit application. Apply repeats the cleanliness check, verifies that HEAD still equals the recorded base revision, runs git apply --check, then git apply --index --whitespace=error. Arena never auto-applies, commits, pushes, or rewrites history.

Validation command syntax

The Settings field accepts conservative whitespace-separated argv such as corepack pnpm test or git status --porcelain=v1. Quotes, shell variables, pipes, redirections, command separators, backticks, and newlines are rejected. Configure commands whose arguments do not require shell quoting.

Install

dsh plugin --profile web add github:LeemanCheung/dsh-agent-arena

Restart the existing DSH Web process and refresh its page. The selected profile must provide agents, subprocess, storageDomain, Typert Remotes, Settings, and at least two usable provider/model routes..

Model Experience

Every contestant receives the user-entered Arena objective as one user message in its own session and worktree. Token and KV-cache usage therefore scales with 2–4 independent contestant sessions. Validation, scoring, comparison, cancellation, persistence, and application do not call another model.

Known limitations

Validation argv uses a deliberately conservative tokenizer and cannot represent arguments containing whitespace. Cancellation depends on the selected provider honoring the supplied abort signal. The Host captures binary-capable git diff HEAD, so staged, unstaged, and intent-to-add files are reviewed and applied consistently. Patches over the 1 MB review/apply bound are rejected before mutation rather than truncated.

Development

From the repository root run corepack pnpm typecheck, corepack pnpm test, corepack pnpm build, and corepack pnpm pack:check.

MIT. See LICENSE.

上一个 Prev dsh-agent-preset-recommender 下一个 Next dsh-notify-win