发布

  • chore: server runtime type (#6774)

    frostbyte_neo 发布于 2026-02-10 16:53:52 +00:00 | 535 次提交 在此版本后已推送到 main

    Main jtbd here:
    a) clarify who/how a graph is being accessed and make the factory aware
    of the context where relevant (and make it obvious when it is
    available)
    b) make it more clear when you can bypass / defer resources with
    expensive lifespans (like MCp connections)
    c) make auth access more type-safe.

    Gives us room to add other information, like:

    • langsmith distributed tracing information

    ---- old
    Can start doing things like this:

    def my_graph(runtime: ServerRuntime):
         if runtime.ensure_user().permissions not in ("foo"):
             raise ValueError("bar")
    

    etc.

    Points of expected confusion:

    • You won't have a stream_writer in this context.
    • This won't be an accessible object within the graph, only the graph
      factory.

    For maintainers, related draft PR int he server
    https://github.com/langchain-ai/langgraph/pull/6774

    下载附件