Skip to content

C++: output with callbacks and command timeout (for v0.2.1) - #4

Merged
jssng-pinetree merged 3 commits into
mainfrom
feat1/release-0.2.1
Oct 25, 2026
Merged

jssng-pinetree merged 3 commits into
mainfrom
feat1/release-0.2.1

Conversation

@solari-ci-status

@solari-ci-status solari-ci-status Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Port of the SDK-SUITE phase 2 fixes from the private SDK source, for tag v0.2.1 after merge.

  • commands.run with onStdout/onStderr no longer returns empty or truncated output when the guest's first output arrives before the cmd.start reply.
  • CommandOptions::timeoutMs is a command deadline on the WebSocket path: the command is killed (SIGKILL) and the result is exitCode -1 with the output so far. New CommandHandle::waitFor(ms).

47 test cases / 350 assertions pass (built out of tree, -DCMAKE_POLICY_VERSION_MINIMUM=3.5 on CMake 4.x as before).

🤖 Generated with Claude Code

https://claude.ai/code/session_01D22yA2FD2Cm7HuYGcwAXSN

Update: also includes the change from pinetree-desktop#680: body-less POSTs (pause/resume/start) now carry an explicit Content-Length: 0. Over the HTTP/2 the real gateway negotiates these calls already worked, so for C++ this is hardening (an HTTP/1.1 connection would get 411 without it; the Rust SDK did fail in the field). Files src/http.cpp, tests/test_empty_post.cpp and its CMake entry, byte-identical to that PR. 50 test cases / 371 assertions pass.

…outMs on the WebSocket path

Hand-port of the pinetree-desktop SDK-SUITE phase 2 fixes (desktop#640, #646, #648 as they apply to cpp):
commands.run no longer loses output that arrives before the cmd.start reply when callbacks are set (Go, C++);
timeoutMs/timeout_ms is a command deadline on the WebSocket path (kill + exit -1 with the output so far);
Go: no nil dereference when Close/Kill/Pause races an in-flight call, a late close of an old socket no longer
disconnects the new one, and a partial line no longer survives a reconnect. Tests included and passing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D22yA2FD2Cm7HuYGcwAXSN
@solari-ci-status

Copy link
Copy Markdown
Author

ARCHI-SIGNOFF sandbox ceef3e1

Hand-port for the patch release. I compared every changed file with the merged private source on pinetree-desktop main by SHA-256: include/solari/sandbox.hpp, src/sandbox.cpp and tests/test_main.cpp (the merged private #640 and #646) are byte-identical to sdk/ there. Nothing else in the PR. The repo's CI job (the C++ build and ctest) is green on this head (1 check). Tag v0.2.1 only after the private release PR (#666) and the registries are done, and never re-point a tag.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NmYLnJPcpNnnK5pSvg7QNr

…d get HTTP 411)

Port of pinetree-desktop#680: src/http.cpp sets an empty POSTFIELDS for body-less POST/PUT/PATCH so libcurl sends Content-Length: 0,
plus tests/test_empty_post.cpp (loopback) and its CMake entry. Folded into the 0.2.1 release so the tag ships with it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D22yA2FD2Cm7HuYGcwAXSN
@solari-ci-status

Copy link
Copy Markdown
Author

ARCHI-SIGNOFF sandbox 43116e0

Re-sign of ceef3e1. The delta is three files: src/http.cpp (+4 lines) and the new tests/test_empty_post.cpp are byte-identical (SHA-256) to desktop#680's head (d5fdb36b4716), and CMakeLists.txt differs from the private one as it always did but its change is exactly the one added source file (tests/test_empty_post.cpp appended to solari_tests). I built and ran that code on the private tree (50 cases / 371 assertions pass; removing the header makes 2 cases fail). Everything else in the PR is unchanged from what I signed. The repo's CI job was still running at sign-off (1 check): merge only when it is green; a red job voids this. Tag v0.2.1 only after #666's registry order, and never re-point a tag.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NmYLnJPcpNnnK5pSvg7QNr

nlohmann/json and doctest get URL_HASH; IXWebSocket is pinned to the
v11.4.5 commit so a moved tag cannot change what an unattended build compiles.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D22yA2FD2Cm7HuYGcwAXSN
@solari-ci-status

Copy link
Copy Markdown
Author

ARCHI-SIGNOFF sandbox e451835

Re-sign of 43116e0. The delta is CMakeLists.txt only (+5/-1): the same pins as desktop#683, and I re-checked the values rather than trusting the port: the nlohmann/json tarball hash d6c65aca… and the doctest hash 632ed2c0… (declared twice, both carry it) are the SHA-256 values I computed from the downloaded v3.11.3 / v2.4.11 tarballs, and GIT_TAG c5a02f1066fb0fde48f80f51178429a27f689a39 is what git ls-remote gives for IXWebSocket v11.4.5. No other file changed since the sign-off I gave (src/http.cpp and the empty-POST test remain byte-identical to desktop#680). The repo's CI job was still running at sign-off (1 check, not green): merge only when it is green; a red job voids this. Tag v0.2.1 only after #666's registry order, and never re-point a tag.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NmYLnJPcpNnnK5pSvg7QNr

@jssng-pinetree
jssng-pinetree merged commit 4e3ef74 into main Oct 25, 2026
1 check passed
@jssng-pinetree
jssng-pinetree deleted the feat1/release-0.2.1 branch October 25, 2026 04:56
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.

1 participant