Repository navigation
fix: negotiate supported protocol and reject raw JSON controls - #3
Merged
Merged
Conversation
Report the implemented MCP revision for unsupported requests. Compare raw JSON control characters numerically so shell response validation does not depend on collation. Preserve existing tests and valid Unicode/DEL values; no native client acceptance claim.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
🟢 Approval recommended
The focused fixes have relevant regression coverage, match the documented behavior, and have no identified blocking issues.
No open issues 🎉
What changed in this PR
This PR corrects protocol negotiation in the channel server and raw JSON control-character validation in the shell client.
Changes:
- Report the implemented MCP
2024-11-05revision instead of echoing unsupported versions. - Use numeric character checks to reject raw controls while preserving valid JSON strings.
- Add regression coverage and document protocol compatibility limits.
| File | Description |
|---|---|
tests/test_scripts.py |
Tests raw-control rejection and valid string acceptance. |
tests/test_channel.py |
Tests protocol negotiation across supported, unsupported, and malformed values. |
src/dotline/channel.py |
Returns the implemented MCP protocol revision. |
README.md |
Documents version fallback and lack of handshake-free support. |
clients/dotline.sh |
Replaces locale-sensitive ordering with numeric control-character validation. |
Review effort: Balanced
Reject only the nonnegative C0 control range. Keep valid multibyte values when an older shell represents high bytes as signed values. Existing tests remain unchanged; final hosted macOS checks are still required.
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 first-use checks gave misleading success responses:
initializeechoed any requested protocol string, including2099-12-31. It now reports the implemented2024-11-05revision, following MCP version negotiation.The change stays within five files. Original test/helper ASTs and all 26 other tracked files are preserved.
Validation on follow-up
bb4ee3c9dcd7bd030eff65f0e37e4c8e50c0a1cf:The first head (
c79c99d0) passed hosted Linux/Windows checks but failed three valid-Unicode cases on macOS. The follow-up rejects only nonnegative numeric values 0–31, preserving signed high-byte representations; its native Linux suite again passed 351 tests with 37 skips. A fresh base control onca337264passed the hosted matrix. Signed-byte handling is the supported explanation under review, not a directly logged hostprintfvalue. Current-head push and PR CI passed all six Linux/macOS/Windows × Python 3.10/3.13 jobs in each run, and CodeQL passed. The PR macOS 3.13 log reports 352 passed and 36 skipped. CodeRabbit's green check represents a skipped automatic review, not approval. These are synthetic protocol/HTTP tests, not a native ChatGPT/Claude trial. Bash 3.2-specific behavior and broader parser limitations need separate evidence; no universal compatibility or handshake-free MCP support is claimed.