DEV Community

qiyanjie(齐彦杰)
qiyanjie(齐彦杰)

Posted on

The hard part of coding with agents isn't the code — it's trusting "done"

I use coding agents every day, and the exhausting part was never the code.

It was the waiting. One thing at a time: I ask, it works, I wait, it finishes, I ask again. Long sessions rot — the agent forgets what it decided an hour ago. And the worst part: it says "done", and I still have to read every diff, because I have no idea whether it quietly loosened a failing test to get green.

So I wrote a plugin for DeepSeek Harness called dsh-task-suite. The idea is small: turn the backlog into files, let the main agent only dispatch and accept, and give the actual coding to a background subagent that starts with a fresh context every time.

Tasks are files
The queue lives in the repo:

Code block

.dsh/tasks/backlog.md waiting
.dsh/tasks/dev-progress.md archived
.dsh/tasks/auto/run.log run log
Each task has an ID, a title, a module, a priority, dependencies, and acceptance criteria. No database, no daemon. It reviews in git, and when something is wrong you edit the Markdown.

The main session stops writing code. Its loop is: pick a task → pack a briefing → dispatch to a background subagent → wait for the report → run machine acceptance → only then move it to "to verify".

Four gates between "the agent says so" and "done"
This is the only part that matters.

  1. A one-time nonce. Generated at dispatch, written into the briefing; the worker's report must carry the same one. Forged, reused, or copied from a previous turn — rejected.

  2. Commit ownership. In a git task, the commit message must contain the task ID; in a plain folder, the plugin diffs the claim-time snapshot against the working tree. Unattributed changes are not a delivery.

  3. Baseline re-run. When the worker says "those two tests were already failing", that doesn't count. Acceptance checks out the commit the task started from and runs the suite there: only failures that also fail at the baseline are pre-existing. Anything new is a rejection.

  4. Weakened-test audit. Deleted assertions, added skip, widened expect, or quietly running a single file instead of the suite — all get flagged. Green tests are not proof if the tests were softened.

Only when all four pass does the task become "to verify". Not "done": a human still clicks confirm. Passing the gates means "worth your five minutes", not "shipped".

A real rejection
I asked for dashboard screenshots. The worker was fast and the report looked great. Acceptance failed anyway: it had modified a file that was already dirty when the task started.

It didn't write bad code. It crossed a boundary — pre-existing uncommitted changes are baseline noise, and whoever touches them has to say so explicitly. The gate doesn't read the report; it diffs the claim-time snapshot against the working tree.

Humans rarely catch that. The check catches it in a second.

What a night looks like
Before closing the laptop I drop three tasks into the pool. The main agent dispatches them one at a time; if a worker stalls past a threshold, a watchdog marks it stalled and records that in the run log; every finished task emits one notification — to verify, or rejected.

In the morning I read two lists: to verify (the machine thinks it is fine, I confirm) and needs a decision (it could not judge, I decide). Nothing else.

That is what "letting go" means here: not trusting the model, but trusting four gates to stop it.

What it does not do
No parallelism. One worker at a time, serial. Parallel sounds great until acceptance cost explodes.
The dashboard is read-only. Edit the Markdown, or ask the main agent.
One full restart after install. The panel depends on dsh-better-sidebar, and the client plugin graph is composed at process start — a page refresh won't load it.
Git is optional but weaker. Without a repo it falls back to folder snapshots.
Status
1.2.1, MIT
The plugin's own development ran on this pipeline: 19 tasks archived, 0 rejections
Just released, 1 star, no users to brag about
Listed in the DSH Go market and on awesome-dsh-plugin
sh

dsh plugin --profile desktop add dsh-task-suite

use --profile web for the Web build

Repo: https://github.com/qiqll/dsh-task-suite Landing: https://qiqll.github.io/dsh-task-suite/

One question
If your agent only put results in a "to verify" list from tomorrow, what would you hand it first — missing tests, docs, or that old module you keep avoiding?

