Skip to content

Replaced the client stream merge with Link Records. - #5

Closed
moetemp wants to merge 11 commits into
moe/brook/harnessfrom
moe/brook/harness-follow
Closed

moetemp wants to merge 11 commits into
moe/brook/harnessfrom
moe/brook/harness-follow

Conversation

@moetemp

@moetemp moetemp commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

What changed?

This PR replaces the client-side stream merge with Brook Link Records and follow(). It's stacked on #4.

  • The activity that sends a subagent its message writes subagent_message_sent and its OPEN in one append. The parent writes a JOIN and subagent_reply_received in one append, with the subagent's turn_end cursor as until. A retried append dedupes each marker and its link together.
  • On SubagentTurnError and SubagentNoReply the activity reads on to turn_end and puts consumed_cursor in the error details. The parent writes the JOIN with it and moves last_consumed_cursor.
  • AgentClient.send_message and attach read the agent tree with one follow() of the root's stream (harness/agent_follow.py). stream_merge/ and its tests are gone, and so are subagent_stall_grace_seconds, the per-child deadlines and the give-up path.
  • The resume point carries the follow state, so a reconnect inside a subagent's turn loses nothing. An old seq@cursor point still decodes, as the root cursor only. The point moves at batch ends, so a resume from inside a batch repeats the rest of that batch.
  • New subagent_max_depth (4) and subagent_max_open (16) options. A SKIPPED or UNAVAILABLE link becomes subagent_stream_unavailable with the reason.
  • The pin moves to sdk-python h11 (e160426e), which takes plain values and links in one append.

Events with no bracket can come in another order than before. The brackets and each stream's own order hold, and the same store content always gives the same order.

Why?

Jason asked for one logical stream for an agent and its subagents. With Link Records the stream runtime gives that order to every SDK, so the harness doesn't rebuild it in a client merge. The stall deadlines go too, since the JOIN's until record is in the store before the JOIN is written.

How did you test it?

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

@moetemp

moetemp commented Oct 21, 2026

Copy link
Copy Markdown
Owner Author

Link Records are paused after the 2026-10-19 SDK review. Replaced by #6, the Brook v3 stack.

@moetemp moetemp closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant