Skip to content

Model bridge: answer what arrived while it was down - #4903

Merged
trissim merged 1 commit into
mainfrom
claude/model-agent-resume
Nov 18, 2026
Merged

trissim merged 1 commit into
mainfrom
claude/model-agent-resume

Conversation

@trissim

@trissim trissim commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

What was broken

After a comms_serve_model replace=true restart, rl2 never answered Tristan's three DMs (bus 23299–23301). They arrived during the restart, and a fresh bridge started reading at the inbox tail (_initial_start), so anything sent while it was down was silently skipped.

Fix

  • Each reply now names the message it answers (messaging.send(..., answers=(message.reference,))), so the bus's own answer table records which inbox messages are done. The bridge keeps no cursor of its own.
  • On start, the bridge reads the whole inbox, asks bus.unanswered_references which messages have no answer, and resumes after the newest one that has. Messages that arrived in the gap get answered next.
  • An inbox with no recorded answers at all (replies sent before this change carry no links) still starts at its tail, so the first restart on this code doesn't replay a day of history at the model.

Evidence

tests/test_model_agent_client.py + tests/test_connector_serve_model.py: 9 passed, exit 0. The new test answers a DM, stops the bridge, sends a DM while it's down, restarts, and gets the echo of that gap message.


Generated by Claude Code

A replace=true restart started at the inbox tail, so every DM sent during
the gap was skipped. Replies now name the message they answer, and a
restart resumes after the newest answered inbox message; an inbox with no
recorded answer still starts at its tail instead of replaying history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dU1ViXamAaDwNWUtGY
@trissim
trissim merged commit 704ac58 into main Nov 18, 2026
1 of 2 checks passed
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.

2 participants