Agent: undo for real, past seasons, and tools that correct the record
Six tools the live assistant kept needing and a prompt that knows about them: - undo_change wraps RevertChangeSet(source=agent). A revert is its own change set, so Run reports the last one as the turn's handle when the turn changed nothing else — an undo-only reply keeps its "Undo this", which is now a redo. - describe_garden takes a year: the season view (GardenFull(year)), pulled plops included, with removed/removedAt per group and per plop; list_years says which years have records. Rotation questions finally have data. - update_planting corrects a plop's date, count, label, radius or seed lot in place; remove_planting, remove_plantings and clear_object take a removedAt so a harvest can be backdated. - update_journal_entry / delete_journal_entry correct a note instead of stacking a contradicting one. - update_garden renames/resizes/re-units a garden and rewrites its notes — and the notes now go into the system prompt as the gardener's standing facts, so "remember we're in zone 6a" persists across conversations. describe_garden also reports the garden's notes, version and grid, which the new tools need. Prompt, CLAUDE.md and DESIGN.md updated to match; UI step labels for the new tools. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
@@ -173,10 +173,22 @@ Conventions that follow from it:
|
||||
garden made the old per-plop describe ~450 entries on every turn. A tool that
|
||||
needs individual ids uses `list_plantings`; bulk work takes (object, plant)
|
||||
— `remove_plantings`, `ClearPlantings`. Don't add a tool that lists plops.
|
||||
- **The assistant can't undo and must not pretend to.** Asked to "undo the
|
||||
beets", the live model replied "Done!" and changed nothing. The prompt now
|
||||
forbids claiming a change no tool made and points at the Undo button; keep
|
||||
both rules when editing `systemPrompt`.
|
||||
With a `year` it is the season view (`GardenFull(year)`: every plop whose
|
||||
time in the ground overlapped the year, pulled ones included, with `removed`
|
||||
/ `removedAt` per group) — that is how "what was here last year?" is answered.
|
||||
- **The assistant undoes through `undo_change`, never by claiming.** Asked to
|
||||
"undo the beets", the live model once replied "Done!" and changed nothing.
|
||||
`undo_change` wraps `RevertChangeSet(source=agent)`; the prompt still forbids
|
||||
claiming a change no tool made. A revert is its own change set (it points at
|
||||
what it undid), so it never joins the turn's scope — `Run` reports the last
|
||||
revert as the turn's `ChangeSetID` when the turn made no other change, so the
|
||||
reply's "Undo this" is a redo. Keep that fallback: without it an undo-only
|
||||
turn is the one change in the conversation with no undo button.
|
||||
- **Garden notes are the assistant's memory.** `systemPrompt` quotes
|
||||
`Garden.Notes` (owner-written, `%q`) as standing context, and `update_garden`
|
||||
is how the model adds "we're in zone 6a" to them. Notes are replaced whole,
|
||||
so the tool description tells the model to merge; don't add a second store
|
||||
for "things the assistant remembers".
|
||||
|
||||
- **Request deadlines are extended through `responseController(c)`, never
|
||||
`http.NewResponseController(c.Writer)`.** A controller built in a handler
|
||||
|
||||
Reference in New Issue
Block a user