Repository navigation
Description
What happens
A 定时一次 (one-shot scheduled) card becomes impossible to edit after the run fires (or after
its missed window is consumed).
Once the one-shot is consumed, the ledger keeps execution.mode: 'scheduled' but removes the
trigger and the next run:
src/host/scheduler.ts:260-261(queueRunAt) deletesrunAtand setsnextRunAt = undefined
before dispatch;src/host/scheduler.ts:368-369(consumeRunAt) does the same for a missed window;- settlement only re-normalizes the config for cron cards
(src/host/execution.ts:1025-1030,t.execution = { mode: 'claim' }), not for one-shots.
The untouched mode: 'scheduled' then makes the edit form unusable:
src/client/board/TaskFormModal.tsx:188infers the form mode fromcrononly:
scheduled ? (cron !== undefined ? 'periodic' : 'once') : 'claim';:206seedsrunAtonly whenexecution.runAt !== undefined, so the datetime field is empty;:297-298setsrunAtBad = mode === 'once' && (runAt === '' || runAtMs <= Date.now()), and
validdepends on it;:781disables the primary button (disabled={!valid || busy || imageUploading}).
Result: opening Edit on such a card shows a one-shot form with an empty trigger time, a
"pick a future trigger time" hint, and a permanently disabled Save / Create and run. There
is no way to fix a typo, change the project/prompt/checklist, or tick anything without inventing a
new future time (silently re-scheduling a finished card) or manually switching it to 认领, which
loses the one-shot intent.
Secondary visual symptom: the card badge and detail chip still render as scheduled with empty data —
src/client/board/TaskCard.tsx:213-214 prints ⏰ — and
src/client/board/TaskDetail.tsx:762-763 prints ⏰ · next with empty cron/time.
I reproduced the disabled form in a jsdom render of TaskFormModal with
execution: { mode: 'scheduled', lastTriggeredAt: 5 }: the datetime input exists, the primary
button reads Save, and it is disabled.
How to reproduce (GUI)
- Create a task with execution mode 定时一次 and a trigger a minute ahead.
- Let it fire and settle (card lands in 待验收 or returns to 待办 after a failure).
- Open the card → Edit.
- The datetime field is empty and Save is disabled; filling in a new time re-arms the schedule
instead of just saving the edit.
Environment
- dsh-taskboard
0.9.9/dev@140e763(originally reproduced on0.9.6@3054eba) - DSH
0.2.1-rc.2, Windows 11, Node26.13.0
Suggested fix
Either normalize the consumed one-shot in the host (the cleanest place: once the run has started /
settled, a spent one-shot is effectively a claim task — the cron path already does exactly this
at execution.ts:1025-1030), or make the client defensive:
- infer
claimwhenexecution.mode === 'scheduled' && cron === undefined && runAt === undefined
(TaskFormModal.tsx:188, and the same guard for therunAtseed at:206); - hide the
⏰badge/chip when there is neithercron,nextRunAtnorqueuedRunAt
(TaskCard.tsx:213,TaskDetail.tsx:762).
A small regression test can mount the form with a consumed one-shot and assert the primary button
is enabled and submits mode: 'claim'.
Dedupe
Nearest issues are #26/#41/#49 (scheduled session reuse) and #28 (cron permission/terminal
states). None covers editing a consumed one-shot; no open PR touches the mode inference.
Activity
fix: normalize a spent one-shot back to claim so its edit form stays …