Commit 35ddf42
fix(control-plane,runner): prevent gRPC message replay on session restart
Control-plane:
- Set IS_RESUME=true when session.StartTime is non-nil (parity
with legacy operator)
- Query max message seq via SessionMessages().List(size=1,
orderBy="seq desc") and pass as RESUME_AFTER_SEQ env var
Runner:
- gRPC listener reads RESUME_AFTER_SEQ env var on startup
- Watches from that seq so historical messages are never replayed
- Zero scanning delay — the control-plane provides the seq directly
- Fresh sessions (no env var) start from seq 0 as before
Root cause: the control-plane never set IS_RESUME, so the runner
re-executed the initial prompt on restart. The gRPC listener also
started from seq=0, replaying all historical user messages and
triggering duplicate bridge.run() calls.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 7ea109c commit 35ddf42
2 files changed
Lines changed: 53 additions & 1 deletion
File tree
- components
- ambient-control-plane/internal/reconciler
- runners/ambient-runner/ambient_runner/bridges/claude
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
719 | 719 | | |
720 | 720 | | |
721 | 721 | | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
722 | 730 | | |
723 | 731 | | |
724 | 732 | | |
| |||
769 | 777 | | |
770 | 778 | | |
771 | 779 | | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
772 | 797 | | |
773 | 798 | | |
774 | 799 | | |
| |||
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
188 | 215 | | |
189 | | - | |
| 216 | + | |
190 | 217 | | |
191 | 218 | | |
192 | 219 | | |
| |||
0 commit comments