alan-turing-institute / reginald

Reginald repository for REG Hack Week 23
3 stars 0 forks source link

Implement queuing system for query slack bot #83

Closed rwood-97 closed 1 year ago

rwood-97 commented 1 year ago

Currently, sending two messages to the slack bot in quick succession (i.e. without waiting for an answer) causes this error.

image
2023-09-13 12:11:58 [    INFO] Received an events_api request
2023-09-13 12:11:58 [    INFO] Ignoring an event triggered by a bot.
2023-09-13 12:13:41 [    INFO] Received an events_api request
2023-09-13 12:13:41 [    INFO] Processing message 'who am I?' from user 'U05RHDQC71Q'.
2023-09-13 12:13:41 [    INFO] Reacting with emoji llama.
Batches: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 19.43it/s]
Llama.generate: prefix-match hit
2023-09-13 12:13:45 [    INFO] Received an events_api request
2023-09-13 12:13:45 [    INFO] Processing message 'who is Ryan' from user 'U05RHDQC71Q'.
2023-09-13 12:13:45 [    INFO] Reacting with emoji llama.
Batches: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.70it/s]
Llama.generate: prefix-match hit
[1]    54265 segmentation fault  python slack_bot/run.py --model llama-index-llama-cpp --data data  handbook  
/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

We need to implement a queuing system so that queries are processed one at a time to stop this happening. This will also be useful for when multiple users are using the bot - the goal will be each user has their own chat history but called to the same model instance so will need to be set up in a queue.

rwood-97 commented 1 year ago

Have switch to asyncronous and am getting this error from the slackbot:

2023-09-14 13:06:57 [    INFO] Load pretrained SentenceTransformer: sentence-transformers/all-mpnet-base-v2
2023-09-14 13:06:57 [    INFO] Created a temporary directory at /var/folders/fn/j7v8jkl1717c1b6sy_sr0szc0000gr/T/tmphuz77hj_
2023-09-14 13:06:57 [    INFO] Writing /var/folders/fn/j7v8jkl1717c1b6sy_sr0szc0000gr/T/tmphuz77hj_/_remote_module_non_scriptable.py
2023-09-14 13:06:58 [    INFO] Use pytorch device: cpu
2023-09-14 13:06:58 [    INFO] Loading the storage context
2023-09-14 13:06:58 [    INFO] Loading the pre-processed index
2023-09-14 13:06:58 [    INFO] Loading all indices.
2023-09-14 13:06:58 [    INFO] Done setting up Huggingface backend for query engine.
2023-09-14 13:06:58 [    INFO] Initalising bot with model: <slack_bot.models.llama_index.LlamaIndexLlamaCPP object at 0x1384c2510>
2023-09-14 13:06:58 [    INFO] Connecting to Slack...
2023-09-14 13:06:59 [    INFO] Listening for requests...
2023-09-14 13:07:32 [    INFO] Received an events_api request
2023-09-14 13:07:32 [    INFO] Processing message 'hi' from user 'U05RHDQC71Q'.
2023-09-14 13:07:32 [    INFO] Reacting with emoji llama.
Batches: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 17.53it/s]

llama_print_timings:        load time = 12406.58 ms
llama_print_timings:      sample time =   190.42 ms /   268 runs   (    0.71 ms per token,  1407.43 tokens per second)
llama_print_timings: prompt eval time = 53151.04 ms /  1598 tokens (   33.26 ms per token,    30.07 tokens per second)
llama_print_timings:        eval time = 18275.56 ms /   267 runs   (   68.45 ms per token,    14.61 tokens per second)
llama_print_timings:       total time = 71983.25 ms
Llama.generate: prefix-match hit

llama_print_timings:        load time = 12406.58 ms
llama_print_timings:      sample time =   186.49 ms /   265 runs   (    0.70 ms per token,  1420.98 tokens per second)
llama_print_timings: prompt eval time = 38363.60 ms /  1152 tokens (   33.30 ms per token,    30.03 tokens per second)
llama_print_timings:        eval time = 16973.71 ms /   264 runs   (   64.29 ms per token,    15.55 tokens per second)
llama_print_timings:       total time = 55877.94 ms
2023-09-14 13:09:40 [ WARNING] Was expecting a backend response with a regular expression but couldn't find a match.
2023-09-14 13:09:40 [    INFO] Posting reply   Hello! I'm here to help you with any questions or concerns you may have
....
Failed to send a ping message (s_1130793465): Cannot write to closing transport
2023-09-14 13:09:40 [   ERROR] Task exception was never retrieved
future: <Task finished name='Task-17' coro=<WebSocketWriter.ping() done, defined at /Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py:672> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 676, in ping
    await self._send_frame(message, WSMsgType.PING)
  File "/Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 646, in _send_frame
    self._write(header + mask + message)
  File "/Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 663, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
2023-09-14 13:09:41 [    INFO] Received an events_api request
2023-09-14 13:09:41 [    INFO] Ignoring an event triggered by a bot.
2023-09-14 13:09:41 [    INFO] Received an events_api request
2023-09-14 13:09:41 [ WARNING] Attempted to access key that does not exist.
'text'

The bot does continue to work in slack and keeps listening:

2023-09-14 13:10:55 [    INFO] Received an events_api request
2023-09-14 13:10:55 [    INFO] Processing message 'hi' from user 'U05RHDQC71Q'.
2023-09-14 13:10:55 [    INFO] Reacting with emoji llama.
Batches: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 14.15it/s]
Llama.generate: prefix-match hit

llama_print_timings:        load time = 12406.58 ms
llama_print_timings:      sample time =    51.33 ms /    72 runs   (    0.71 ms per token,  1402.80 tokens per second)
llama_print_timings: prompt eval time = 52006.67 ms /  1535 tokens (   33.88 ms per token,    29.52 tokens per second)
llama_print_timings:        eval time =  4943.61 ms /    71 runs   (   69.63 ms per token,    14.36 tokens per second)
llama_print_timings:       total time = 57099.83 ms
Llama.generate: prefix-match hit

llama_print_timings:        load time = 12406.58 ms
llama_print_timings:      sample time =   213.69 ms /   301 runs   (    0.71 ms per token,  1408.58 tokens per second)
llama_print_timings: prompt eval time = 29009.67 ms /   956 tokens (   30.34 ms per token,    32.95 tokens per second)
llama_print_timings:        eval time = 19240.77 ms /   300 runs   (   64.14 ms per token,    15.59 tokens per second)
llama_print_timings:       total time = 48881.04 ms
2023-09-14 13:12:41 [ WARNING] Was expecting a backend response with a regular expression but couldn't find a match.
2023-09-14 13:12:41 [    INFO] Posting reply   Hello! I'm here to help you with any questions
...
Failed to send a ping message (s_1131212341): Cannot write to closing transport
2023-09-14 13:12:41 [   ERROR] Task exception was never retrieved
future: <Task finished name='Task-36' coro=<WebSocketWriter.ping() done, defined at /Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py:672> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 676, in ping
    await self._send_frame(message, WSMsgType.PING)
  File "/Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 646, in _send_frame
    self._write(header + mask + message)
  File "/Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 663, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
2023-09-14 13:12:42 [    INFO] Received an events_api request
2023-09-14 13:12:42 [    INFO] Ignoring an event triggered by a bot.
rwood-97 commented 1 year ago

This actually seems to be happening even before I implemented asyncio. e.g. from normal set up:

2023-09-14 13:48:09 [    INFO] Received an events_api request
2023-09-14 13:48:09 [    INFO] Ignoring an event triggered by a bot.
2023-09-14 13:48:10 [    INFO] Received an events_api request
2023-09-14 13:48:10 [ WARNING] Attempted to access key that does not exist.
'text'
rchan26 commented 1 year ago

Be good to know what that warning actually means. We log this ourselves actually here, so that warning might be okay. It could be just a different request that we can safely ignore. Maybe we can log more information about this request in the warning.

rwood-97 commented 1 year ago

ah okay, I couldn't find it but that is helpful. I think then that means all we need to address is this bit:

Failed to send a ping message (s_1130793465): Cannot write to closing transport
2023-09-14 13:09:40 [   ERROR] Task exception was never retrieved
future: <Task finished name='Task-17' coro=<WebSocketWriter.ping() done, defined at /Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py:672> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 676, in ping
    await self._send_frame(message, WSMsgType.PING)
  File "/Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 646, in _send_frame
    self._write(header + mask + message)
  File "/Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 663, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
rwood-97 commented 1 year ago

Here is the debug output:

