Repository navigation
Conversation
AgentsRunner.update now picks the running agents from the identities, its records and its own community connections, reconciles the runners, finds the interrupted turns and resumes and catches up. The Manager shows what it decided and no longer answers the Runner's agent, ready or running questions. Behavior is unchanged. Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Logan Johnson <loganj@squareup.com>
Whether an agent is in an event's channel, whether the channel is its DM, a sender's display name and the classifier's context read only the Runner's connections and agent custody, so they move into AgentsRunner. RunnerManager loses member, dm, context and displayName. Behavior is unchanged. Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Logan Johnson <loganj@squareup.com>
The Runner keeps the memberships it last decided from, so its record changes find the membership without asking the Manager. Plugin wakes and an agent's own handoff are queued by the Runner too. RunnerManager loses liveMember and handoff. Behavior is unchanged. Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Logan Johnson <loganj@squareup.com>
Three catch-up tests captured the second, then set up the first copy, then froze the clock at that second. When setup crossed into the next second, the copy's connection started a second late, so catch-up read the second of the unheard message and the restarted copy skipped it. Freeze the clock before setup instead. Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Logan Johnson <loganj@squareup.com>
Contributor
Author
|
🤖 Closing: this change is now part of #1748, which collects one column of the Manager/Runner split in one PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This is step 6 of the Manager/Runner split for agents. It is an inert refactor.
What changes
Until now the Manager decided which agents run, and the Runner asked it each time:
agent(key),ready(key)andrunning()were Manager answers.Now
AgentsRunner.update(identities, viewer)decides:agent,readyandrunningare now Runner methods.update()asks the Runner to update first, then shows what the Runner decided. It still builds the list the screens show, with its ownarchiveUncheckedmark and the agents still being deleted. When nothing in the shown list differs from the Runner's view, it reuses the Runner's object, soagentsandrunningshare objects as before.The second commit moves the event questions the runners ask into the Runner too: whether the agent is in the event's channel (
member), whether the channel is its DM (dm), a sender's display name and the classifier's context. They read only the Runner's own connections and agent custody.The third commit lets the Runner keep the memberships it last decided from, so its record changes find a membership themselves (
liveMember). It also queues plugin wakes and an agent's own handoff itself.RunnerManagerno longer hasready,agent,running,member,dm,context,displayName,liveMemberorhandoff.Ordering
The Runner now resumes and catches up before the Manager notifies its subscribers. Before, it was after. Both steps start async work that reads the Runner's own list, which is already current, so the order does not change what runs.
Presence stays with the Manager in this PR, and it now reads the Runner's running list. Presence moves with the hidden page.
Why
In a hidden agents page, the Runner must know what to run without asking the screens. What it still needs from the Manager for this is the identity list and the viewer, which can cross the agents link (#1748) as a topic.
Tests
does not catch up after a restart on a message it already heard live, and the two catch-up tests built the same way. CI failed on it once. Each test read the current second, set up the first copy, and only then froze the clock. When setup crossed into the next second, the copy's connection started one second late. Catch-up then covered the second of the unheard message, so the restarted copy skipped it. The race is onmainand on this stack's base too. A trace of the failing run showed the connection'ssinceone second afterstart. The tests now freeze the clock before setup. Under CPU load, the test failed 2 of 25 runs before the fix and 0 of 25 after.🤖 Generated with Claude Code