Skip to content

Rewrite kaggle kernels logs --follow to use SSE log stream#999

Open
kaggle-agent wants to merge 3 commits intomainfrom
agent/herbison-20260505160932-d7e63a14
Open

Rewrite kaggle kernels logs --follow to use SSE log stream#999
kaggle-agent wants to merge 3 commits intomainfrom
agent/herbison-20260505160932-d7e63a14

Conversation

@kaggle-agent
Copy link
Copy Markdown
Collaborator

@kaggle-agent kaggle-agent commented May 5, 2026

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 (the same
stream the editor/viewer FE consume), parsing data: events and
stopping on the END_OF_LOG sentinel.


Task: herbison-20260505160932-d7e63a14
Context: https://chat.kaggle.net/kaggle/pl/9n7sbkzftbfkuy7cy6n4s937eo

http://b/508678236

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>
Comment thread src/kaggle/api/kaggle_api_extended.py Outdated
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>
@djherbis djherbis requested review from bovard and stevemessick May 5, 2026 16:33
…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>
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.

4 participants