Commit 8285548
authored
fix: immediate stop feedback and synthetic execution_complete (#79)
* fix: immediate stop feedback and synthetic execution_complete
stopExecution() now marks the processing message as failed, broadcasts
a synthetic execution_complete (so all clients flush buffered tokens),
and sends processing_status: false immediately.
processSandboxEvent() guards execution_complete with isStillProcessing
so the bridge's late execution_complete doesn't double-update a stopped
message. Queue draining and snapshots still run regardless.
* fix: address PR review feedback
- Remove unnecessary `as ServerMessage` cast on synthetic execution_complete
broadcast — the type already matches the ServerMessage union
- Broadcast execution_complete to clients in the normal (non-stopped) completion
path — the early return skipped the generic broadcast, so normal completions
were never sent to WebSocket clients
- Update unit test header comment to accurately describe what's tested
(repository methods, not DO behavior)
* chore: clarify why stopExecution notifies slack-bot directly
* refactor: simplify completionMessageId and add queue-drain integration test
- Remove dead `?? event.messageId` fallback (messageId already resolves it)
- Add integration test verifying queue drain dispatches next message when
sandbox WS is connected after stop + late execution_complete1 parent 1bb4ecc commit 8285548
File tree
3 files changed
+553
-23
lines changed- packages/control-plane
- src/session
- test/integration
3 files changed
+553
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1042 | 1042 | | |
1043 | 1043 | | |
1044 | 1044 | | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
| 1045 | + | |
| 1046 | + | |
1048 | 1047 | | |
1049 | | - | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
1050 | 1055 | | |
1051 | 1056 | | |
1052 | | - | |
1053 | 1057 | | |
1054 | 1058 | | |
1055 | 1059 | | |
| |||
1069 | 1073 | | |
1070 | 1074 | | |
1071 | 1075 | | |
1072 | | - | |
| 1076 | + | |
1073 | 1077 | | |
1074 | | - | |
1075 | | - | |
1076 | 1078 | | |
1077 | 1079 | | |
1078 | | - | |
| 1080 | + | |
| 1081 | + | |
1079 | 1082 | | |
1080 | | - | |
1081 | | - | |
| 1083 | + | |
| 1084 | + | |
1082 | 1085 | | |
1083 | 1086 | | |
1084 | 1087 | | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
| 1088 | + | |
1088 | 1089 | | |
1089 | | - | |
1090 | | - | |
1091 | 1090 | | |
1092 | 1091 | | |
1093 | | - | |
1094 | | - | |
1095 | 1092 | | |
| 1093 | + | |
1096 | 1094 | | |
1097 | 1095 | | |
1098 | 1096 | | |
| |||
1108 | 1106 | | |
1109 | 1107 | | |
1110 | 1108 | | |
1111 | | - | |
| 1109 | + | |
1112 | 1110 | | |
1113 | 1111 | | |
1114 | 1112 | | |
| |||
1305 | 1303 | | |
1306 | 1304 | | |
1307 | 1305 | | |
1308 | | - | |
1309 | | - | |
| 1306 | + | |
| 1307 | + | |
1310 | 1308 | | |
1311 | 1309 | | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
1312 | 1342 | | |
1313 | 1343 | | |
1314 | 1344 | | |
| |||
2031 | 2061 | | |
2032 | 2062 | | |
2033 | 2063 | | |
2034 | | - | |
2035 | | - | |
| 2064 | + | |
| 2065 | + | |
2036 | 2066 | | |
2037 | 2067 | | |
2038 | 2068 | | |
| |||
Lines changed: 121 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
0 commit comments