Feedback via issues, please: the templates ask for the DSH version and the plugin version, which is usually enough to reproduce.

Top comments (14)

Collapse
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

The weakened-test audit is the gate most agent harnesses skip, and it's the one that matters — a green suite means nothing if the worker quietly loosened the assertions to get there. And the framing is exactly right: passing the gates means worth your five minutes, not shipped. My pushback is on serial-only dispatch: with one worker at a time, does the acceptance cost stay cheap enough overnight, or do watchdog stalls end up eating the morning review window?

Collapse
 
qiqll profile image
qiyanjie(齐彦杰) •

Fair pushback — two separate costs here, and one of them is a real weak spot.

Acceptance cost itself is cheap on the happy path. The baseline worktree only spins up when a test run fails and we need to tell pre-existing failures from new ones. When the suite exits 0, acceptance is just one test run plus a git diff weakening check.

Stalls can eat the window — honestly, yes. Right now the watchdog flags IDLE at 30 min (no output growth) and SPIN at 60 min (output growing, repo untouched), with a 3-hour hard stale cap; a task that fails twice is parked as blocked so the loop moves on, and 3 no-progress runs stop the loop. The catch on DeepSeek Harness is that the watchdog is advisory-only and runs on a scheduled heartbeat tick — the plugin can't interrupt a subagent on its own. So a hung worker can realistically burn 1–3 hours of an 8-hour overnight budget before getting killed.

The reason I still keep it serial is mostly the human bottleneck: one shared worktree avoids merge conflicts between workers, and 3–5 clean tasks in the morning is about what I can actually review well anyway. Parallelism makes sense once you move to isolated worktrees per worker, which is a bigger step up in complexity.

Collapse
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

The human bottleneck point wins the argument — 3–5 tasks you can actually review well beats ten you skim, and the shared worktree keeping merges out of the picture is a real constraint, not a preference. The advisory-only watchdog is the part I'd still worry about, though: 1–3 hours of an 8-hour budget burned by a hung worker is a steep tax for a plugin that can flag but not kill. Is the fix giving the watchdog interrupt authority, or does that just move the risk to killing a worker that was about to finish?

Thread Thread
 
qiqll profile image
qiyanjie(齐彦杰) •

Both, but not by handing the plugin the knife.

On DeepSeek Harness the plugin genuinely can't interrupt a subagent — the host owns agent lifecycle, and a plugin that can kill another agent is a much bigger security surface than one that flags. So what I did instead is make the policy explicit and configurable: taskStaleMinutes (hard cap per task, default 180) and watchdogAutoStopMin (default 0 = advise only). When a worker has been stuck past the auto-stop threshold, the watchdog stops saying "maybe nudge it" and says "stop it now", with the exact steps. The kill still happens in the dispatcher session, which is a human-owned session — so there's always a pair of eyes on the decision, and a one-line config change if you want it stricter.

On your second question — yes, interrupt authority just moves the risk. The cheap guard isn't a longer grace timer; it's requiring evidence of work. A worker about to finish has usually either committed something or changed a file, and SPIN exists precisely to catch the case where output is flowing but the repo hasn't moved. The genuinely hard false positive is a long legitimate test run with no output and no tree change, which is why the flow is nudge first, re-check, and only then stop — and why killing is cheap here: halt keeps the commits and records the breakpoint, and the task goes back to the queue with the failure reason attached. Worst case you lost one dispatch slot, not the work.

Thread Thread
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

Not handing the plugin the knife is the right call — a plugin that can kill another agent is a bigger surface than one that flags. Evidence of work as the cheap guard is the key insight, and halt keeping the commits makes the false positive cheap instead of catastrophic. Is the re-check interval in the nudge-first flow configurable, or is there a fixed cadence before it escalates to stop?

Collapse
 
amintacccp profile image
tamina •

