惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
O
OpenAI News
WordPress大学
WordPress大学
P
Proofpoint News Feed
J
Java Code Geeks
G
Google Developers Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Register - Security
The Register - Security
Engineering at Meta
Engineering at Meta
H
Help Net Security
人人都是产品经理
人人都是产品经理
Vercel News
Vercel News
N
Netflix TechBlog - Medium
F
Full Disclosure
U
Unit 42
Latest news
Latest news
N
News and Events Feed by Topic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
InfoQ
L
LINUX DO - 最新话题
T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
爱范儿
爱范儿
K
Kaspersky official blog
Google Online Security Blog
Google Online Security Blog
小众软件
小众软件
I
Intezer
V
V2EX
S
SegmentFault 最新的问题
C
CERT Recently Published Vulnerability Notes
阮一峰的网络日志
阮一峰的网络日志
Security Archives - TechRepublic
Security Archives - TechRepublic
Recent Announcements
Recent Announcements
C
Check Point Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Recorded Future
Recorded Future
博客园 - Franky
Project Zero
Project Zero
S
Securelist
Attack and Defense Labs
Attack and Defense Labs
Spread Privacy
Spread Privacy
The Hacker News
The Hacker News
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
NISL@THU
NISL@THU
云风的 BLOG
云风的 BLOG
S
Secure Thoughts
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed

LangChain Forum - Latest posts

