Repository navigation
sdk: stream a one-shot run's events; CI on Node 18 and Python 3.9 (refs #21) - #47
Merged
Merged
Conversation
…Node 18 and Python 3.9 (refs #21) Only incode -t --output-format json was wrapped, so a caller saw nothing until the run ended. stream_task (Python) and streamTask (TypeScript) run stream-json and hand over each event (init, text, thinking, notice, tool_use, tool_result, usage) as it arrives, then the result, with the same errors run_task/runTask raise. The SDKs promise Node 18+ and Python 3.9+ and CI ran only Node 22 and Python 3.12: the SDK job is now a matrix with the oldest of each.
setup-python failed on ubuntu-latest (24.04) for 3.9, which is past its end of life and has no build there, so the SDK's promised floor went untested. That leg now runs on 22.04.
The runner's annotation: "The version '3.9' with architecture 'x64' was not found for Ubuntu 26.04"; ubuntu-latest began moving to 26.04 on 2026-10-19. The note said 24.04.
This was referenced Oct 22, 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.
Two of #21's code items.
Streaming one-shot runs
Only
incode -t … --output-format jsonwas wrapped, so a caller saw nothing until the run ended.stream_task(...)takesrun_task's arguments and returns aTaskStream.TaskEvent(type, data)as each line arrives:init,text,thinking,notice,tool_use,tool_result,usage..resultholds theTaskResult;.wait()drains what's left and returns it.run_task's errors:TaskFailed,IncodeTimeout,IncodeError,ProtocolErrorfor a line that isn't JSON.-W error::ResourceWarning.streamTask(task, options)returns aTaskStream:for awaityields eachTaskEvent, and.resultis a promise that resolves or rejects asrunTaskwould. Iterating to the end throws the same error.buildTaskArgvtakes the output format.sdk/testing/fake_incode.py) now writes, instream-json, the eventssrc/task_run.rswrites, before the result.CI
The SDKs promise Node 18+ and Python 3.9+, but CI ran only Node 22 and Python 3.12.
sdk-and-editoris now a matrix: Node 18 with Python 3.9, Node 20, Node 22. The VS Code extension still runs on Node 22 only.mainhas no required checks, so renaming the job blocks nothing.Tests
StreamTaskTest, 7 tests: events in order with the result kept out of them,wait, a failure raised after its events, a non-JSON line, a crash with stderr, a timeout, and the argv. All 17 task tests pass locally on 3.13.streamTask: 5 tests;test/index.test.ts: what the package entry exports, and a run streamed through it.Still open on #21
terminal/*and elicitation requests.session/listhelper.