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 (31)

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?

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

Partly. The thresholds are config: idle (30 min), spin (60 min), and the auto-stop window. The re-check cadence is whatever heartbeat the dispatcher schedules — I run it every 20 minutes. The one fixed number is the step from "nudge" to "suggest stop": it's 40 minutes past the idle threshold, hard-coded. That should be a setting, and it will be in the next release.

Thread Thread
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

That's a clean answer — and the 40-minute hard-coded step is the right thing to make configurable, since the cost of a wrong nudge-to-stop call is an interrupted worker versus a stalled one. Does the next release let the dispatcher learn that window from past runs, or is it just a knob for now?

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
 
qiqll profile image
qiyanjie(齐彦杰) •

Agree on both. The worker's exit gate already requires a fresh-context review subagent on the real START_SHA..HEAD diff before it can report; if it can't spawn one, it returns GATE_PENDING_REVIEW and the dispatcher reviews instead. And the review card shows the commits and a runnable "how to verify", so the morning check is against the diff, not the summary.

Criteria pinning is done: title, acceptance criteria, priority and the auto-accept flag are hashed at dispatch and compared at acceptance, with the trusted copy kept out of the worker's reach. Shipping in the next release. You're right that it doesn't stop narrowing-by-interpretation — that part only gets better by making the criteria a command.

Collapse
 
amintacccp profile image
tamina •

Thanks both — this thread is exactly the kind of detail I hoped the post would surface. @tamina, the zero-tool-call "verified diff" line is a great way to put it, and the second-agent pass over the real diff is the part I'd trust most. @qiyanjie, the GATE_PENDING_REVIEW fallback and keeping the trusted criteria hash out of the worker's reach are the two details that make the pinning actually hold up — and "make the criteria a command" is a sharper framing than anything I wrote in the post. Appreciate you both adding this.

Collapse
 
mohakbajaj profile image
Mohak Bajaj •

Backlog as Markdown files is the part I'd keep even without the gates. My notes app is also just a folder of .md, no database, and the one bug that bit me was two writers (the app and the MCP server) grabbing the same id. An atomic create_dir to claim it plus temp-file rename on every write fixed it. If the main agent and a worker can ever touch backlog.md in the same window, worth adding the rename part.

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
 
qiqll profile image
qiyanjie(齐彦杰) •

Good question, and honestly a slightly uncomfortable one.

No, I haven't. All 19 went through "to verify" and I confirmed every one of them myself. None were auto-closed, and none got bounced after passing all four gates. The rejections that did happen all came earlier, from the gates themselves.

So you're right that "0 rejections" doesn't prove much. These were the plugin's own tasks. I wrote the tasks, I wrote the acceptance criteria, and they were mostly small. That's about the easiest setup you can have. The number fits "the gates are good" and it also fits "the morning click is a rubber stamp", and I can't tell you which one it is from my own data.

What I think the human step is for is the stuff the gates can't see: the change works but isn't what I meant, or the real proof lives outside the repo. I believe that's real, but I haven't caught it happening yet, so I'm not going to claim it.

The honest test would be someone else writing the criteria on a real project, or me slipping in a delivery I know is wrong and seeing whether I notice. I haven't done either. Thanks for pushing on this, I'm going to stop leading with that stat.

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
 
qiqll profile image
qiyanjie(齐彦杰) •

Mostly there. Each run logs the starting commit and a hash of the criteria at claim, the dispatch nonce, the outcome line, and the commits; task_show <id> timeline=true stitches that with the archive record. The gap is test evidence: only the verdict (PASS / PASS_PREEXISTING / FAIL_NEW) is kept, not the output. That's the piece I'd add so a rejection is reproducible — your framing of "is this an implementation failure or a verification failure" is exactly why.

Collapse
 
paullovelace profile image
Paul Lovelace •

To your closing question: missing tests, every time — a failing test is the one acceptance criterion a worker can't reinterpret its way out of. Docs are prose and the old module is a swamp; a test either goes red or it doesn't. Though after userxnom's criteria-drift point above, I'd add one condition: the test file itself has to be hashed at dispatch too, or the worker just writes a test that passes by construction and all four gates applaud it. The dirty-worktree rejection is the one that sold me, by the way — I've trusted a screenshot report exactly once too often.

Collapse
 
qiqll profile image
qiyanjie(齐彦杰) •

That's the hole. Modifying an existing test is caught by the weakening audit, but a brand-new test that passes by construction sails through every gate. Hashing helps for tests that exist at dispatch; for new ones the real check is red-first: run the new test against the starting commit and require it to fail. If it's green before the fix, it's not testing the fix. Not enforced today — it's next on the list.

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.

Collapse
 
smtahosin profile image
S M Tahosin •

Hey qiyanjie! 9 files changed, 2 commits, 1 summary nobody asked for... I've accepted 'already failing' at 1am before lol. flaky tests first for mine, morning 'to verify' list and all xD :)

Collapse
 
qiqll profile image
qiyanjie(齐彦杰) •

Ha — "already failing" at 1am is exactly the trap the baseline re-run exists for. Flaky tests are its weak spot though: a test that flips between runs can look new or pre-existing by luck. Pinning flaky ones first is the right order.

Collapse
 
smtahosin profile image
S M Tahosin •

haha yea the flaky flip thing is exactly what bit me... mine passed twice at 1am, failed on the third run, and i just sat there like ok which one of you is lying xD pinning those first is going on my list, thanks for that :)

Collapse
 
sara_builds profile image
Sara •

The dirty-worktree rejection is what sold me on the gates — I would have trusted that screenshot report and missed the already-dirty file. I'd add a dispatch check that refuses to start, or raises a needs-decision, unless the tree is clean or the dirty paths are explicitly excluded from the snapshot. Otherwise leftover local edits become a night of false rejections, which eats the same morning window the gates are meant to protect.

Collapse
 
qiqll profile image
qiyanjie(齐彦杰) •

Today it's softer than that: dirty paths at claim are recorded and become off-limits — the worker only fails if it touches one. Untouched leftovers don't cause rejections. But you're right that the case that does fail is predictable up front, and finding out at 7am is the worst time. A dispatch-time warning (or optional refuse-to-start) is cheap; I'll add it.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.