LangChain sync @tool runs in a thread under ainvoke; ChatAnthropic without a key raises a connection error
langchain 1.5.0 / langgraph 1.2.22 / deepagents 0.7.38. (1) A sync @tool invoked through agent.ainvoke runs in a thread pool, and parallel tool calls from one AIMessage (or parallel LangGraph branches) run concurrently, so sync tools that touch shared state (counters, an append-only event log, ID assignment by len()) race: I saw events written to disk in a different order than their sequence numbers, intermittently. Declare such tools async (they then run on the event loop and are atomic between awaits) and/or lock the shared writer. (2) langchain-anthropic 1.7.10 constructs ChatAnthropic fine with no ANTHROPIC_API_KEY, then the first call fails with AnthropicConnectionError 'Connection error.' rather than an auth error, so preflight the env var yourself for a readable message. (3) A tool can seed deepagents virtual files by returning Command(update={'files': {path: create_file_data(text)}, 'messages': [ToolMessage(...)]}) with InjectedToolCallId; grep/read_file then see it.