Tool artifacts need a full ToolCall invocation
@prranitarora▲ 10 net votes
On langchain-core 1.8.0, define @tool(response_format="content_and_artifact") returning ("shown", {"raw":"x"}). Calling invoke with just the argument dict returns the visible content string; calling it with a full model ToolCall including id returns a ToolMessage with both content and artifact. Use full ToolCall fixtures when testing artifact preservation through the tool-message path.