Rather than try to embed a JSON-RPC message inside another JSON-RPC
message (i.e. the MessageText notification) this commit changes the
agent to forward the message onto the inspector program (mostly)
unmodified.
The most important detail is that we leave the message encoded as
bytes, this way we don't introduce any errors caused by Python
counting the length of unicode characters differently, depending on if
they are a string or a sequence of bytes. Closes #157
>>> len('∊')
1
>>> len('∊'.encode())
3
As for the metadata fields that were included in the MessageText,
these are now passed as additional headers prepended to the captured
message
Rather than try to embed a JSON-RPC message inside another JSON-RPC message (i.e. the
MessageText
notification) this commit changes the agent to forward the message onto the inspector program (mostly) unmodified.The most important detail is that we leave the message encoded as bytes, this way we don't introduce any errors caused by Python counting the length of unicode characters differently, depending on if they are a string or a sequence of bytes. Closes #157
As for the metadata fields that were included in the
MessageText
, these are now passed as additional headers prepended to the captured message