dsh-superagent-prototype: dsh-superagent Treats Your Attention as the Scarce Resource

DeepSeek's open research prototype is not another code generator. It is a governance layer for autonomous work: tickets with mandates, an observe-before-auto rollout mode, and a routing rule that decides which agent owns your next message.

9 min read • View on GitHub • More from deepseek-ai

A wide black-ink illustration of a letterpress print room at night. An empty operator's chair is pushed back from the press, a small mechanical automaton feeds paper into it, and the press stamps out sheets headed PULL REQUEST. On a side table, a row of sealed envelopes with wax seals sits untouched. Tall shelves of bound volumes line the back wall. The illustration frames the article's thesis: the agent does the visible work while the human's attention is the thing being conserved, and the sealed envelopes stand for the permissions the agent cannot open on its own.
The empty chair is the resource. The sealed envelopes are the mandates the agent cannot open by itself.
Key Takeaways

A one-line comment with three possible owners

Picture a busy GitHub thread. A reviewer drops a short follow-up: "did the retry logic ever land?" In most agent systems, that message is either picked up by a single bot or lost. In dsh-superagent, it has three candidate owners at once.

The worker on the ticket that owns the thread can take it. Or the message can be routed to an LLM assessor because no worker currently owns it. Or it can be dropped entirely, because the person already stopped that ticket and its mandate was withdrawn.

That ambiguity is not a bug to paper over. It is the design problem the repository is built around, and it is solved by a single pure function named followupOwners. A human types one line, and the system has to answer a question that most software never asks: who decides who decides?

The rule that routes a human's follow-up

followupOwners takes a trigger and a set of records and returns the list of tickets that own the message. It reads like a sequence of gates, and each gate can empty the result.

  1. Return empty unless the trigger is human. Bots and CI never enter this path.
  2. Return empty if the trigger was requeued.
  3. Exclude tickets that handed the trigger back, and exclude context-only tickets.
  4. Return empty if an Eval currently holds the trigger.
  5. Keep only tickets that are still live, or that ended by something other than a human and still hold an undelivered input for this trigger.

The subtle case is in that last gate. A ticket can decide while it is live, and it can also decide once a person dropped its Subscription to the Thread, and while it is ended, not by a person, with the Trigger waiting to resume it. The function depends only on a small FollowupRecords interface with three getters, so it can be tested in isolation.

The design elegance is that this answer is never stored. Intake queues a message for the assessor only when this.owners(trigger).length === 0. The routing decision is derived from current state, so the system cannot disagree with itself. There is no flag to fall out of sync.

One human message, five gates, and an owner that is computed rather than stored.

observe is the default, and that is the point

Once you understand the routing rule, the obvious question is who let this thing run. The answer, by default, is nobody.

The system defines an AcceptMode with three values: off, observe, and auto. In observe, the agent assesses candidates and records what it would accept without starting any work. That is a trust ramp. A team that has never run an autonomous agent before can watch its judgment for a week before granting it the authority to act.

A second safety detail sits beside it: a mandate does not widen. An explicit request and an inferred candidate carry different Strength values, and a revalidate hook lets the core re-check a mandate's basis before an ended ticket resumes. A rule tightened after the fact blocks the resumption.

A close-up black-ink illustration of a mechanical hand hovering a few inches above a metal lever, not touching it. Behind the hand, a glass pane catches the lever's shadow, and the shadow shows the lever fully pulled with gears already turned. The real lever is untouched. The image is a literal rendering of observe mode: the agent simulates the action and projects the consequence without performing it.
The shadow shows the lever pulled. The lever is untouched. That is observe mode.

It is also a way of working with an agent: take as little human attention as possible, and give as much value as possible.

DeepSeek Harness Team, Repository authors · deepseek-ai/dsh-superagent-prototype

Nine steps from a GitHub event to a ticket

The routing rule sits on top of an intake pipeline. Intake.receive normalizes timestamps to canonical ISO form, validates that threads are non-empty, and deduplicates by trigger id. Then it filters through scope. Rejections are recorded, not discarded, which keeps an audit trail of everything the agent chose to ignore.

