Skip to content

Decode command exit frames correctly - #12

Merged
aezell merged 3 commits into
mainfrom
alex/issue-6-control-close
Aug 3, 2026
Merged

Decode command exit frames correctly#12
aezell merged 3 commits into
mainfrom
alex/issue-6-control-close

Conversation

@aezell

@aezell aezell commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • decode non-TTY exit frames using the protocol's first payload byte
  • treat an empty binary exit payload and a code-less JSON exit as exit code 0
  • tolerate trailing bytes in binary exit frames, matching the peer SDKs
  • handle direct-mode exit frames safely while draining pending frames on gun_down
  • add regression coverage for direct, control, TTY, and gun_down paths

User impact

Commands record their exit status before the WebSocket closes, preventing successful calls from surfacing as Command failed: :closed. The decoder also handles empty or extended exit frames consistently with the Go, JavaScript, and Python SDKs.

Validation

  • focused suite: 8 tests passed
  • full suite: 42 of 43 tests passed
  • remaining failure is the pre-existing scaffold test that calls the undefined Sprites.hello/0
  • live issue repros remain to be run before merge; this environment does not have SPRITE_TOKEN or SPRITE_NAME configured

Versioning and deployment

This is a backwards-compatible SDK correction now that control mode is on main. The package manifest remains at 0.1.0; include this fix in the next SDK release. No service deployment is required.

Fixes #6.

@aezell
aezell force-pushed the alex/issue-6-control-close branch from 7aa990b to abce09c Compare July 31, 2026 10:06
@aezell
aezell changed the base branch from feature/control-mode to main July 31, 2026 10:07
@aezell aezell closed this Aug 3, 2026
@aezell aezell reopened this Aug 3, 2026
@aezell
aezell merged commit b584ff9 into main Aug 3, 2026
4 checks passed
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.

Sprites.cmd/4 fails with :closed — drain_pending_frames fix insufficient

1 participant