Agent: what a day of live use asked for
Twenty-one prompts against the live assistant found one fabricated success,
a model that believed it was 2025, and a describe_garden that was ~450 plop
entries per turn. This is the set of fixes, each traceable to a finding:
- The gardener's LOCAL day travels with the turn (`today` on POST /agent/chat,
sent by the UI like plantedAt) into the system prompt and every dated tool
default. Left to guess, the model dated journal entries a year back; left to
the server, a 9 pm fill landed on UTC's tomorrow.
- describe_garden groups plops by plant — count, where, planted date, days to
maturity — and lists ids only for groups of ≤ 8; list_plantings spells a big
group out on demand and remove_plantings acts on one plant in a bed ("take
the beets out, leave the garlic"), which used to mean 116 single removals.
- New tools: move_planting (keeps the planting date; across beds via the new
MovePlanting, which is why the store's UPDATE now writes object_id),
update_plant, read_history, copy_garden (the "<garden> — <year>" plan
convention). fill_region takes an explicit local rectangle and a seedLotId;
place_planting's radius defaults to one plant (spacing/2) instead of a guess.
- The system prompt states the date and the gardener's units, forbids claiming
a change no tool made, says it cannot undo and points at the Undo button,
asks before clearing beds on an ambiguous sentence, and stops narrating its
own plantings into the journal.
- A mutation aimed at ANOTHER garden inside a turn is recorded under that
garden as its own change set, not filed into the open scope.
- UI: the thread scrolls inside the Assistant panel so the composer stays
put; every tool has a step label; wide tables stay inside the bubble.
Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
@@ -200,7 +200,21 @@ func (s *Service) record(ctx context.Context, gardenID, actorID int64, summary s
|
||||
return
|
||||
}
|
||||
if sc := scopeFrom(ctx); sc != nil {
|
||||
sc.append(revs)
|
||||
if sc.gardenID == gardenID {
|
||||
sc.append(revs)
|
||||
return
|
||||
}
|
||||
// The scope is for ANOTHER garden — an agent turn on garden A that the
|
||||
// model pointed at an object in garden B. Joining the scope would file B's
|
||||
// revisions under A's history, where B's undo can't see them and A's undo
|
||||
// would revert rows in a garden the person isn't looking at. Record them
|
||||
// where they belong, as their own change set, keeping the source and run
|
||||
// id so the entry still reads as the agent's work.
|
||||
own := &changeScope{gardenID: gardenID, actorID: actorID, source: sc.source, summary: summary, agentRunID: sc.agentRunID}
|
||||
own.append(revs)
|
||||
if _, err := s.commitScope(ctx, own, nil); err != nil {
|
||||
slog.Error("service: record change set outside the open scope", "error", err, "garden", gardenID, "summary", summary)
|
||||
}
|
||||
return
|
||||
}
|
||||
// Auto-scope: one operation, its own change set. Written through the same
|
||||
|
||||
Reference in New Issue
Block a user