Proposal: additional docs for implementing custom DB checkpointers or a guide on generic base checkpointer Langsmith Fleet Sandbox Failure Prompt_cache_retention: &#39;24h&#39; supported in langchain agents and where to provide it, inside invoke or while creating client? Could RAG pipelines realistically cause deployment timeouts, is Render suitable for first-time RAG deployments? How do I use langchain_postgres&#39; init_vectorstore_table correctly? Proposal: Graph-wide default error handler for StateGraph (fallback for nodes without error_handler) Support timedelta for CachePolicy.ttl, consistent with TimeoutPolicy The x402 illusion: Is advertising dead in the age of agents? Question about LangSmith Trace Search via API How to cancel a run correct !! Anyone confirms this issue that deepagent ui streaming is disturb by update in deepagent or bug issue Would pre-inference routing help long-context agent workflows? Best Stack for Building AI Applications Question about LangSmith Trace Search Seeking help regarding the connection between Websocket and tool calls Tool invocation error with empty error message when using `InjectedState` + `Command` return in async tool How to use @langchain/react FileSystem middleware Using ChatSnowflake with agents Built llmsessioncontract on AgentMiddleware: runtime enforcement of tool-call protocols — feedback wanted DeltaChannelHistory not found in langgraph-api:3.12 Improving citation accuracy and reducing hallucinations in custom Parent-Child RAG pipeline (Gemma3:4B + FAISS+BM25 + Cross-encoder reranker) Metadata filter not filtering for alerts Connecting the Slack integration fails with invalid_team_for_non_distributed_app Trouble understanding and editing experiment summary evaluators feedbacks SSL certificate error from httpx with LangGraph server WikipediaLoader endup in JSONDecodeError Human-in-the-loop approval dashboard for LangGraph agents — open source, free to deploy How are people handling data governance across agent handoffs in production? Feature Request: @task metadata Research: Friction Points in Agentic Commerce Transactions How should I provide an agent to a LangGraph server? How I added claim verification to a LangChain agent in 5 minutes (with code) Interested in contributing a DynamoDB checkpointer for LangGraph.js A set of speculative ideas on treating LLM agents as interpreters with limited working memory, using externalized structures for reliable long-term project maintenance. Where should I define the name and description for subagents? Add Qdrant-backed checkpoint saver and memory store (langgraph-checkpoint-qdrant) The output content has been corrupted Incorrect `reasoning_effort` options in the UI A Minimal Receipt + Validator Pattern for Tool-Calling Agents Feature Request: Simple cryptographic provenance for who authorized what in LangGraph multi-agent graphs Using LangGraph interrupt for multi-step wizards with branching — right tool or wrong abstraction? Portable departure and admission records for LangChain agents Socratic Tools: Intelligent Agent Enhancement for LangChain Built NORNR for spend governance in agent workflows LangGraph + PostgreSQL: Chat history and summarization best practice Using SQLRecordManager multi-agent systems debugging agent-to-agent Proposal: Add save_local and load_local to USearch VectorStore (Feature Parity with FAISS) How are you handling agent security in production? (Identity, permissions, kill switch) RFC: Human delegation provenance for LangGraph multi-agent chains Build UX for Langgraph Tiny LangGraph -> Assay evidence sample from tasks v2 tool isolation between Skills: Bug: Cannot save edited prompt back to Prompt Hub after opening trace run in Playground Add faiss-node-native as async alternative vector store for FAISS Deep Agents: Clarify Multimodal (Image) Context Management and Compression Discussion about why LangGraph JS ToolNode doesn’t inject ToolRuntime.state like Python does, and what the correct workaround or intended design pattern is. xat-langchain: signed Agent-Signature headers on every tool call Help with local RAG pipeline – poor retrieval quality, wrong page numbers Building an AI networking agent (LangChain vs LangGraph vs Deep Agents)? LOGIC.md — declarative reasoning contracts that compile to LangGraph StateGraph Distinguishing internal vs final streamed chunks in Supervisor multi-agent architecture Machine-Readable Permissions for Web-Interacting Agents Are people hitting race conditions in multi-agent LangChain setups? How do ContextEditingMiddleware and SummarizationMiddleware interact when used together?Combining ContextEditingMiddleware + SummarizationMiddleware — execution order and behavior when both trigger? How we add runtime security to LangChain agents in production What does recursionLimit actually count in createAgent? (LangChain JS) LangSmith Playground returns 401 Invalid token for both /stream and /invoke across accounts How to register type in langgraph Are there any frontends for interacting with a LangGraph agent? Langchain.schema is not available while using in python code In-place model update on a compiled create_agent and per-subagent model update for deep agents - is this possible? Physical control surface for AI agents — feedback wanted Feature Request: Native Support for A2A Protocol (Remote Agents as Sub-Graphs) Feature Request: Image Input support for ChatMistralAI Cache disable in Deepagent Multiple response formats when creating agents? Unable to parse docstring from OpenAI schema Hosting an agent server on Heroku Enable OpenTelemetry traces without sending data to LangSmith No cost displayed in LangSmith when using LiteLLM + LangGraph Course certificate I had a few months Experience with across Agent deploys remotegraph calls - old/new dist runtime architecture Runs visiblty problem AI Agent Identity Management Framework How should I deploy a self-hosted multi-agent system? Free Self-hosted LangGraph Agent Server: how to separate API and queue workers using Docker LangSmith signup stuck on activation screen New integration: langchain-w2a — LangChain tools for W2A-enabled websites Custom routes not working self-hosted standalone Trace-to-Fix: how are you actually improving RAG/agents after observability flags issues? `Failed to use model_dump to serialize <class 'langchain_core.tools.structured.StructuredTool'> to JSON: PydanticSerializationError(Unable to serialize unknown type: <class 'pydantic._internal._model_construction.ModelMetaclass'>)` `PydanticDeprecatedSince20: The `dict` method is deprecated; use `model_dump` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.12/migration/` BaseSandbox.write() fails if file already exists -- any way to overwrite? What does the security architecture of AI agents actually look like? Persisting HITL payloads LangMem support in JS/TS Are dynamic tool lists allowed when using create_agent? How to make an image tool?
Parallel astream() on the same compiled graph leaks messages between streams
@kzoltan Zol · 2026-04-23 · via LangChain Forum - Latest posts
Hi, I ran into the below issue. The script might need to be executed several times to hit the bug. Is this referenced somewhere in the doc? Is this expected? Thanks! “”"Minimal reproduction of LangGraph concurrent astream() token-leak bug. Bug: When the same compiled graph (and therefore the same underlying chat model instance) is streamed concurrently from two asyncio tasks with stream_mode="messages", token chunks emitted by the model during one task’s call can surface inside the other task’s astream() iterator. Root cause (short version): stream_mode="messages" installs a streaming callback handler through LangChain’s callback-manager contextvar. The contextvar is per-asyncio- Task in theory, but the compiled graph holds bound references to the shared model’s configuration, and the BaseChatModel’s streaming path can pick up the “wrong” callback manager when two tasks interleave inside _astream. The result: token T produced by the model during Task B’s invocation gets delivered to Task A’s queue. Expected output when the bug reproduces: Task A collected chunks that include text meant for Task B (or vice versa). The script asserts isolation at the end; it raises AssertionError when the bug is present. “”" from future import annotations import asyncio from typing import Any from langchain_core.language_models.fake_chat_models import GenericFakeChatModel from langchain_core.messages import AIMessage, HumanMessage from langgraph.graph import END, START, MessagesState, StateGraph def build_shared_graph(responses: list[str]) → Any: “”"Build ONE compiled graph whose LLM node cycles through responses. Using ``GenericFakeChatModel`` here keeps the repro hermetic — no network, no API key — while still going through LangChain's ``BaseChatModel`` streaming machinery (which is where the leak originates). """ # ``GenericFakeChatModel`` accepts an iterator of AIMessages and # streams their content char-by-char through BaseChatModel._astream, # which is the exact path LangGraph hooks its "messages" stream-mode # callback into. messages_iter = iter(AIMessage(content=r) for r in responses) model = GenericFakeChatModel(messages=messages_iter) async def call_model(state: MessagesState) -> dict: # Note: no explicit config plumbing. This mirrors what agent # middleware does internally — the model is called under whatever # RunnableConfig is current in the contextvar. reply = await model.ainvoke(state["messages"]) return {"messages": [reply]} builder: StateGraph = StateGraph(MessagesState) builder.add_node("chat", call_model) builder.add_edge(START, "chat") builder.add_edge("chat", END) return builder.compile() async def run_stream(graph: Any, label: str, prompt: str, out: list[str]) → None: “”"Drive graph.astream with stream_mode="messages". Collects every AIMessageChunk text into ``out``. Each concurrent caller gets its own ``out`` list — if isolation held, each list should contain only the content produced for *its own* prompt. """ async for chunk, _metadata in graph.astream( {"messages": [HumanMessage(content=prompt)]}, {"configurable": {"thread_id": label}}, stream_mode="messages", ): # AIMessageChunk.content can be str or a list of content blocks. text = chunk.content if isinstance(chunk.content, str) else str(chunk.content) if text: out.append(text) # Small sleep to maximise interleaving between the two tasks. await asyncio.sleep(0) print(f"[{label}] collected: {''.join(out)!r}") async def main() → None: Two clearly distinguishable responses so we can tell which task’s stream a chunk belongs to by eyeballing the text alone. response_a = “AAAA-AAAA-AAAA-AAAA-AAAA” response_b = “BBBB-BBBB-BBBB-BBBB-BBBB” # One shared compiled graph (same instance for both tasks) — this is # exactly the condition under which the bug manifests in production. # The model's internal iterator yields response_a first, then # response_b; the two concurrent astreams will race to consume them. graph = build_shared_graph([response_a, response_b]) collected_a: list[str] = [] collected_b: list[str] = [] await asyncio.gather( run_stream(graph, "A", "say AAAA", collected_a), run_stream(graph, "B", "say BBBB", collected_b), ) text_a = "".join(collected_a) text_b = "".join(collected_b) print() print(f"Task A final text: {text_a!r}") print(f"Task B final text: {text_b!r}") print() # Isolation assertions. If the bug is present at least one of these # will fail — a task will have received some of the *other* task's # characters (or will be missing its own). a_has_b_chunks = "B" in text_a b_has_a_chunks = "A" in text_b if a_has_b_chunks or b_has_a_chunks: print("LEAK DETECTED:") if a_has_b_chunks: print(" - Task A received B-chunks (should only contain A)") if b_has_a_chunks: print(" - Task B received A-chunks (should only contain B)") raise AssertionError("concurrent astream() leaked tokens across tasks") print("No leak observed in this run.") if name == “main”: asyncio.run(main())