Skip to content

Conversation

@raiden-staging
Copy link
Contributor

[Issue #27]

Analysis

  • neko doesn't reply on event.CLIENT_HEARTBEAT in websockets handler
  • after handshake, ws events are (live client → neko instance) only - until peer disconnect event
  • debugging by having playwright connect/disconnect on same kernel browser session, to have neko emit event.MEMBER_CONNECT & event.MEMBER_DISCONNECT to the client every few seconds to keepalive. seems to work :)
kernel_debug_peer.mp4

both sessions have steady input.
left session has peer disconnect error 3x in the recorded interval.
right session, where neko sends new event to client every few secs (member notifications), has no peer disconnect error in the interval.


Fix

  • new raiden-staging/neko chromium build (neko/chromium:3.0.6-kernel-v1.1) sets a reduced heartbeat interval.
  • enabled chat on neko.yaml , sending dummy event.CHAT_MESSAGE alongside event.CLIENT_HEARTBEAT from client, as neko handler replies to the event.
  • (also added event.SYSTEM_HEARTBEAT in the neko src, will use it instead of the event.CHAT_MESSAGE workaround later if the approach works when deployed)

this could fix live view peer disconnections.


Notes

  • can't try on deployed unikraft cloud - my UKC_TOKEN has <8gb required memory quotas.
  • Docker build runs well. if someone can confirm on unikraft deployment would be cool 👍
  • other potential alternative would be to have a /ping route on the kernel-images/server and use that for heartbeat

this.sendMessage(EVENT.CLIENT.HEARTBEAT)
this.emit('debug', `sending chat/message`)
this.sendMessage(EVENT.CHAT.MESSAGE, { content: `heartbeat/fake [${Date.now()}]` })
}, heartbeat_interval * 1000)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Heartbeat Messages Flood Chat Interface

The heartbeat mechanism sends fake chat messages with content "heartbeat/fake [timestamp]" to the chat interface every heartbeat interval. These technical messages, intended for connection keep-alive, spam the chat and degrade the user experience.

Fix in Cursor Fix in Web

@rgarcia rgarcia mentioned this pull request Aug 4, 2025
this.emit('debug', `sending client/heartbeat`)
this.sendMessage(EVENT.CLIENT.HEARTBEAT)
this.emit('debug', `sending chat/message`)
this.sendMessage(EVENT.CHAT.MESSAGE, { content: `heartbeat/fake [${Date.now()}]` })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raiden-staging what's the purpose of this chat message event? If the heartbeat is getting a response now is that sufficient or is this chat message required too?

@juecd
Copy link
Contributor

juecd commented Aug 5, 2025

Merged in with #46

@juecd juecd closed this Aug 5, 2025
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.

3 participants