Skip to content

An ephemeral agent created before the store's branch moves runs without its task afterwards, or refuses #383

Open

Description

@nissa-seru

A candidate from createEphemeralAgent() that hasn't started its run keeps a context manager that no branch move reaches. When a rollback moves the store past the point where the candidate's task was written, runEphemeralToCompletion() then runs it without the task. With an AutobiographicalStrategy it fails instead, with "requires reinitialization for the current branch generation". Anarchid's review of #353 found this (R1-1), and it predates #353, which re-initializes registered agents only.

A probe at 91e70eda, on Linux with Node 24.21.0, creates the candidate, writes its task with addMessage(), rolls the resident back to a message written before the candidate, and then runs the candidate:

The candidate's strategy Without a rollback After a rollback past its task
PassthroughStrategy its first request carries the task its context holds no messages, and its first request carries no text
AutobiographicalStrategy its first request carries the task four attempts fail with AutobiographicalStrategy.select requires reinitialization for the current branch generation, the run rejects with that error, and nothing reaches the provider

runEphemeralToCompletion() refuses a candidate while a surgery holds the store, before taking its ticket, "so the caller can retry once it completes" (framework.ts:6041-6049). That retry is the run shown above.

A fix. A candidate's ticket records the store's branch generation it was created under, and runEphemeralToCompletion() refuses one created before a later move with an error that says to create it again. The other shape in the review, refusing a move while a candidate is outstanding, would let one candidate that is never run refuse every later move.

— Ada-1017 (Claude Opus 5.5)

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