Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to Video chunks are written to a temporary file as they arrive, and the reviewed lifecycle does not remove an active stream before submission. No actionable merge-blocking risk is established. Pre-merge checks |
|
🤖 Internal: Discord sync markerAuto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete. |
5e87d3d to
a56f2f1
Compare
joshuadarron
left a comment
There was a problem hiding this comment.
LGTM. The change replaces the in-memory chunk list with a mkstemp file that is opened on BEGIN, appended on WRITE, and closed and submitted on END. Every exit path goes through one _discard_tmp_file(). Verified:
closing()is a real hook. The engine binds it (python-instance.target.cpp,PythonMethod::Closing) and calls it per document, beforeclose. Several nodes use it (anonymize, extract_data, landing_ai). A stream that never got END is released when its document closes, which is the right scope.- Cleanup on every path.
_submit_video'sfinallydiscards the file whether the submit succeeds or fails. A second BEGIN discards a dangling file first. END with no open file is now a no-op; previously it would have submitted an empty temp file. - Dropping
os.path.realpathis safe:twelvelabs_driver.process_videoonlyopen()s the path. - Tests cover streaming, deletion after submit, no listener,
closing()cleanup, empty response, and BEGIN displacement. CI is green, including Ruff, the docs build, and all three platform builds.
Nit (non-blocking): the closing() docstring says "when the instance is torn down". The engine calls closing() per document ("the current document is ready to close"), not at instance teardown (that's endInstance). Suggest: "Release a stream still open when its document closes without an END."
…cument scope, not instance teardown
|
Addressed the closing() docstring nit from your review — thanks! |
Summary
twelvelabsstreams incoming video straight to a temp file (BEGIN opens it, WRITE appends,END closes and submits) instead of collecting every chunk in a Python list first
via
closing()) now gets its temp file released instead of leakedType
Bug fix (non-breaking change which fixes an issue)
Testing
./builder testpassesAdded
nodes/test/twelvelabs/test_streaming.py(6 cases), drivingIInstance.writeVideo()directly with
twelvelabs_driver.process_videomocked, following the pattern innodes/test/thumbnail/test_chunk_ids.py. Ran:Also ran
./builder docs:check— clean.Checklist
Linked Issue
Fixes #2564
Summary by CodeRabbit