diff --git a/docs/releases/v0.9.11.md b/docs/releases/v0.9.11.md index 012cbda..809003d 100644 --- a/docs/releases/v0.9.11.md +++ b/docs/releases/v0.9.11.md @@ -1,5 +1,6 @@ -An issue that changed while an actor slept rides with the wake, not in a second turn. +A message in a room the spot does not read no longer stops it, and an issue that changed while an actor slept rides with the wake. +- **News from another room no longer stops the spot.** The core names the rooms that have a new message. When it named one the spot does not read, such as the team room, while a turn was running, the spot exited. It now ignores that room and the turn goes on. - **A tick of an actor carries the issues that changed.** An actor is suspended between wakes and reads the open issues only once it runs. The wake the core ordered read the rooms before its turn and the issues after it, so an issue that had changed while the actor slept was found when the turn was over and started a second turn a few seconds later, with the whole prompt and tool list again. The ordered wake now reads the issues with the rooms, before its turn: the change is a fact of that turn. Upgrade: chart `oci://ghcr.io/triageagent-dev/charts/tria-spot` 0.9.11, image `ghcr.io/triageagent-dev/spot:0.9.11`. diff --git a/internal/supervisor/supervisor.go b/internal/supervisor/supervisor.go index dbe8066..9a21fae 100644 --- a/internal/supervisor/supervisor.go +++ b/internal/supervisor/supervisor.go @@ -1471,7 +1471,11 @@ func (s *Supervisor) saveCursors() { // pollRoom reads one room. It returns the edges and whether the cursor moved. func (s *Supervisor) pollRoom(ctx context.Context, room string) ([]edges.Edge, bool) { - rs := s.rooms[room] + rs, ok := s.rooms[room] + if !ok { + // The core names every room with news. The spot reads only its own. + return nil, false + } if s.now().Before(rs.disabled) { return nil, false } diff --git a/internal/supervisor/supervisor_test.go b/internal/supervisor/supervisor_test.go index 7dbd7b7..3a14dd6 100644 --- a/internal/supervisor/supervisor_test.go +++ b/internal/supervisor/supervisor_test.go @@ -1777,6 +1777,21 @@ func TestAPersonsMessageDuringATurnIsHandedToIt(t *testing.T) { } } +// The core names the rooms with news, among them rooms the spot does not read. +func TestARoomTheSpotDoesNotReadDuringATurnIsIgnored(t *testing.T) { + h, trig, g := midTurn(t) + defer h.stop() + h.post("bus", say("alice", "alice", "@example-spot and also the cart")) + trig.say(triggers.Pending{Rooms: []string{"team", "agents", "bus"}}) + h.waitFor("the bus message to reach the running turn", func() bool { return len(g.injected()) == 1 }) + g.set(func() { g.gated = false }) + close(g.release) + h.waitIdle(2) + if h.status().State != "idle" { + t.Fatalf("state %q", h.status().State) + } +} + func TestAMessageTheTurnDoesNotTakeWakesTheAgentAfterIt(t *testing.T) { h, trig, g := midTurn(t) defer h.stop()