You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wu-sheng (via GitHub)" <gi...@apache.org> on 2026/10/08 08:17:55 UTC

[PR] Name a system message LangChain JS serialized [skywalking-ai-sessionizer]

wu-sheng opened a new pull request, #56:
URL: https://github.com/apache/skywalking-ai-sessionizer/pull/56

   LangChain serializes a message as a constructor. Python writes the message's role as the type in its `kwargs`, which the adapter's shape walk reads:
   
   ```json
   {"lc":1,"type":"constructor","id":["langchain","schema","messages","SystemMessage"],
    "kwargs":{"content":"You are …","type":"system"}}
   ```
   
   LangChain JS writes only the fields the message was built with (`Serializable.toJSON` keeps the constructor's own arguments, and `type = "system"` is a field of the class), so its role is only the class that ends the `id`:
   
   ```json
   {"lc":1,"type":"constructor","id":["langchain_core","messages","SystemMessage"],
    "kwargs":{"content":"You are …"}}
   ```
   
   Read by role and type alone, a graph's first input or a decorated function's arguments that held one landed unnamed, and a reader who withholds the system prompt was shown it. LangChain JS's messages also land whole in a function's record, where Python's are dropped as a repeat of the model call's, so the text was there to show.
   
   - `systemMessage` now also names a constructor whose `id` ends with `SystemMessage`, or the `SystemMessageChunk` a stream builds, with content in its `kwargs`. It is the rule the OAP uses to mask a served LangChain body (apache/skywalking#14123).
   - The LangChain page's naming rules say so, and the 0.6.0 changes list it.
   - The shape test gains both serialized forms, a chunk, and three that are not one: a person's message, an empty system message, and an id of the application's own. With the new rule taken out, the two LangChain JS cases fail and the Python one still passes.
   
   The JS form is taken from LangChain JS's source, not from a captured trace: every capture under `tests/apps/langchain` is Python's.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Receive LangChain JS and LangGraph JS as the Python client's [skywalking-ai-sessionizer]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #56:
URL: https://github.com/apache/skywalking-ai-sessionizer/pull/56


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org