2023-09-15 14:24:18 [    INFO] Loading all indices.
2023-09-15 14:24:18 [    INFO] Done setting up Huggingface backend for chat engine.
2023-09-15 14:24:18 [    INFO] Initalising bot with model: <slack_bot.models.llama_index.LlamaIndexLlamaCPP object at 0x15ad02cd0>
2023-09-15 14:24:18 [    INFO] Connecting to Slack...
2023-09-15 14:24:18 [   DEBUG] Sending a request - url: POST https://www.slack.com/api/apps.connections.open, params: {}, files: {}, data: {}, json: {}, proxy: {}, headers: {'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': '(redacted)', 'User-Agent': 'Python/3.11.4 slackclient/3.22.0 Darwin/21.6.0'}
2023-09-15 14:24:18 [   DEBUG] Received the following response - status: 200, headers: {'Date': 'Fri, 15 Sep 2023 13:24:18 GMT', 'Server': 'Apache', 'Vary': 'Accept-Encoding', 'x-slack-req-id': 'b9526b49a788c41165b096bf4cb6eb9f', 'x-content-type-options': 'nosniff', 'x-xss-protection': '0', 'x-robots-tag': 'noindex,nofollow', 'Pragma': 'no-cache', 'Cache-Control': 'private, no-cache, no-store, must-revalidate', 'Expires': 'Sat, 26 Jul 1997 05:00:00 GMT', 'Content-Type': 'application/json; charset=utf-8', 'x-accepted-oauth-scopes': 'connections:write', 'x-oauth-scopes': 'connections:write', 'Access-Control-Expose-Headers': 'x-slack-req-id, retry-after', 'Access-Control-Allow-Headers': 'slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, x-b3-sampled, x-b3-flags', 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload', 'x-slack-unique-id': 'ZQRbAo8UvuZ6PZOv0YLzEgAAACY', 'x-slack-backend': 'r', 'referrer-policy': 'no-referrer', 'Access-Control-Allow-Origin': '*', 'Via': '1.1 slack-prod.tinyspeck.com, envoy-www-iad-nogctvtw, envoy-edge-lhr-ymjfazon', 'Content-Encoding': 'gzip', 'Content-Length': '165', 'x-envoy-upstream-service-time': '107', 'x-backend': 'main_normal main_canary_with_overflow main_control_with_overflow', 'x-server': 'slack-www-hhvm-main-iad-xhdr', 'x-slack-shared-secret-outcome': 'no-match', 'x-edge-backend': 'envoy-www', 'x-slack-edge-shared-secret-outcome': 'no-match'}, body: {'ok': True, 'url': 'wss://wss-primary.slack.com/link/?ticket=2318a518-da49-4321-a060-5e3d39874d2e&app_id=343e1fe7f52dc2ac7733a333c33ada4fe2490af99e1f4a628a0f760bc100f5f4'}
2023-09-15 14:24:19 [    INFO] A new session (s_1188886077) has been established
2023-09-15 14:24:19 [   DEBUG] Sending a ping message with the newly established connection (s_1188886077)...
2023-09-15 14:24:19 [   DEBUG] A new monitor_current_session() executor has been recreated for s_1188886077
2023-09-15 14:24:19 [   DEBUG] A new receive_messages() executor has been recreated for s_1188886077
2023-09-15 14:24:19 [    INFO] Listening for requests...
2023-09-15 14:24:19 [   DEBUG] A new monitor_current_session() execution loop for s_1188886077 started
2023-09-15 14:24:19 [   DEBUG] A new receive_messages() execution loop with s_1188886077 started
2023-09-15 14:24:19 [   DEBUG] Received message (type: TEXT, data: {"type":"hello","num_connections":1,"debug_info":{"host":"applink-9","build_number":38,"approximate_connection_time":18060},"connection_info":{"app_id":"A05RS0R47SA"}}, extra: , session: s_1188886077)
2023-09-15 14:24:19 [   DEBUG] A new message enqueued (current queue size: 1, session: s_1188886077)
2023-09-15 14:24:19 [   DEBUG] Message processing started (type: hello, envelope_id: None, session: s_1188886077)
2023-09-15 14:24:19 [   DEBUG] Message processing completed (type: hello, envelope_id: None, session: s_1188886077)
2023-09-15 14:24:19 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694784259.003941'), extra: , session: s_1188886077)
2023-09-15 14:24:20 [   DEBUG] Received message (type: PING, data: bytearray(b'Ping from applink-9'), extra: , session: s_1188886077)
2023-09-15 14:24:24 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694784264.006083'), extra: , session: s_1188886077)
2023-09-15 14:24:29 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694784269.0079129'), extra: , session: s_1188886077)
2023-09-15 14:24:30 [   DEBUG] Received message (type: PING, data: bytearray(b'Ping from applink-9'), extra: , session: s_1188886077)
2023-09-15 14:24:34 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694784274.010114'), extra: , session: s_1188886077)
2023-09-15 14:24:39 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694784279.012317'), extra: , session: s_1188886077)
2023-09-15 14:24:41 [   DEBUG] Received message (type: PING, data: bytearray(b'Ping from applink-9'), extra: , session: s_1188886077)
2023-09-15 14:24:44 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694784284.0142038'), extra: , session: s_1188886077)
2023-09-15 14:24:49 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694784289.016434'), extra: , session: s_1188886077)
2023-09-15 14:24:50 [   DEBUG] Received message (type: PING, data: bytearray(b'Ping from applink-9'), extra: , session: s_1188886077)
2023-09-15 14:24:54 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694784294.0188851'), extra: , session: s_1188886077)
2023-09-15 14:24:59 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694784299.0207639'), extra: , session: s_1188886077)
2023-09-15 14:25:00 [   DEBUG] Received message (type: PING, data: bytearray(b'Ping from applink-9'), extra: , session: s_1188886077)
2023-09-15 14:25:04 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694784304.022954'), extra: , session: s_1188886077)
2023-09-15 14:25:09 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694784309.0250182'), extra: , session: s_1188886077)
2023-09-15 14:25:10 [   DEBUG] Received message (type: PING, data: bytearray(b'Ping from applink-9'), extra: , session: s_1188886077)
2023-09-15 14:25:14 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694784314.0271401'), extra: , session: s_1188886077)
2023-09-15 14:25:17 [   DEBUG] Received message (type: TEXT, data: {"envelope_id":"bc4117d5-5ff4-4a6c-a090-b29b6be9cd9e","payload":{"token":"OEqSunrvpkP80Su25M5fdu4W","team_id":"T057SAAS0K0","context_team_id":"T057SAAS0K0","context_enterprise_id":null,"api_app_id":"A05RS0R47SA","event":{"client_msg_id":"cdce49bd-8afa-46d8-9901-fb9ab61e344d","type":"message","text":"reginald","user":"U05RHDQC71Q","ts":"1694784317.133069","blocks":[{"type":"rich_text","block_id":"Rnu","elements":[{"type":"rich_text_section","elements":[{"type":"text","text":"reginald"}]}]}],"team":"T057SAAS0K0","channel":"D05S24S030D","event_ts":"1694784317.133069","channel_type":"im"},"type":"event_callback","event_id":"Ev05SX5XU8JV","event_time":1694784317,"authorizations":[{"enterprise_id":null,"team_id":"T057SAAS0K0","user_id":"U05RJ4R1V1D","is_bot":true,"is_enterprise_install":false}],"is_ext_shared_channel":false,"event_context":"4-eyJldCI6Im1lc3NhZ2UiLCJ0aWQiOiJUMDU3U0FBUzBLMCIsImFpZCI6IkEwNVJTMFI0N1NBIiwiY2lkIjoiRDA1UzI0UzAzMEQifQ"},"type":"events_api","accepts_response_payload":false,"retry_attempt":0,"retry_reason":""}, extra: , session: s_1188886077)
2023-09-15 14:25:17 [   DEBUG] A new message enqueued (current queue size: 1, session: s_1188886077)
2023-09-15 14:25:17 [   DEBUG] Message processing started (type: events_api, envelope_id: bc4117d5-5ff4-4a6c-a090-b29b6be9cd9e, session: s_1188886077)
2023-09-15 14:25:17 [    INFO] There are currently 1 items in the queue.
2023-09-15 14:25:17 [   DEBUG] Message processing completed (type: events_api, envelope_id: bc4117d5-5ff4-4a6c-a090-b29b6be9cd9e, session: s_1188886077)
2023-09-15 14:25:17 [    INFO] Received an events_api request
2023-09-15 14:25:17 [   DEBUG] Sending a message: {"envelope_id": "bc4117d5-5ff4-4a6c-a090-b29b6be9cd9e"} from session: s_1188886077
2023-09-15 14:25:17 [    INFO] Processing message 'reginald' from user 'U05RHDQC71Q'.
2023-09-15 14:25:17 [    INFO] Reacting with emoji llama.
2023-09-15 14:25:17 [   DEBUG] Sending a request - url: POST https://www.slack.com/api/reactions.add, params: {'channel': 'D05S24S030D', 'name': 'llama', 'timestamp': '1694784317.133069'}, files: {}, data: {}, json: {}, proxy: {}, headers: {'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': '(redacted)', 'User-Agent': 'Python/3.11.4 slackclient/3.22.0 Darwin/21.6.0'}
2023-09-15 14:25:17 [   DEBUG] Received the following response - status: 200, headers: {'Date': 'Fri, 15 Sep 2023 13:25:17 GMT', 'Server': 'Apache', 'Vary': 'Accept-Encoding', 'x-slack-req-id': '2a4a62c8aac6f822777d3eec0d05ee18', 'x-content-type-options': 'nosniff', 'x-xss-protection': '0', 'Pragma': 'no-cache', 'Cache-Control': 'private, no-cache, no-store, must-revalidate', 'Expires': 'Sat, 26 Jul 1997 05:00:00 GMT', 'Content-Type': 'application/json; charset=utf-8', 'x-accepted-oauth-scopes': 'reactions:write', 'x-oauth-scopes': 'commands,im:history,reactions:write,chat:write,im:write,emoji:read,reactions:read,app_mentions:read,im:read,incoming-webhook,channels:history,chat:write.public,users.profile:read', 'Access-Control-Expose-Headers': 'x-slack-req-id, retry-after', 'Access-Control-Allow-Headers': 'slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, x-b3-sampled, x-b3-flags', 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload', 'x-slack-unique-id': 'ZQRbPZAuN-45dTY43Mk1DgAAUC8', 'x-slack-backend': 'r', 'referrer-policy': 'no-referrer', 'Access-Control-Allow-Origin': '*', 'Content-Length': '11', 'Via': '1.1 slack-prod.tinyspeck.com, envoy-www-iad-fxyrpctm, envoy-edge-lhr-tcnxrqfn', 'x-envoy-upstream-service-time': '140', 'x-backend': 'main_normal main_canary_with_overflow main_control_with_overflow', 'x-server': 'slack-www-hhvm-main-iad-jcpn', 'x-slack-shared-secret-outcome': 'no-match', 'x-edge-backend': 'envoy-www', 'x-slack-edge-shared-secret-outcome': 'no-match'}, body: {'ok': True}
Batches: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.06it/s]
2023-09-15 14:25:17 [   DEBUG] > Top 3 nodes:
> [Node 30be9a9c-d226-4133-8642-6ca620cc0d21] [Similarity score:             0.290463] New Joiners This section helps new members of REG get up to speed. Please go through these page a...
> [Node 046ac25e-3976-4a1d-9914-e2b860979f2a] [Similarity score:             0.262932] Common Technical Practices This section contains a section of common technical practices within R...
> [Node e08d3482-69bf-47bb-baf8-38dfe358b0c3] [Similarity score:             0.260715] Contributors In this table we try to capture everyone who has contributed to the project and how ...

llama_print_timings:        load time = 12429.55 ms
llama_print_timings:      sample time =   364.94 ms /   512 runs   (    0.71 ms per token,  1402.98 tokens per second)
llama_print_timings: prompt eval time = 18767.39 ms /   638 tokens (   29.42 ms per token,    34.00 tokens per second)
llama_print_timings:        eval time = 31743.44 ms /   511 runs   (   62.12 ms per token,    16.10 tokens per second)
llama_print_timings:       total time = 51623.90 ms
2023-09-15 14:26:09 [ WARNING] Was expecting a backend response with a regular expression but couldn't find a match.
2023-09-15 14:26:09 [    INFO] Posting reply   Based on the provided context information, here are some key points about the REG Handbook:
1. New Joiners Section: This section of the handbook is designed to help new members of REG get up to speed with the team's processes and practices. It provides an overview of the first few days of systems setup and important information for new joiners.
2. Common Technical Practices Section: This section covers a range of technical practices that are commonly used within REG. It acknowledges that there may be multiple ways to achieve the same goal, but provides a starting point for new contributors.
3. Contributors Table: The handbook includes a table that captures information about everyone who has contributed to the project, including their name, role, and how they have contributed. This table is generated and maintained using All Contributors.
4. Technical Practices: The handbook provides detailed information on various technical practices used within REG, such as coding standards, software development processes, and testing methods.
5. Contributor Roles: The handbook defines different contributor roles within REG, including maintainers, developers, and reviewers. It also provides guidelines for each role to help new contributors understand their responsibilities and how they can contribute to the project.
6. Communication Channels: The handbook outlines various communication channels used by REG, including email lists, Slack channels, and GitHub issues. It provides guidance on how to use these channels effectively and encourages new joiners to participate in discussions.
7. Meetings and Events: The handbook mentions regular meetings and events held within REG, such as the weekly team meeting and the annual retreat. It provides information on how to attend these events and what to expect.
8. Code of Conduct: The handbook includes a code of conduct that outlines the expected behavior and ethical standards for all contributors. It encourages new joiners to familiarize themselves with the code of conduct and adhere to it throughout their contributions.
9. Glossary: The handbook provides a glossary of common terms used within REG, which can help new joiners understand technical concepts and jargon used by the team.
10. Version Control: The handbook mentions the use of Git for version control and provides guidelines on how to use it effectively. It encourages new join

I read the following documents to compose this answer:
https://alan-turing-institute.github.io/REG-handbook/docs/onboarding/new_joiners/ (similarity: 0.29)

https://alan-turing-institute.github.io/REG-handbook/docs/technical_practices/ (similarity: 0.263)

https://alan-turing-institute.github.io/REG-handbook/docs/contributors/ (similarity: 0.261).
2023-09-15 14:26:09 [   DEBUG] Sending a request - url: POST https://www.slack.com/api/chat.postMessage, params: {}, files: {}, data: {}, json: {'channel': 'D05S24S030D', 'text': "<@U05RHDQC71Q>, you asked me: 'reginald'.\n  Based on the provided context information, here are some key points about the REG Handbook:\n1. New Joiners Section: This section of the handbook is designed to help new members of REG get up to speed with the team's processes and practices. It provides an overview of the first few days of systems setup and important information for new joiners.\n2. Common Technical Practices Section: This section covers a range of technical practices that are commonly used within REG. It acknowledges that there may be multiple ways to achieve the same goal, but provides a starting point for new contributors.\n3. Contributors Table: The handbook includes a table that captures information about everyone who has contributed to the project, including their name, role, and how they have contributed. This table is generated and maintained using All Contributors.\n4. Technical Practices: The handbook provides detailed information on various technical practices used within REG, such as coding standards, software development processes, and testing methods.\n5. Contributor Roles: The handbook defines different contributor roles within REG, including maintainers, developers, and reviewers. It also provides guidelines for each role to help new contributors understand their responsibilities and how they can contribute to the project.\n6. Communication Channels: The handbook outlines various communication channels used by REG, including email lists, Slack channels, and GitHub issues. It provides guidance on how to use these channels effectively and encourages new joiners to participate in discussions.\n7. Meetings and Events: The handbook mentions regular meetings and events held within REG, such as the weekly team meeting and the annual retreat. It provides information on how to attend these events and what to expect.\n8. Code of Conduct: The handbook includes a code of conduct that outlines the expected behavior and ethical standards for all contributors. It encourages new joiners to familiarize themselves with the code of conduct and adhere to it throughout their contributions.\n9. Glossary: The handbook provides a glossary of common terms used within REG, which can help new joiners understand technical concepts and jargon used by the team.\n10. Version Control: The handbook mentions the use of Git for version control and provides guidelines on how to use it effectively. It encourages new join\n\n\nI read the following documents to compose this answer:\nhttps://alan-turing-institute.github.io/REG-handbook/docs/onboarding/new_joiners/ (similarity: 0.29)\n\nhttps://alan-turing-institute.github.io/REG-handbook/docs/technical_practices/ (similarity: 0.263)\n\nhttps://alan-turing-institute.github.io/REG-handbook/docs/contributors/ (similarity: 0.261)"}, proxy: {}, headers: {'Content-Type': 'application/json;charset=utf-8', 'Authorization': '(redacted)', 'User-Agent': 'Python/3.11.4 slackclient/3.22.0 Darwin/21.6.0'}
2023-09-15 14:26:09 [   DEBUG] Received message (type: PING, data: bytearray(b'Ping from applink-9'), extra: , session: s_1188886077)
2023-09-15 14:26:09 [ WARNING] Failed to send a ping message (s_1188886077): Cannot write to closing transport
2023-09-15 14:26:09 [    INFO] The session (s_1188886077) seems to be stale. Reconnecting... reason: disconnected for 55+ seconds)
2023-09-15 14:26:09 [   DEBUG] Inactive connection detected (session_id: s_1188886077, closed: False, stale: True, current_session.closed: False, is_ping_pong_failing: False)
2023-09-15 14:26:09 [   DEBUG] Sending a request - url: POST https://www.slack.com/api/apps.connections.open, params: {}, files: {}, data: {}, json: {}, proxy: {}, headers: {'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': '(redacted)', 'User-Agent': 'Python/3.11.4 slackclient/3.22.0 Darwin/21.6.0'}
2023-09-15 14:26:09 [   ERROR] Task exception was never retrieved
future: <Task finished name='Task-20' coro=<WebSocketWriter.ping() done, defined at /Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py:672> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 676, in ping
    await self._send_frame(message, WSMsgType.PING)
  File "/Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 646, in _send_frame
    self._write(header + mask + message)
  File "/Users/rwood/Library/Caches/pypoetry/virtualenvs/reginald-slack-ZVq5BSHv-py3.11/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 663, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
