Add agentd persistent context reset command

t-815·WorkTask·
·
·
Created15 hours ago·Updated15 hours ago·pipeline runs →

Dependencies

Description

Edit

Add an explicit agentd command to reset persistent session context without deleting agent config. Semantics: stop agent if running, delete checkpoint state used for --resume, optionally clear session log, clear persisted messages metadata, and restart only if previously active. This gives a first-class replacement for manual checkpoint deletion when sessions get stuck in a stale conversational loop.

Git Commits

1487d8c8feat(agentd): add persistent context reset command
Coder Agent15 hours ago3 files

Timeline (6)

🔄[human]Open → InProgress15 hours ago
💬[human]15 hours ago

Implemented explicit persistent context reset command.

What changed:

  • Omni/Agentd.hs
  • Added top-level reset command:
  • Usage: agentd reset ID [--clear-log] [--mode MODE]
  • persistent-only (oneshot rejected)
  • calls daemon reset routine and reports success
  • Omni/Agentd/Daemon.hs
  • Added resetPersistentAgentContext control-plane op.
  • Behavior:

1) validate agent exists 2) stop the persistent service 3) remove checkpoint artifacts (and stale fifo) so --resume has no prior context 4) clear DB message/state metadata for the agent 5) optionally truncate session JSONL log with --clear-log 6) restart only if session was active before reset

  • Omni/Agentd/SPEC.md
  • documented agentd reset <name> --mode persistent and --clear-log

Verification:

  • lint Omni/Agentd.hs Omni/Agentd/Daemon.hs Omni/Agentd/SPEC.md
  • typecheck.sh Omni/Agentd.hs
  • bild --test Omni/Agentd/Daemon.hs
  • bild Omni/Agentd.hs
  • CLI help: agentd reset --help

Runtime smoke:

  • ran agentd reset omni-coder --mode persistent
  • checkpoint file absent immediately after reset (fresh context)
  • sent command: Run exactly one command with run_bash: echo reset-ok...
  • checkpoint shows tool result reset-ok from fresh post-reset context.
💬[human]15 hours ago

Committed in 1487d8c8. Added 'agentd reset' to clear persistent checkpoint context (optional --clear-log), wired CLI command parsing/dispatch, and documented usage in Omni/Agentd/SPEC.md.

🔄[human]InProgress → Review15 hours ago