Skip to content

feat(board): Stop a running task; confirm before running a needs-human ticket - #230

Merged
hoangsnowy merged 1 commit into
mainfrom
feat/stop-task
Oct 20, 2026
Merged

hoangsnowy merged 1 commit into
mainfrom
feat/stop-task

Conversation

@hoangsnowy

Copy link
Copy Markdown
Owner

Change description

A member started the M1 epic of the first real project (DeltaByteLab/VNChessAcademy#1) by mistake and could only stop it by killing the CLI process by hand.

  • Stop on a running task (Tasks tab): cancels the agent run end to end — Fast engine LLM dispatch, Thorough engine pipeline stream, and on a paired computer the broker now sends Cancel so the runner kills the CLI process tree. A timed-out dispatch is cancelled on the runner too (before, it kept working unseen).
  • TaskStopRegistry: process-wide, keyed by tenant + task, outlives the circuit; a rerun cancels/replaces the older run.
  • Stopped task + unfinished repos read Stopped; Try again restarts.
  • needs-human / epic guard in Work on this: explains why, keeps Start working disabled until Run it anyway.

Type of change

  • New feature
  • Bugfix

Checklist

  • dotnet build Release
  • Unit 1309/1309 (new TaskStopRegistryTests, broker cancel/timeout tests); UI E2E standalone 50, 0 failed
  • No secrets
  • Docs: plan status updated
  • Live Stop on the lab runner — verified after merge (lab runs main)

🤖 Generated with Claude Code

https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB

…n ticket to the AI

A member started the whole M1 epic of the first real project by mistake and had
no way to stop it short of killing the CLI process by hand.

Stop (end to end):
- TaskStopRegistry (Web, singleton): a running task's cancellation keyed by
  tenant + task — it outlives the circuit that started it; a rerun cancels and
  replaces the older run.
- The Tasks table shows Stop on a running row; the token cancels the Fast
  engine's LLM dispatch and the Thorough engine's pipeline stream; the task and
  its unfinished repos read "Stopped", Try again restarts it.
- Broker raises Cancelled when a dispatch is abandoned (caller cancelled or
  timed out); the transport sends "Cancel" to that runner, which kills the CLI
  run's whole process tree (git/dotnet/npm children too). Before, a timed-out
  run kept working unseen on the member's machine.

Guard: "Work on this" on a ticket labelled needs-human / epic shows why it is
meant for a person and keeps "Start working" disabled until "Run it anyway".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB
using var second = registry.Begin("t1", Task1);

first.Token.IsCancellationRequested.ShouldBeTrue();
first.Dispose();
Comment on lines +1904 to +1910
foreach (var child in await sessRepo.ListReposForTenantAsync(capturedTenantId, capturedSession.Id).ConfigureAwait(false))
{
if (child.Status is "Pending" or "Running")
{
await sessRepo.UpdateRepoRunResultAsync(capturedTenantId, child.Id, "Failed", null, null, "Stopped").ConfigureAwait(false);
}
}
@hoangsnowy
hoangsnowy merged commit 2be2002 into main Oct 20, 2026
4 checks passed
@hoangsnowy
hoangsnowy deleted the feat/stop-task branch October 20, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants