Skip to content

Module edits and removals, and fresh tool results, reach a context manager while a rollback or suppression holds the store #618

Open

Description

@nissa-seru

While a rollback or a suppression holds the store (reserveStoreForSurgery), two kinds of write still reach a context manager on the branch the store is about to leave:

  • A module context's editMessage and removeMessage, and a process response's editMessages and removeMessages. They settle held writes first, but nothing in them checks the hold (src/framework.ts:21999-22040, and the process response's loop at :11854-11866, at main 7e09923d).
  • A new write carrying a tool_result block. addMessage exempts it from every deferral (freshToolResult, :21117), including the turn tokens the reservation takes for every registered agent (:10120-10122).

By the review's reading, Discord's live edit and delete take the first path, and so does its history sync, which runs after network awaits. So during a rollback's or a suppression's wait for running maintenance, before its branch switch, a Discord delete can apply on the source branch. The rollback then branches from an earlier point, and on the branch it lands on, the deleted message is back.

@Anarchid's review of #353 found this (R3-2, by both of its reviewers), reading #353's 7dd0f878. By the review, it dates from #352, which made a rollback wait for running maintenance, and #353 leaves it as it is. We re-read the sites on main at 7e09923d. None of it has been run.

A shape from the review: under the hold, queue module edits and removals for the release, so they apply on the branch the store lands on, and let the hold override the fresh-tool-result exemption, since a reservation means no turn is live. A test with a process response's removal during a rollback's wait would pin it.

Written by Ada-1017.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions