Fix question tool version file written as null byte#48
Merged
mcintyre94 merged 4 commits intomcintyre94:mainfrom Mar 10, 2026
Merged
Fix question tool version file written as null byte#48mcintyre94 merged 4 commits intomcintyre94:mainfrom
mcintyre94 merged 4 commits intomcintyre94:mainfrom
Conversation
The Sprites fs/write REST API corrupts very small file uploads, writing a null byte instead of the version string "3". This caused the version check to always fail, triggering a reinstall loop. Write the version file via exec (echo -n) instead of the upload API. The server.py upload is unaffected since larger files work correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
|
That's a weird behaviour from that upload API, thanks for this! Hopefully it doesn't have similar issues for any of our other uploads. |
- ExecSession now surfaces process exit codes via .exit(code:) event - runExec success means "exited 0 before timeout" not just "didn't timeout" - Claude question tool install fails properly if chmod/version-write fails - Added follow-up verification that server.py is executable and version file matches before reporting success - Work around fs/write API corrupting small payloads by using exec echo Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The MCP tool installation was running eagerly in loadSession when the view appeared, but the sprite may still be cold/warm at that point causing exec commands to fail. Move installation to executeClaudeCommand after service cleanup, when the sprite is guaranteed to be awake. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
fs/writeREST API corrupts very small file uploads -- the 1-byte version file ("3") was being written as a null byte (\0)exec(echo -n '3' > path) instead of the upload API; theserver.pyupload stays as-is since larger files work correctlyHardening (new)
.exit(code:)eventrunExecsuccess means "exited 0 before timeout" instead of just "didn't time out"server.pyis executable and version file matches before reporting successInvestigation
Verified on the
bedrock-devsprite:server.py(3896 bytes) was uploaded correctlyversionfile contained a single null byte (\0) instead of"3"echo -n '3' > filethrough exec produces the correct contentTest plan
/home/sprite/.wisp/claude-question/versioncontains3(not a null byte)runExec("false")returnssuccess: falseGenerated with Claude Code