Gate 4 first, always — it's the only gate that catches an agent gaming its own scoreboard. Two things from our side: we run a second-agent pass over the real diff before anything lands in the human's "to verify" list, and the human confirms the diff itself, never the agent's summary. A confident summary with a zero-tool-call "verified diff" is the most dangerous output an agent produces. And on the criteria-pinning gap userxnom raised: hashing the acceptance criteria at dispatch and comparing the hash at acceptance would close it for almost no cost — right now the worker can narrow the criteria by interpretation without touching a file.

Collapse
 
userxnom profile image
Abdullah Naseer •

The four gates are the post, qiyanjie — and gate 4 is the one that matters most. A worker that quietly deletes an assertion or widens an expect to get green is exactly the failure nobody catches by reading diffs, because the diff looks like a reasonable change. Your baseline re-run and weakened-test audit are the two checks that make "done" mean something instead of "the agent says so."

The gap I would probe is the one your gates assume away: the acceptance criteria themselves. They live in the task file, and the worker's report must carry the nonce and the commit must carry the task ID — but what stops a worker from quietly narrowing the acceptance criteria in the task file so the gates pass against an easier bar? If the criteria are not frozen at dispatch — hashed into the briefing alongside the nonce — the four gates check the work against a target the worker can move. Is that frozen, or is it on your list?

To your question: I would hand it the smallest task with the clearest acceptance check first — a bug with a reproducer — because the gates are only as strong as the criteria, and a small task is where a moved goalpost is easiest to spot.

Collapse
 
qiqll profile image
qiyanjie(齐彦杰) •

Good catch — that's a real gap, and the sharpest one anyone has raised.

Straight answer: partially frozen, not hashed.

What's enforced today: the acceptance text is copied into the worker's prompt at dispatch, so the worker works from a fixed copy; and the pool directory is protected in git repos — a commit touching .dsh/tasks/ hard-fails acceptance, an uncommitted edit to it raises a needs-decision row.

What isn't: nothing pins the criteria at acceptance time. The ACCEPTANCE: …(来源:backlog) field is the worker's own claim, and the note is re-read live. In a non-git folder it's worse — the snapshot diff skips the pool directory entirely, so an edit there isn't detected at all.

So your framing is right: the gates validate against a target that is currently guarded, not pinned. Your fix is the one I would do — hash the acceptance clause into current.json at dispatch and compare at acceptance; a mismatch becomes needs-decision. The same hash also covers the non-git case, where the git guard doesn't exist.

One caveat on the other half: a worker can narrow the criteria by interpretation without touching any file, and no hash catches that. The mitigation is making criteria machine-checkable — a command, not prose — which is already required for unattended close.

And I agree with your answer: smallest task with a reproducer is exactly where I'd start.

