ductor icon indicating copy to clipboard operation
ductor copied to clipboard

TaskEntry.original_prompt not persisted across restarts

Open nzshock opened this issue 8 months ago • 1 comments

Problem

TaskEntry.original_prompt is set at creation time but is not included in to_dict() or from_dict() in tasks/registry.py. Only prompt_preview (80 chars) survives a bot restart.

This means if the bot restarts while a task is running (or after it completes but before it's cleaned up), the full original prompt is lost. This blocks:

  • Proper resume after restart (task agent loses context about what it was doing)
  • Retry of failed tasks (no way to re-submit the original prompt)

Suggested fix

Add original_prompt to to_dict() and from_dict() in TaskEntry:

# to_dict()
d["original_prompt"] = self.original_prompt

# from_dict()
entry.original_prompt = data.get("original_prompt", "")

One-line each. The prompt is already stored in memory — this just persists it to disk.

Environment

  • ductor v0.15.0
  • Windows 11, Python 3.13

nzshock avatar Mar 26 '26 08:03 nzshock

Fixed in v0.16.0 (commit 3eb464b).

Extended tasks/registry.py::to_dict / from_dict to round-trip original_prompt. There was a test that asserted this field should not be persisted (with a "runtime-only" docstring) — that contradicted the ask in this issue. I replaced it with one that verifies persistence. tasks.json now preserves the original prompt across a process restart.

PleasePrompto avatar Apr 21 '26 10:04 PleasePrompto