Rewrite kaggle kernels logs --follow to use SSE log stream#999
Open
kaggle-agent wants to merge 3 commits intomainfrom
Open
Rewrite kaggle kernels logs --follow to use SSE log stream#999kaggle-agent wants to merge 3 commits intomainfrom
kaggle kernels logs --follow to use SSE log stream#999kaggle-agent wants to merge 3 commits intomainfrom
Conversation
The previous `--follow` implementation polled the persisted log blob, which is only written at session end — so it never showed live output for in-progress notebooks. Switch to the midtier SSE proxy (mirroring how the editor/viewer FE consume logs), parsing `data:` events and stopping on the `STREAM_END` sentinel. Co-authored-by: kaggle-agent <kaggle-agent@users.noreply.github.com>
djherbis
requested changes
May 5, 2026
Per review feedback, the SSE stream terminates with `END_OF_LOG`, not `STREAM_END`. Updated the sentinel constant, docstring, and test fixtures to match the actual server behavior. Co-authored-by: kaggle-agent <kaggle-agent@users.noreply.github.com>
bovard
approved these changes
May 5, 2026
…mplete: `kernels_logs_stream` now branches on `Content-Type`, using `_iter_sse_events` for live SSE and `_iter_blob_lines` for the persisted GCS blob returned after the session finishes. Co-authored-by: kaggle-agent <kaggle-agent@users.noreply.github.com>
stevemessick
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous
--followimplementation polled the persisted log blob,which is only written at session end, so it never showed live output
for in-progress notebooks. Switch to the midtier SSE proxy (the same
stream the editor/viewer FE consume), parsing
data:events andstopping on the
END_OF_LOGsentinel.Task: herbison-20260505160932-d7e63a14
Context: https://chat.kaggle.net/kaggle/pl/9n7sbkzftbfkuy7cy6n4s937eo
http://b/508678236