In the new per-call middleware, in edit mode the modified arguments are only “saved” in an unstructured fashion with the note inserted in front of the tool result. In the context of a chat application it makes it impossible to display tools arguments properly and simply. It means either having to parse the note or add the arguments in some dedicated field in metadata or additional_kwargs which is not wanted.
As of langchain 1.4.6, that’s how per-call mode works - the edit is applied to the tool call request right before execution, the AIMessage keeps the model’s original tool call, and the only persisted record is the note prepended to the ToolMessage. Nothing structured is written anywhere.
In the meantime, a small wrap_tool_call middleware listed after the HITL middleware receives the edited request and can stamp it onto the ToolMessage’s response_metadata, so you get the executed arguments without parsing the note: Custom middleware - Docs by LangChain