2023-09-15 14:26:09 [   DEBUG] Received the following response - status: 200, headers: {'Date': 'Fri, 15 Sep 2023 13:26:09 GMT', 'Server': 'Apache', 'Vary': 'Accept-Encoding', 'x-slack-req-id': 'fe302764e6012464992e730120b8496a', 'x-content-type-options': 'nosniff', 'x-xss-protection': '0', 'x-robots-tag': 'noindex,nofollow', 'Pragma': 'no-cache', 'Cache-Control': 'private, no-cache, no-store, must-revalidate', 'Expires': 'Sat, 26 Jul 1997 05:00:00 GMT', 'Content-Type': 'application/json; charset=utf-8', 'x-accepted-oauth-scopes': 'connections:write', 'x-oauth-scopes': 'connections:write', 'Access-Control-Expose-Headers': 'x-slack-req-id, retry-after', 'Access-Control-Allow-Headers': 'slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, x-b3-sampled, x-b3-flags', 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload', 'x-slack-unique-id': 'ZQRbcf1oGoUwjBwaCkzGYgAAEAk', 'x-slack-backend': 'r', 'referrer-policy': 'no-referrer', 'Access-Control-Allow-Origin': '*', 'Via': '1.1 slack-prod.tinyspeck.com, envoy-www-iad-wnbrswal, envoy-edge-lhr-ccfgevbs', 'Content-Encoding': 'gzip', 'Content-Length': '164', 'x-envoy-upstream-service-time': '88', 'x-backend': 'main_normal main_canary_with_overflow main_control_with_overflow', 'x-server': 'slack-www-hhvm-main-iad-whdq', 'x-slack-shared-secret-outcome': 'no-match', 'x-edge-backend': 'envoy-www', 'x-slack-edge-shared-secret-outcome': 'no-match'}, body: {'ok': True, 'url': 'wss://wss-primary.slack.com/link/?ticket=4009a105-60f8-4c0b-9a50-5c233d558321&app_id=343e1fe7f52dc2ac7733a333c33ada4fe2490af99e1f4a628a0f760bc100f5f4'}
2023-09-15 14:26:09 [   DEBUG] Received the following response - status: 200, headers: {'Date': 'Fri, 15 Sep 2023 13:26:09 GMT', 'Server': 'Apache', 'Vary': 'Accept-Encoding', 'x-slack-req-id': 'cea083673fa96f818e5da063753be148', 'x-content-type-options': 'nosniff', 'x-xss-protection': '0', 'Pragma': 'no-cache', 'Cache-Control': 'private, no-cache, no-store, must-revalidate', 'Expires': 'Sat, 26 Jul 1997 05:00:00 GMT', 'Content-Type': 'application/json; charset=utf-8', 'x-accepted-oauth-scopes': 'chat:write', 'x-oauth-scopes': 'commands,im:history,reactions:write,chat:write,im:write,emoji:read,reactions:read,app_mentions:read,im:read,incoming-webhook,channels:history,chat:write.public,users.profile:read', 'Access-Control-Expose-Headers': 'x-slack-req-id, retry-after', 'Access-Control-Allow-Headers': 'slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, x-b3-sampled, x-b3-flags', 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload', 'x-slack-unique-id': 'ZQRbcac4ks87bmeI4cc8VgAAECA', 'x-slack-backend': 'r', 'referrer-policy': 'no-referrer', 'Access-Control-Allow-Origin': '*', 'Via': '1.1 slack-prod.tinyspeck.com, envoy-www-iad-fnwsgjur, envoy-edge-lhr-fwmhkrgi', 'Content-Encoding': 'gzip', 'Content-Length': '1607', 'x-envoy-upstream-service-time': '160', 'x-backend': 'main_normal main_canary_with_overflow main_control_with_overflow', 'x-server': 'slack-www-hhvm-main-iad-swic', 'x-slack-shared-secret-outcome': 'no-match', 'x-edge-backend': 'envoy-www', 'x-slack-edge-shared-secret-outcome': 'no-match'}, body: {'ok': True, 'channel': 'D05S24S030D', 'ts': '1694784369.439019', 'message': {'bot_id': 'B05RYHKFR7V', 'type': 'message', 'text': "<@U05RHDQC71Q>, you asked me: 'reginald'.\n  Based on the provided context information, here are some key points about the REG Handbook:\n1. New Joiners Section: This section of the handbook is designed to help new members of REG get up to speed with the team's processes and practices. It provides an overview of the first few days of systems setup and important information for new joiners.\n2. Common Technical Practices Section: This section covers a range of technical practices that are commonly used within REG. It acknowledges that there may be multiple ways to achieve the same goal, but provides a starting point for new contributors.\n3. Contributors Table: The handbook includes a table that captures information about everyone who has contributed to the project, including their name, role, and how they have contributed. This table is generated and maintained using All Contributors.\n4. Technical Practices: The handbook provides detailed information on various technical practices used within REG, such as coding standards, software development processes, and testing methods.\n5. Contributor Roles: The handbook defines different contributor roles within REG, including maintainers, developers, and reviewers. It also provides guidelines for each role to help new contributors understand their responsibilities and how they can contribute to the project.\n6. Communication Channels: The handbook outlines various communication channels used by REG, including email lists, Slack channels, and GitHub issues. It provides guidance on how to use these channels effectively and encourages new joiners to participate in discussions.\n7. Meetings and Events: The handbook mentions regular meetings and events held within REG, such as the weekly team meeting and the annual retreat. It provides information on how to attend these events and what to expect.\n8. Code of Conduct: The handbook includes a code of conduct that outlines the expected behavior and ethical standards for all contributors. It encourages new joiners to familiarize themselves with the code of conduct and adhere to it throughout their contributions.\n9. Glossary: The handbook provides a glossary of common terms used within REG, which can help new joiners understand technical concepts and jargon used by the team.\n10. Version Control: The handbook mentions the use of Git for version control and provides guidelines on how to use it effectively. It encourages new join\n\n\nI read the following documents to compose this answer:\n<https://alan-turing-institute.github.io/REG-handbook/docs/onboarding/new_joiners/> (similarity: 0.29)\n\n<https://alan-turing-institute.github.io/REG-handbook/docs/technical_practices/> (similarity: 0.263)\n\n<https://alan-turing-institute.github.io/REG-handbook/docs/contributors/> (similarity: 0.261)", 'user': 'U05RJ4R1V1D', 'ts': '1694784369.439019', 'app_id': 'A05RS0R47SA', 'blocks': [{'type': 'rich_text', 'block_id': 'JEFn', 'elements': [{'type': 'rich_text_section', 'elements': [{'type': 'user', 'user_id': 'U05RHDQC71Q'}, {'type': 'text', 'text': ", you asked me: 'reginald'.\n  Based on the provided context information, here are some key points about the REG Handbook:\n1. New Joiners Section: This section of the handbook is designed to help new members of REG get up to speed with the team's processes and practices. It provides an overview of the first few days of systems setup and important information for new joiners.\n2. Common Technical Practices Section: This section covers a range of technical practices that are commonly used within REG. It acknowledges that there may be multiple ways to achieve the same goal, but provides a starting point for new contributors.\n3. Contributors Table: The handbook includes a table that captures information about everyone who has contributed to the project, including their name, role, and how they have contributed. This table is generated and maintained using All Contributors.\n4. Technical Practices: The handbook provides detailed information on various technical practices used within REG, such as coding standards, software development processes, and testing methods.\n5. Contributor Roles: The handbook defines different contributor roles within REG, including maintainers, developers, and reviewers. It also provides guidelines for each role to help new contributors understand their responsibilities and how they can contribute to the project.\n6. Communication Channels: The handbook outlines various communication channels used by REG, including email lists, Slack channels, and GitHub issues. It provides guidance on how to use these channels effectively and encourages new joiners to participate in discussions.\n7. Meetings and Events: The handbook mentions regular meetings and events held within REG, such as the weekly team meeting and the annual retreat. It provides information on how to attend these events and what to expect.\n8. Code of Conduct: The handbook includes a code of conduct that outlines the expected behavior and ethical standards for all contributors. It encourages new joiners to familiarize themselves with the code of conduct and adhere to it throughout their contributions.\n9. Glossary: The handbook provides a glossary of common terms used within REG, which can help new joiners understand technical concepts and jargon used by the team.\n10. Version Control: The handbook mentions the use of Git for version control and provides guidelines on how to use it effectively. It encourages new join\n\n\n\nI read the following documents to compose this answer:\n"}, {'type': 'link', 'url': 'https://alan-turing-institute.github.io/REG-handbook/docs/onboarding/new_joiners/'}, {'type': 'text', 'text': ' (similarity: 0.29)\n\n'}, {'type': 'link', 'url': 'https://alan-turing-institute.github.io/REG-handbook/docs/technical_practices/'}, {'type': 'text', 'text': ' (similarity: 0.263)\n\n'}, {'type': 'link', 'url': 'https://alan-turing-institute.github.io/REG-handbook/docs/contributors/'}, {'type': 'text', 'text': ' (similarity: 0.261)'}]}]}], 'team': 'T057SAAS0K0', 'bot_profile': {'id': 'B05RYHKFR7V', 'app_id': 'A05RS0R47SA', 'name': 'ReginaldDev', 'icons': {'image_36': 'https://a.slack-edge.com/80588/img/plugins/app/bot_36.png', 'image_48': 'https://a.slack-edge.com/80588/img/plugins/app/bot_48.png', 'image_72': 'https://a.slack-edge.com/80588/img/plugins/app/service_72.png'}, 'deleted': False, 'updated': 1694514408, 'team_id': 'T057SAAS0K0'}}}
2023-09-15 14:26:09 [    INFO] A new session (s_1190137029) has been established
2023-09-15 14:26:09 [   DEBUG] Sending a ping message with the newly established connection (s_1190137029)...
2023-09-15 14:26:09 [   DEBUG] A new monitor_current_session() executor has been recreated for s_1190137029
2023-09-15 14:26:09 [   DEBUG] A new receive_messages() executor has been recreated for s_1190137029
2023-09-15 14:26:09 [    INFO] The old session (s_1188886077) has been abandoned
2023-09-15 14:26:09 [   DEBUG] The monitor_current_session task for s_1188886077 is now cancelled
2023-09-15 14:26:09 [   DEBUG] A new monitor_current_session() execution loop for s_1190137029 started
2023-09-15 14:26:09 [   DEBUG] A new receive_messages() execution loop with s_1190137029 started
2023-09-15 14:26:09 [   DEBUG] Received message (type: TEXT, data: {"type":"hello","num_connections":1,"debug_info":{"host":"applink-6","build_number":38,"approximate_connection_time":18060},"connection_info":{"app_id":"A05RS0R47SA"}}, extra: , session: s_1190137029)
2023-09-15 14:26:09 [   DEBUG] A new message enqueued (current queue size: 1, session: s_1190137029)
2023-09-15 14:26:09 [   DEBUG] Message processing started (type: hello, envelope_id: None, session: s_1190137029)
2023-09-15 14:26:09 [   DEBUG] Message processing completed (type: hello, envelope_id: None, session: s_1190137029)
2023-09-15 14:26:09 [   DEBUG] Received message (type: TEXT, data: {"envelope_id":"7d4f1c53-089f-476c-98be-69f01225c646","payload":{"token":"OEqSunrvpkP80Su25M5fdu4W","team_id":"T057SAAS0K0","context_team_id":"T057SAAS0K0","context_enterprise_id":null,"api_app_id":"A05RS0R47SA","event":{"bot_id":"B05RYHKFR7V","type":"message","text":"<@U05RHDQC71Q>, you asked me: 'reginald'.\n  Based on the provided context information, here are some key points about the REG Handbook:\n1. New Joiners Section: This section of the handbook is designed to help new members of REG get up to speed with the team's processes and practices. It provides an overview of the first few days of systems setup and important information for new joiners.\n2. Common Technical Practices Section: This section covers a range of technical practices that are commonly used within REG. It acknowledges that there may be multiple ways to achieve the same goal, but provides a starting point for new contributors.\n3. Contributors Table: The handbook includes a table that captures information about everyone who has contributed to the project, including their name, role, and how they have contributed. This table is generated and maintained using All Contributors.\n4. Technical Practices: The handbook provides detailed information on various technical practices used within REG, such as coding standards, software development processes, and testing methods.\n5. Contributor Roles: The handbook defines different contributor roles within REG, including maintainers, developers, and reviewers. It also provides guidelines for each role to help new contributors understand their responsibilities and how they can contribute to the project.\n6. Communication Channels: The handbook outlines various communication channels used by REG, including email lists, Slack channels, and GitHub issues. It provides guidance on how to use these channels effectively and encourages new joiners to participate in discussions.\n7. Meetings and Events: The handbook mentions regular meetings and events held within REG, such as the weekly team meeting and the annual retreat. It provides information on how to attend these events and what to expect.\n8. Code of Conduct: The handbook includes a code of conduct that outlines the expected behavior and ethical standards for all contributors. It encourages new joiners to familiarize themselves with the code of conduct and adhere to it throughout their contributions.\n9. Glossary: The handbook provides a glossary of common terms used within REG, which can help new joiners understand technical concepts and jargon used by the team.\n10. Version Control: The handbook mentions the use of Git for version control and provides guidelines on how to use it effectively. It encourages new join\n\n\nI read the following documents to compose this answer:\n<https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/onboarding\/new_joiners\/> (similarity: 0.29)\n\n<https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/technical_practices\/> (similarity: 0.263)\n\n<https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/contributors\/> (similarity: 0.261)","user":"U05RJ4R1V1D","ts":"1694784369.439019","app_id":"A05RS0R47SA","blocks":[{"type":"rich_text","block_id":"XJtr","elements":[{"type":"rich_text_section","elements":[{"type":"user","user_id":"U05RHDQC71Q"},{"type":"text","text":", you asked me: 'reginald'.\n  Based on the provided context information, here are some key points about the REG Handbook:\n1. New Joiners Section: This section of the handbook is designed to help new members of REG get up to speed with the team's processes and practices. It provides an overview of the first few days of systems setup and important information for new joiners.\n2. Common Technical Practices Section: This section covers a range of technical practices that are commonly used within REG. It acknowledges that there may be multiple ways to achieve the same goal, but provides a starting point for new contributors.\n3. Contributors Table: The handbook includes a table that captures information about everyone who has contributed to the project, including their name, role, and how they have contributed. This table is generated and maintained using All Contributors.\n4. Technical Practices: The handbook provides detailed information on various technical practices used within REG, such as coding standards, software development processes, and testing methods.\n5. Contributor Roles: The handbook defines different contributor roles within REG, including maintainers, developers, and reviewers. It also provides guidelines for each role to help new contributors understand their responsibilities and how they can contribute to the project.\n6. Communication Channels: The handbook outlines various communication channels used by REG, including email lists, Slack channels, and GitHub issues. It provides guidance on how to use these channels effectively and encourages new joiners to participate in discussions.\n7. Meetings and Events: The handbook mentions regular meetings and events held within REG, such as the weekly team meeting and the annual retreat. It provides information on how to attend these events and what to expect.\n8. Code of Conduct: The handbook includes a code of conduct that outlines the expected behavior and ethical standards for all contributors. It encourages new joiners to familiarize themselves with the code of conduct and adhere to it throughout their contributions.\n9. Glossary: The handbook provides a glossary of common terms used within REG, which can help new joiners understand technical concepts and jargon used by the team.\n10. Version Control: The handbook mentions the use of Git for version control and provides guidelines on how to use it effectively. It encourages new join\n\n\n\nI read the following documents to compose this answer:\n"},{"type":"link","url":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/onboarding\/new_joiners\/"},{"type":"text","text":" (similarity: 0.29)\n\n"},{"type":"link","url":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/technical_practices\/"},{"type":"text","text":" (similarity: 0.263)\n\n"},{"type":"link","url":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/contributors\/"},{"type":"text","text":" (similarity: 0.261)"}]}]}],"team":"T057SAAS0K0","bot_profile":{"id":"B05RYHKFR7V","deleted":false,"name":"ReginaldDev","updated":1694514408,"app_id":"A05RS0R47SA","icons":{"image_36":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/bot_36.png","image_48":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/bot_48.png","image_72":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/service_72.png"},"team_id":"T057SAAS0K0"},"channel":"D05S24S030D","event_ts":"1694784369.439019","channel_type":"im"},"type":"event_callback","event_id":"Ev05SBTAE7SA","event_time":1694784369,"authorizations":[{"enterprise_id":null,"team_id":"T057SAAS0K0","user_id":"U05RJ4R1V1D","is_bot":true,"is_enterprise_install":false}],"is_ext_shared_channel":false,"event_context":"4-eyJldCI6Im1lc3NhZ2UiLCJ0aWQiOiJUMDU3U0FBUzBLMCIsImFpZCI6IkEwNVJTMFI0N1NBIiwiY2lkIjoiRDA1UzI0UzAzMEQifQ"},"type":"events_api","accepts_response_payload":false,"retry_attempt":0,"retry_reason":""}, extra: , session: s_1190137029)
2023-09-15 14:26:09 [   DEBUG] A new message enqueued (current queue size: 1, session: s_1190137029)
2023-09-15 14:26:09 [   DEBUG] Message processing started (type: events_api, envelope_id: 7d4f1c53-089f-476c-98be-69f01225c646, session: s_1190137029)
2023-09-15 14:26:09 [    INFO] There are currently 1 items in the queue.
2023-09-15 14:26:09 [   DEBUG] Message processing completed (type: events_api, envelope_id: 7d4f1c53-089f-476c-98be-69f01225c646, session: s_1190137029)
2023-09-15 14:26:09 [    INFO] Received an events_api request
2023-09-15 14:26:09 [   DEBUG] Sending a message: {"envelope_id": "7d4f1c53-089f-476c-98be-69f01225c646"} from session: s_1190137029
2023-09-15 14:26:09 [    INFO] Ignoring an event triggered by a bot.
2023-09-15 14:26:09 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694784369.637907'), extra: , session: s_1190137029)
2023-09-15 14:26:10 [   DEBUG] Received message (type: TEXT, data: {"envelope_id":"230bd0b9-f6bd-45c0-8583-54344e2a8690","payload":{"token":"OEqSunrvpkP80Su25M5fdu4W","team_id":"T057SAAS0K0","context_team_id":"T057SAAS0K0","context_enterprise_id":null,"api_app_id":"A05RS0R47SA","event":{"type":"message","subtype":"message_changed","message":{"bot_id":"B05RYHKFR7V","type":"message","text":"<@U05RHDQC71Q>, you asked me: 'reginald'.\n  Based on the provided context information, here are some key points about the REG Handbook:\n1. New Joiners Section: This section of the handbook is designed to help new members of REG get up to speed with the team's processes and practices. It provides an overview of the first few days of systems setup and important information for new joiners.\n2. Common Technical Practices Section: This section covers a range of technical practices that are commonly used within REG. It acknowledges that there may be multiple ways to achieve the same goal, but provides a starting point for new contributors.\n3. Contributors Table: The handbook includes a table that captures information about everyone who has contributed to the project, including their name, role, and how they have contributed. This table is generated and maintained using All Contributors.\n4. Technical Practices: The handbook provides detailed information on various technical practices used within REG, such as coding standards, software development processes, and testing methods.\n5. Contributor Roles: The handbook defines different contributor roles within REG, including maintainers, developers, and reviewers. It also provides guidelines for each role to help new contributors understand their responsibilities and how they can contribute to the project.\n6. Communication Channels: The handbook outlines various communication channels used by REG, including email lists, Slack channels, and GitHub issues. It provides guidance on how to use these channels effectively and encourages new joiners to participate in discussions.\n7. Meetings and Events: The handbook mentions regular meetings and events held within REG, such as the weekly team meeting and the annual retreat. It provides information on how to attend these events and what to expect.\n8. Code of Conduct: The handbook includes a code of conduct that outlines the expected behavior and ethical standards for all contributors. It encourages new joiners to familiarize themselves with the code of conduct and adhere to it throughout their contributions.\n9. Glossary: The handbook provides a glossary of common terms used within REG, which can help new joiners understand technical concepts and jargon used by the team.\n10. Version Control: The handbook mentions the use of Git for version control and provides guidelines on how to use it effectively. It encourages new join\n\n\nI read the following documents to compose this answer:\n<https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/onboarding\/new_joiners\/> (similarity: 0.29)\n\n<https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/technical_practices\/> (similarity: 0.263)\n\n<https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/contributors\/> (similarity: 0.261)","user":"U05RJ4R1V1D","app_id":"A05RS0R47SA","blocks":[{"type":"rich_text","block_id":"WDPJ","elements":[{"type":"rich_text_section","elements":[{"type":"user","user_id":"U05RHDQC71Q"},{"type":"text","text":", you asked me: 'reginald'.\n  Based on the provided context information, here are some key points about the REG Handbook:\n1. New Joiners Section: This section of the handbook is designed to help new members of REG get up to speed with the team's processes and practices. It provides an overview of the first few days of systems setup and important information for new joiners.\n2. Common Technical Practices Section: This section covers a range of technical practices that are commonly used within REG. It acknowledges that there may be multiple ways to achieve the same goal, but provides a starting point for new contributors.\n3. Contributors Table: The handbook includes a table that captures information about everyone who has contributed to the project, including their name, role, and how they have contributed. This table is generated and maintained using All Contributors.\n4. Technical Practices: The handbook provides detailed information on various technical practices used within REG, such as coding standards, software development processes, and testing methods.\n5. Contributor Roles: The handbook defines different contributor roles within REG, including maintainers, developers, and reviewers. It also provides guidelines for each role to help new contributors understand their responsibilities and how they can contribute to the project.\n6. Communication Channels: The handbook outlines various communication channels used by REG, including email lists, Slack channels, and GitHub issues. It provides guidance on how to use these channels effectively and encourages new joiners to participate in discussions.\n7. Meetings and Events: The handbook mentions regular meetings and events held within REG, such as the weekly team meeting and the annual retreat. It provides information on how to attend these events and what to expect.\n8. Code of Conduct: The handbook includes a code of conduct that outlines the expected behavior and ethical standards for all contributors. It encourages new joiners to familiarize themselves with the code of conduct and adhere to it throughout their contributions.\n9. Glossary: The handbook provides a glossary of common terms used within REG, which can help new joiners understand technical concepts and jargon used by the team.\n10. Version Control: The handbook mentions the use of Git for version control and provides guidelines on how to use it effectively. It encourages new join\n\n\n\nI read the following documents to compose this answer:\n"},{"type":"link","url":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/onboarding\/new_joiners\/"},{"type":"text","text":" (similarity: 0.29)\n\n"},{"type":"link","url":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/technical_practices\/"},{"type":"text","text":" (similarity: 0.263)\n\n"},{"type":"link","url":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/contributors\/"},{"type":"text","text":" (similarity: 0.261)"}]}]}],"team":"T057SAAS0K0","bot_profile":{"id":"B05RYHKFR7V","deleted":false,"name":"ReginaldDev","updated":1694514408,"app_id":"A05RS0R47SA","icons":{"image_36":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/bot_36.png","image_48":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/bot_48.png","image_72":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/service_72.png"},"team_id":"T057SAAS0K0"},"attachments":[{"from_url":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/technical_practices\/","service_icon":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/favicon.png","id":2,"original_url":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/technical_practices\/","fallback":"Common Technical Practices","text":"Common Technical Practices # This section contains a section of common technical practices within REG. For many of the topics in this section, there may be many possible ways to achieve the same goal \u2014 which are debated at length elsewhere. The intention of this section is not to claim that any of the methods here are the \u201cbest\u201d (however defined). Merely that they are good enough to allow the reader to focus on other, more interesting, unique or important, aspects of their project.","title":"Common Technical Practices","title_link":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/technical_practices\/","service_name":"alan-turing-institute.github.io"},{"from_url":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/contributors\/","service_icon":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/favicon.png","id":3,"original_url":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/contributors\/","fallback":"Contributors","text":"Contributors # In this table we try to capture everyone who has contributed to the project and how they have contributed. The table is generated and maintained using All Contributors.\nAndy Smith\n:lower_left_fountain_pen: :eyes: :thinking_face: :computer: :art: Christina Last\n:lower_left_fountain_pen: David Beavan\n:thinking_face: :eyes: David Llewellyn-Jones\n:lower_left_fountain_pen: :thinking_face: :bug: :book: :eyes: David Salvador Jasin\n:lower_left_fountain_pen: Federico Nanni\n:lower_left_fountain_pen: :thinking_face: Gabriel\n:lower_left_fountain_pen: :thinking_face: Isabel Fenton\n:eyes: Jack Roberts\n:lower_left_fountain_pen: James Robinson","title":"Contributors","title_link":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/contributors\/","service_name":"alan-turing-institute.github.io"}],"ts":"1694784369.439019"},"previous_message":{"bot_id":"B05RYHKFR7V","type":"message","text":"<@U05RHDQC71Q>, you asked me: 'reginald'.\n  Based on the provided context information, here are some key points about the REG Handbook:\n1. New Joiners Section: This section of the handbook is designed to help new members of REG get up to speed with the team's processes and practices. It provides an overview of the first few days of systems setup and important information for new joiners.\n2. Common Technical Practices Section: This section covers a range of technical practices that are commonly used within REG. It acknowledges that there may be multiple ways to achieve the same goal, but provides a starting point for new contributors.\n3. Contributors Table: The handbook includes a table that captures information about everyone who has contributed to the project, including their name, role, and how they have contributed. This table is generated and maintained using All Contributors.\n4. Technical Practices: The handbook provides detailed information on various technical practices used within REG, such as coding standards, software development processes, and testing methods.\n5. Contributor Roles: The handbook defines different contributor roles within REG, including maintainers, developers, and reviewers. It also provides guidelines for each role to help new contributors understand their responsibilities and how they can contribute to the project.\n6. Communication Channels: The handbook outlines various communication channels used by REG, including email lists, Slack channels, and GitHub issues. It provides guidance on how to use these channels effectively and encourages new joiners to participate in discussions.\n7. Meetings and Events: The handbook mentions regular meetings and events held within REG, such as the weekly team meeting and the annual retreat. It provides information on how to attend these events and what to expect.\n8. Code of Conduct: The handbook includes a code of conduct that outlines the expected behavior and ethical standards for all contributors. It encourages new joiners to familiarize themselves with the code of conduct and adhere to it throughout their contributions.\n9. Glossary: The handbook provides a glossary of common terms used within REG, which can help new joiners understand technical concepts and jargon used by the team.\n10. Version Control: The handbook mentions the use of Git for version control and provides guidelines on how to use it effectively. It encourages new join\n\n\nI read the following documents to compose this answer:\n<https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/onboarding\/new_joiners\/> (similarity: 0.29)\n\n<https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/technical_practices\/> (similarity: 0.263)\n\n<https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/contributors\/> (similarity: 0.261)","user":"U05RJ4R1V1D","ts":"1694784369.439019","app_id":"A05RS0R47SA","blocks":[{"type":"rich_text","block_id":"w4K9","elements":[{"type":"rich_text_section","elements":[{"type":"user","user_id":"U05RHDQC71Q"},{"type":"text","text":", you asked me: 'reginald'.\n  Based on the provided context information, here are some key points about the REG Handbook:\n1. New Joiners Section: This section of the handbook is designed to help new members of REG get up to speed with the team's processes and practices. It provides an overview of the first few days of systems setup and important information for new joiners.\n2. Common Technical Practices Section: This section covers a range of technical practices that are commonly used within REG. It acknowledges that there may be multiple ways to achieve the same goal, but provides a starting point for new contributors.\n3. Contributors Table: The handbook includes a table that captures information about everyone who has contributed to the project, including their name, role, and how they have contributed. This table is generated and maintained using All Contributors.\n4. Technical Practices: The handbook provides detailed information on various technical practices used within REG, such as coding standards, software development processes, and testing methods.\n5. Contributor Roles: The handbook defines different contributor roles within REG, including maintainers, developers, and reviewers. It also provides guidelines for each role to help new contributors understand their responsibilities and how they can contribute to the project.\n6. Communication Channels: The handbook outlines various communication channels used by REG, including email lists, Slack channels, and GitHub issues. It provides guidance on how to use these channels effectively and encourages new joiners to participate in discussions.\n7. Meetings and Events: The handbook mentions regular meetings and events held within REG, such as the weekly team meeting and the annual retreat. It provides information on how to attend these events and what to expect.\n8. Code of Conduct: The handbook includes a code of conduct that outlines the expected behavior and ethical standards for all contributors. It encourages new joiners to familiarize themselves with the code of conduct and adhere to it throughout their contributions.\n9. Glossary: The handbook provides a glossary of common terms used within REG, which can help new joiners understand technical concepts and jargon used by the team.\n10. Version Control: The handbook mentions the use of Git for version control and provides guidelines on how to use it effectively. It encourages new join\n\n\n\nI read the following documents to compose this answer:\n"},{"type":"link","url":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/onboarding\/new_joiners\/"},{"type":"text","text":" (similarity: 0.29)\n\n"},{"type":"link","url":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/technical_practices\/"},{"type":"text","text":" (similarity: 0.263)\n\n"},{"type":"link","url":"https:\/\/alan-turing-institute.github.io\/REG-handbook\/docs\/contributors\/"},{"type":"text","text":" (similarity: 0.261)"}]}]}],"team":"T057SAAS0K0","bot_profile":{"id":"B05RYHKFR7V","app_id":"A05RS0R47SA","name":"ReginaldDev","icons":{"image_36":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/bot_36.png","image_48":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/bot_48.png","image_72":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/service_72.png"},"deleted":false,"updated":1694514408,"team_id":"T057SAAS0K0"}},"channel":"D05S24S030D","hidden":true,"ts":"1694784370.004000","event_ts":"1694784370.004000","channel_type":"im"},"type":"event_callback","event_id":"Ev05T7GKPNV6","event_time":1694784370,"authorizations":[{"enterprise_id":null,"team_id":"T057SAAS0K0","user_id":"U05RJ4R1V1D","is_bot":true,"is_enterprise_install":false}],"is_ext_shared_channel":false,"event_context":"4-eyJldCI6Im1lc3NhZ2UiLCJ0aWQiOiJUMDU3U0FBUzBLMCIsImFpZCI6IkEwNVJTMFI0N1NBIiwiY2lkIjoiRDA1UzI0UzAzMEQifQ"},"type":"events_api","accepts_response_payload":false,"retry_attempt":0,"retry_reason":""}, extra: , session: s_1190137029)
2023-09-15 14:26:10 [   DEBUG] A new message enqueued (current queue size: 1, session: s_1190137029)
2023-09-15 14:26:10 [   DEBUG] Message processing started (type: events_api, envelope_id: 230bd0b9-f6bd-45c0-8583-54344e2a8690, session: s_1190137029)
2023-09-15 14:26:10 [    INFO] There are currently 1 items in the queue.
2023-09-15 14:26:10 [   DEBUG] Message processing completed (type: events_api, envelope_id: 230bd0b9-f6bd-45c0-8583-54344e2a8690, session: s_1190137029)
2023-09-15 14:26:10 [    INFO] Received an events_api request
2023-09-15 14:26:10 [   DEBUG] Sending a message: {"envelope_id": "230bd0b9-f6bd-45c0-8583-54344e2a8690"} from session: s_1190137029
2023-09-15 14:26:10 [    INFO] Ignoring hidden message.
2023-09-15 14:26:14 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694784374.640385'), extra: , session: s_1190137029)

I feel like this might be the bit we need to care about

2023-09-15 14:26:09 [   DEBUG] Received message (type: PING, data: bytearray(b'Ping from applink-9'), extra: , session: s_1188886077)
2023-09-15 14:26:09 [ WARNING] Failed to send a ping message (s_1188886077): Cannot write to closing transport
2023-09-15 14:26:09 [    INFO] The session (s_1188886077) seems to be stale. Reconnecting... reason: disconnected for 55+ seconds)
rwood-97 commented 1 year ago

2023-09-15 15:38:55 [    INFO] Connecting to Slack...
2023-09-15 15:38:55 [   DEBUG] Sending a request - url: POST https://www.slack.com/api/apps.connections.open, params: {}, files: {}, data: {}, json: {}, proxy: {}, headers: {'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': '(redacted)', 'User-Agent': 'Python/3.11.4 slackclient/3.22.0 Darwin/21.6.0'}
2023-09-15 15:38:55 [   DEBUG] Received the following response - status: 200, headers: {'Date': 'Fri, 15 Sep 2023 14:38:55 GMT', 'Server': 'Apache', 'Vary': 'Accept-Encoding', 'x-slack-req-id': '5d61d10aa415ceed163d3894aa627213', 'x-content-type-options': 'nosniff', 'x-xss-protection': '0', 'x-robots-tag': 'noindex,nofollow', 'Pragma': 'no-cache', 'Cache-Control': 'private, no-cache, no-store, must-revalidate', 'Expires': 'Sat, 26 Jul 1997 05:00:00 GMT', 'Content-Type': 'application/json; charset=utf-8', 'x-accepted-oauth-scopes': 'connections:write', 'x-oauth-scopes': 'connections:write', 'Access-Control-Expose-Headers': 'x-slack-req-id, retry-after', 'Access-Control-Allow-Headers': 'slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, x-b3-sampled, x-b3-flags', 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload', 'x-slack-unique-id': 'ZQRsf4cFV2oVmtO88mirowAAEBk', 'x-slack-backend': 'r', 'referrer-policy': 'no-referrer', 'Access-Control-Allow-Origin': '*', 'Via': '1.1 slack-prod.tinyspeck.com, envoy-www-iad-rzmgrvpe, envoy-edge-lhr-tllxfttp', 'Content-Encoding': 'gzip', 'Content-Length': '164', 'x-envoy-upstream-service-time': '89', 'x-backend': 'main_normal main_canary_with_overflow main_control_with_overflow', 'x-server': 'slack-www-hhvm-main-iad-lkdu', 'x-slack-shared-secret-outcome': 'no-match', 'x-edge-backend': 'envoy-www', 'x-slack-edge-shared-secret-outcome': 'no-match'}, body: {'ok': True, 'url': 'wss://wss-primary.slack.com/link/?ticket=71e2d141-413d-4296-9b23-acfa523a0140&app_id=343e1fe7f52dc2ac7733a333c33ada4fe2490af99e1f4a628a0f760bc100f5f4'}
2023-09-15 15:38:55 [    INFO] A new session (s_1186995781) has been established
2023-09-15 15:38:55 [   DEBUG] Sending a ping message with the newly established connection (s_1186995781)...
2023-09-15 15:38:55 [   DEBUG] A new monitor_current_session() executor has been recreated for s_1186995781
2023-09-15 15:38:55 [   DEBUG] A new receive_messages() executor has been recreated for s_1186995781
2023-09-15 15:38:55 [    INFO] Listening for requests...
2023-09-15 15:38:55 [   DEBUG] A new monitor_current_session() execution loop for s_1186995781 started
2023-09-15 15:38:55 [   DEBUG] A new receive_messages() execution loop with s_1186995781 started
2023-09-15 15:38:55 [   DEBUG] Received message (type: TEXT, data: {"type":"hello","num_connections":1,"debug_info":{"host":"applink-3","build_number":38,"approximate_connection_time":18060},"connection_info":{"app_id":"A05RS0R47SA"}}, extra: , session: s_1186995781)
2023-09-15 15:38:55 [   DEBUG] A new message enqueued (current queue size: 1, session: s_1186995781)
2023-09-15 15:38:55 [   DEBUG] Message processing started (type: hello, envelope_id: None, session: s_1186995781)
2023-09-15 15:38:55 [   DEBUG] Message processing completed (type: hello, envelope_id: None, session: s_1186995781)
2023-09-15 15:38:56 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694788735.9637928'), extra: , session: s_1186995781)
2023-09-15 15:38:59 [   DEBUG] Received message (type: PING, data: bytearray(b'Ping from applink-3'), extra: , session: s_1186995781)
2023-09-15 15:39:01 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694788740.9655292'), extra: , session: s_1186995781)
2023-09-15 15:39:06 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694788745.967366'), extra: , session: s_1186995781)
2023-09-15 15:39:09 [   DEBUG] Received message (type: PING, data: bytearray(b'Ping from applink-3'), extra: , session: s_1186995781)
2023-09-15 15:39:11 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694788750.969259'), extra: , session: s_1186995781)
2023-09-15 15:39:13 [   DEBUG] Received message (type: TEXT, data: {"envelope_id":"8bd2ea64-6b01-4a93-a3d6-42138e2a8919","payload":{"token":"OEqSunrvpkP80Su25M5fdu4W","team_id":"T057SAAS0K0","context_team_id":"T057SAAS0K0","context_enterprise_id":null,"api_app_id":"A05RS0R47SA","event":{"client_msg_id":"5b7cfd03-9bfa-4c3b-b37c-a045a38ea45c","type":"message","text":"hi","user":"U05RHDQC71Q","ts":"1694788752.862849","blocks":[{"type":"rich_text","block_id":"clI","elements":[{"type":"rich_text_section","elements":[{"type":"text","text":"hi"}]}]}],"team":"T057SAAS0K0","channel":"D05S24S030D","event_ts":"1694788752.862849","channel_type":"im"},"type":"event_callback","event_id":"Ev05SG2WJSDT","event_time":1694788752,"authorizations":[{"enterprise_id":null,"team_id":"T057SAAS0K0","user_id":"U05RJ4R1V1D","is_bot":true,"is_enterprise_install":false}],"is_ext_shared_channel":false,"event_context":"4-eyJldCI6Im1lc3NhZ2UiLCJ0aWQiOiJUMDU3U0FBUzBLMCIsImFpZCI6IkEwNVJTMFI0N1NBIiwiY2lkIjoiRDA1UzI0UzAzMEQifQ"},"type":"events_api","accepts_response_payload":false,"retry_attempt":0,"retry_reason":""}, extra: , session: s_1186995781)
2023-09-15 15:39:13 [   DEBUG] A new message enqueued (current queue size: 1, session: s_1186995781)
2023-09-15 15:39:13 [   DEBUG] Message processing started (type: events_api, envelope_id: 8bd2ea64-6b01-4a93-a3d6-42138e2a8919, session: s_1186995781)
2023-09-15 15:39:13 [    INFO] There are currently 1 items in the queue.
2023-09-15 15:39:13 [   DEBUG] Message processing completed (type: events_api, envelope_id: 8bd2ea64-6b01-4a93-a3d6-42138e2a8919, session: s_1186995781)
2023-09-15 15:39:13 [    INFO] Received an events_api request
2023-09-15 15:39:13 [   DEBUG] Sending a message: {"envelope_id": "8bd2ea64-6b01-4a93-a3d6-42138e2a8919"} from session: s_1186995781
2023-09-15 15:39:13 [    INFO] Processing message 'hi' from user 'U05RHDQC71Q'.
2023-09-15 15:39:13 [    INFO] Reacting with emoji llama.
2023-09-15 15:39:13 [   DEBUG] Sending a request - url: POST https://www.slack.com/api/reactions.add, params: {'channel': 'D05S24S030D', 'name': 'llama', 'timestamp': '1694788752.862849'}, files: {}, data: {}, json: {}, proxy: {}, headers: {'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': '(redacted)', 'User-Agent': 'Python/3.11.4 slackclient/3.22.0 Darwin/21.6.0'}
2023-09-15 15:39:13 [   DEBUG] Received the following response - status: 200, headers: {'Date': 'Fri, 15 Sep 2023 14:39:13 GMT', 'Server': 'Apache', 'Vary': 'Accept-Encoding', 'x-slack-req-id': '08f2ef54487e655797fadd239edf8515', 'x-content-type-options': 'nosniff', 'x-xss-protection': '0', 'Pragma': 'no-cache', 'Cache-Control': 'private, no-cache, no-store, must-revalidate', 'Expires': 'Sat, 26 Jul 1997 05:00:00 GMT', 'Content-Type': 'application/json; charset=utf-8', 'x-accepted-oauth-scopes': 'reactions:write', 'x-oauth-scopes': 'commands,im:history,reactions:write,chat:write,im:write,emoji:read,reactions:read,app_mentions:read,im:read,incoming-webhook,channels:history,chat:write.public,users.profile:read', 'Access-Control-Expose-Headers': 'x-slack-req-id, retry-after', 'Access-Control-Allow-Headers': 'slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, x-b3-sampled, x-b3-flags', 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload', 'x-slack-unique-id': 'ZQRskSjup_PR6AC2HGBA5QAAAAU', 'x-slack-backend': 'r', 'referrer-policy': 'no-referrer', 'Access-Control-Allow-Origin': '*', 'Content-Length': '11', 'Via': '1.1 slack-prod.tinyspeck.com, envoy-www-iad-unnkxsth, envoy-edge-lhr-xjrpltzj', 'x-envoy-upstream-service-time': '161', 'x-backend': 'main_normal main_canary_with_overflow main_control_with_overflow', 'x-server': 'slack-www-hhvm-main-iad-pqjf', 'x-slack-shared-secret-outcome': 'no-match', 'x-edge-backend': 'envoy-www', 'x-slack-edge-shared-secret-outcome': 'no-match'}, body: {'ok': True}
2023-09-15 15:39:13 [    INFO] Posting reply Hi Rosie.
2023-09-15 15:39:13 [   DEBUG] Sending a request - url: POST https://www.slack.com/api/chat.postMessage, params: {}, files: {}, data: {}, json: {'channel': 'D05S24S030D', 'text': "<@U05RHDQC71Q>, you asked me: 'hi'.\nHi Rosie"}, proxy: {}, headers: {'Content-Type': 'application/json;charset=utf-8', 'Authorization': '(redacted)', 'User-Agent': 'Python/3.11.4 slackclient/3.22.0 Darwin/21.6.0'}
2023-09-15 15:39:13 [   DEBUG] Received the following response - status: 200, headers: {'Date': 'Fri, 15 Sep 2023 14:39:13 GMT', 'Server': 'Apache', 'Vary': 'Accept-Encoding', 'x-slack-req-id': '40320d43b13872b262b932b8815e8ac2', 'x-content-type-options': 'nosniff', 'x-xss-protection': '0', 'Pragma': 'no-cache', 'Cache-Control': 'private, no-cache, no-store, must-revalidate', 'Expires': 'Sat, 26 Jul 1997 05:00:00 GMT', 'Content-Type': 'application/json; charset=utf-8', 'x-accepted-oauth-scopes': 'chat:write', 'x-oauth-scopes': 'commands,im:history,reactions:write,chat:write,im:write,emoji:read,reactions:read,app_mentions:read,im:read,incoming-webhook,channels:history,chat:write.public,users.profile:read', 'Access-Control-Expose-Headers': 'x-slack-req-id, retry-after', 'Access-Control-Allow-Headers': 'slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, x-b3-sampled, x-b3-flags', 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload', 'x-slack-unique-id': 'ZQRskQWmOpzXIrpo_wyALAAAAAI', 'x-slack-backend': 'r', 'referrer-policy': 'no-referrer', 'Access-Control-Allow-Origin': '*', 'Via': '1.1 slack-prod.tinyspeck.com, envoy-www-iad-mwzrnrdz, envoy-edge-lhr-xuioagyx', 'Content-Encoding': 'gzip', 'Content-Length': '425', 'x-envoy-upstream-service-time': '128', 'x-backend': 'main_normal main_canary_with_overflow main_control_with_overflow', 'x-server': 'slack-www-hhvm-main-iad-ccqq', 'x-slack-shared-secret-outcome': 'no-match', 'x-edge-backend': 'envoy-www', 'x-slack-edge-shared-secret-outcome': 'no-match'}, body: {'ok': True, 'channel': 'D05S24S030D', 'ts': '1694788753.444029', 'message': {'bot_id': 'B05RYHKFR7V', 'type': 'message', 'text': "<@U05RHDQC71Q>, you asked me: 'hi'.\nHi Rosie", 'user': 'U05RJ4R1V1D', 'ts': '1694788753.444029', 'app_id': 'A05RS0R47SA', 'blocks': [{'type': 'rich_text', 'block_id': 'RXe/', 'elements': [{'type': 'rich_text_section', 'elements': [{'type': 'user', 'user_id': 'U05RHDQC71Q'}, {'type': 'text', 'text': ", you asked me: 'hi'.\nHi Rosie"}]}]}], 'team': 'T057SAAS0K0', 'bot_profile': {'id': 'B05RYHKFR7V', 'app_id': 'A05RS0R47SA', 'name': 'ReginaldDev', 'icons': {'image_36': 'https://a.slack-edge.com/80588/img/plugins/app/bot_36.png', 'image_48': 'https://a.slack-edge.com/80588/img/plugins/app/bot_48.png', 'image_72': 'https://a.slack-edge.com/80588/img/plugins/app/service_72.png'}, 'deleted': False, 'updated': 1694514408, 'team_id': 'T057SAAS0K0'}}}
2023-09-15 15:39:14 [   DEBUG] Received message (type: TEXT, data: {"envelope_id":"bedd7dc2-8215-4e0d-aa3a-0bca057b259f","payload":{"token":"OEqSunrvpkP80Su25M5fdu4W","team_id":"T057SAAS0K0","context_team_id":"T057SAAS0K0","context_enterprise_id":null,"api_app_id":"A05RS0R47SA","event":{"bot_id":"B05RYHKFR7V","type":"message","text":"<@U05RHDQC71Q>, you asked me: 'hi'.\nHi Rosie","user":"U05RJ4R1V1D","ts":"1694788753.444029","app_id":"A05RS0R47SA","blocks":[{"type":"rich_text","block_id":"S1==a","elements":[{"type":"rich_text_section","elements":[{"type":"user","user_id":"U05RHDQC71Q"},{"type":"text","text":", you asked me: 'hi'.\nHi Rosie"}]}]}],"team":"T057SAAS0K0","bot_profile":{"id":"B05RYHKFR7V","deleted":false,"name":"ReginaldDev","updated":1694514408,"app_id":"A05RS0R47SA","icons":{"image_36":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/bot_36.png","image_48":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/bot_48.png","image_72":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/service_72.png"},"team_id":"T057SAAS0K0"},"channel":"D05S24S030D","event_ts":"1694788753.444029","channel_type":"im"},"type":"event_callback","event_id":"Ev05T80E5K6C","event_time":1694788753,"authorizations":[{"enterprise_id":null,"team_id":"T057SAAS0K0","user_id":"U05RJ4R1V1D","is_bot":true,"is_enterprise_install":false}],"is_ext_shared_channel":false,"event_context":"4-eyJldCI6Im1lc3NhZ2UiLCJ0aWQiOiJUMDU3U0FBUzBLMCIsImFpZCI6IkEwNVJTMFI0N1NBIiwiY2lkIjoiRDA1UzI0UzAzMEQifQ"},"type":"events_api","accepts_response_payload":false,"retry_attempt":0,"retry_reason":""}, extra: , session: s_1186995781)
2023-09-15 15:39:14 [   DEBUG] A new message enqueued (current queue size: 1, session: s_1186995781)
2023-09-15 15:39:14 [   DEBUG] Message processing started (type: events_api, envelope_id: bedd7dc2-8215-4e0d-aa3a-0bca057b259f, session: s_1186995781)
2023-09-15 15:39:14 [    INFO] There are currently 1 items in the queue.
2023-09-15 15:39:14 [   DEBUG] Message processing completed (type: events_api, envelope_id: bedd7dc2-8215-4e0d-aa3a-0bca057b259f, session: s_1186995781)
2023-09-15 15:39:14 [    INFO] Received an events_api request
2023-09-15 15:39:14 [   DEBUG] Sending a message: {"envelope_id": "bedd7dc2-8215-4e0d-aa3a-0bca057b259f"} from session: s_1186995781
2023-09-15 15:39:14 [    INFO] Ignoring an event triggered by a bot.
2023-09-15 15:39:16 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694788755.971631'), extra: , session: s_1186995781)
2023-09-15 15:39:19 [   DEBUG] Received message (type: PING, data: bytearray(b'Ping from applink-3'), extra: , session: s_1186995781)
2023-09-15 15:39:21 [   DEBUG] Received message (type: PONG, data: bytearray(b'sdk-ping-pong:1694788760.97389'), extra: , session: s_1186995781)

Comparison if I remove the model part and just respond with "Hi Rosie" . ie.

            if event_type == "message" and event_subtype is None:
                await self.react(client, event["channel"], event["ts"])
                #model_response = self.model.direct_message(message, user_id)
                class tmp_class():
                    def __init__(self):
                        self.message = "Hi Rosie"

                model_response = tmp_class()

I think what might be happening is the connection closes because the model takes ages (or at least, longer than time out) when its running and there are no ping-pongs so it shuts. I will look further into code.