(1.2.2 shipped today; this isn't in it.)

Collapse
 
humanonmute401 profile image
Human On Mute 401 •

0 rejections across 19 tasks makes me wonder about the morning click. Have you ever bounced one at "to verify" that passed all four gates? If not, how would you know the human step's still doing anything?

Collapse
 
mateo_ruiz_6992b1fce47843 profile image
Mateo Ruiz •

The distinction between “to verify” and “done” is important. I’d add one more check to this pipeline: verify that the acceptance criteria themselves haven't drifted. A worker can preserve every existing test and still deliver something that technically passes while missing the original intent.

For longer-running agent workflows, I’d also keep the task’s starting commit, acceptance criteria, test results, and final diff tied together as one auditable record. That makes a rejection reproducible and helps distinguish a genuine implementation failure from a problem in the verification process. The goal shouldn't be to eliminate human review, but to make every review focused on decisions the machine cannot reliably make.

Collapse
 
_komachi-jp profile image
Komachi | AI on a Budget •

Gate 4 stayed with me — weakening a test on purpose to see whether it actually catches the failure is the check I had not thought to do. My setup is simpler than yours: Claude Code builds the work, and ChatGPT gives a second look at only the finished work, so nothing re-solves the task from scratch for me. That second look is good at spotting sloppy wording and missed edge cases, but it cannot prove a test would fail when it should. Your missing-test detector is the missing piece for me, because a passing suite I never challenged is the one I trust least. I would like to add a small version of that weakened-test check to my own routine — did you start with the smallest gate first, or did the full four-gate loop only make sense once all of them were in place?

Collapse
 
qiqll profile image
qiyanjie(齐彦杰) •

Start with gate 4 alone. The other three answer "is this actually the change I asked for"; gate 4 answers "does this change lie to me", and it's the only one that works on a single diff with no extra infrastructure.

A minimal version is three checks over git diff -U0 base..head restricted to test paths:

  1. Removed test names — collect names on the - side (def test_…, it("…"), describe("…")) and on the + side; anything that disappeared is a deleted case.
  2. New skip markers — any + line containing skip / xfail / .only / xit / @Ignore.
  3. Assertion delta — count lines matching assert / expect( / assertX( on each side; a net decrease with no explanation is worth reading.

That's maybe 30 lines of shell, and it catches the boring 90%: the deliberately deleted assertion, the case quietly marked skipped, the expect widened to toBeTruthy(). It does NOT catch assertions loosened in place or a test special-cased to the new output — for that you need either a reviewer or a mutation check.

Since your second look comes from another model, the highest-value addition for you is probably the mutation version of the same idea: take one assertion in the changed test, invert or delete it, run the suite, and confirm it goes red. If it still passes, the test was hollow. A full mutation runner (Stryker, mutmut) automates this; even doing it by hand on the one test you're least sure about already beats a suite nobody challenged.

Order I'd do it in: gate 4 → nonce/report binding → commit ownership → baseline re-run. The last one is the expensive one; it needs a clean checkout of the starting commit and only earns its keep once the cheap gates are passing.

Collapse
 
himanshu_dhakar_65fcb1284 profile image
himanshu dhakar •

One more gate we had to add after all of these passed: check where the change is used, not where it was made. We had a case where the agent wrote the fix, the file had it, the tests passed, and the screen a person looks at still showed the old value, because the thing reading that file was pinned to an older version. Every gate in the list was green.

Your nonce gate also matches something we saw: our chat agent once reported it had "staged a verified diff that compiles" while making zero tool calls. A report has to carry proof from the system that changed (a commit, a PR number), or it isn't a report. How do you handle a task where the real check is in another repo or a deployed service?

Collapse
 
qiqll profile image
qiyanjie(齐彦杰) •

"Check where the change is used, not where it was made" is a great way to put it — and honestly, that's the exact boundary our four gates don't cross.

dsh-task-suite is single-workspace by design: it never runs git push, never deploys, and doesn't span repos. Even if you point TEST_CMD at a smoke script that hits a staging service or another repo, the baseline re-run breaks down there — you can check out START_SHA in a temp worktree for local code, but you can't roll back a live service or a pinned consumer to compare against.

So for tasks whose real proof lives outside the repo, we don't try to fake a machine gate:

  1. Block unattended close. Tag the task so it never auto-accepts or times out to "done" — it stays in "to verify" until a human confirms it.
  2. Put the consumer check in VERIFY. Every delivered task carries a 1–3 step verification command or URL (e.g., hitting the staging endpoint or checking the consumer) right on its review card, so the human checks where it's actually consumed after deploy/bump.
  3. Split the consumer bump. If another repo is pinned to an older version (I literally just hit this myself today with a plugin marketplace still pinned to 1.2.0 after 1.2.2 went live on npm), the fix and the consumer version bump are two separate steps — green in repo A only proves repo A is ready to publish.

And that zero-tool-call "verified diff" story is painfully familiar — that's exactly why we require both the dispatch nonce and actual commits in START_SHA..HEAD rather than trusting the summary text.