From there it correlates threads, fans out to subscribed tickets, and records inputs with deterministic IDs built from key('input', ticketId, 'trigger', trigger.id). Deterministic IDs make redelivery idempotent: the same event twice produces the same input row once. Finally it queues for Eval only if no owner exists, then wakes each reached ticket.

One rule inside the fan-out deserves attention. Only a person's message on a non-context thread resumes an ended ticket. Bots and CI do not, because the executor re-reads threads when it resumes anyway. A human-stopped ticket receives nothing afterward, because its mandate was withdrawn. The distinction between machine chatter and human intent is enforced at the door.

const followed = !!thread.context?.includes(ticketId)
const resumes = trigger.human && ticket?.ended?.by !== 'human' && !followed
if (!ticket || (!liveTicket(ticket) && !resumes)) continue

Permission that cannot quietly expand

The authorization model reads less like a feature and more like a set of contracts. Policy.gate decides admission. Policy.admitsInferred separates explicit work from inferred work. A human-stopped ticket receives nothing afterward because its mandate was withdrawn, and the withdrawal is not reversible by the agent itself.

The trust boundary is stated plainly in the ports file. The assessor receives bounded facts, never authority. The LLM can read every ticket on the thread, including ended ones, so it can judge duplicates. It cannot grant itself permission. Results return through Engine.decide, so the assessor is asynchronous and decoupled from the transaction that produced the question.

How it survives a restart without doing the work twice

Pushing a branch, commenting, and opening a pull request are not transactional. No amount of clever bookkeeping makes them exactly-once. The design gives up on that and does something more honest instead.

On host restart, the system checks two things: was the last worker report in a terminal-ish state, and was anything delivered after it. If the session is not settled, the ticket restarts with a fixed recovery note that is really an idempotency instruction to the model.

Inspect the current worktree, git history and GitHub state before continuing. Do not repeat an already completed external operation.

That is the whole trick. Rather than trusting a ledger, the agent re-inspects the world. It is a small, unglamorous choice, and it is the kind of thing that only shows up once you have watched an agent run for a month.

What it does that the other agents do not

Every row below is scored on how work arrives, who authorizes it, and where the result goes. Capability is deliberately excluded, because it is not the axis this project competes on.

ProjectHow work arrivesInteraction modelAuthorizationScope
dsh-superagentGitHub events, optional Feishu. A person asks, or a team rule permits.Always-running service. Replies in the originating conversation.Explicit ticket plus mandate. off / observe / auto. Mandates do not widen.One repository.
SWE-agentA GitHub issue, run by a human.Batch run against a benchmark or issue.None. The operator invokes it.Any repo it is pointed at.
OpenHandsOperator starts a session.Interactive agent platform, self-hosted or hosted.Operator-driven.General software tasks.
AiderDeveloper opens a terminal in a local repo.Interactive pair programming.Developer in the loop, always.Local working copy.
AutoCodeRoverA GitHub issue, run by a researcher.Research run for issue resolution.None. Invoked by the operator.Any repo it is pointed at.
GitHub Copilot coding agentAssigned issues, inside GitHub.Hosted, GitHub-native.Managed by GitHub's permission model.The repo it is installed on.

The closest overlap in outcome is the Copilot coding agent: both turn an issue into a pull request. The closest overlap in design intent is none of them. None of the others ships an observe mode, and none of them lets a mandate be revalidated after a ticket has already ended.

A research prototype, and the README says so first

The repository closes on honesty, and it starts with it too. The README states the code grew out of the team's day-to-day development work, with much of the engineering done by coding agents, and that it has been adapted for publication. The published version differs from the internal one.

Research prototype for reference only, not an official DeepSeek product.

DeepSeek Harness Team, Repository authors · deepseek-ai/dsh-superagent-prototype

The operational reality is worth stating plainly. Worker and coordinator sessions run with broad OS-user permissions. A dedicated system account, a separate GitHub identity, and a restricted authorized-user list are prudent before anyone points this at a live repository. The README also warns that the prototype may contain bugs and inconsistent practices. Read it as a design document with a working skeleton attached, not as a product you install and forget.