Back Home

GitHub Repo

langchain-fireworks 1.6.3 Wraps Invalid Historical Arguments to Fix Agent Conversation Resumption

The new release wraps malformed or non-object JSON from historical tool calls in diagnostic data, preventing a subsequent request from being rejected because of stale arguments. The change preserves call-and-result pairing; actual task recovery rates remain unverified.

Dirck van Baburen · Public domain · Image source
zh-Hant

LangChain released langchain-fireworks 1.6.3 on September 25, fixing an issue where Fireworks could reject historical messages when an agent continued a conversation after a failed tool call. The fix is listed in the GitHub release notes, and the package uploaded to PyPI on the same day is available to users as an official release. [Release notes](https://github.com/langchain-ai/langchain/releases/tag/langchain-fireworks==1.6.3), [PyPI](https://pypi.org/project/langchain-fireworks/)

The issue occurs in the response flow after a tool runs. Fireworks’ official examples add both the model’s original tool call and the corresponding tool result, with its matching identifier, to the next request. So even if an application has caught a parameter parsing error, noncompliant content may still remain in the history. The maintainers noted that malformed or non-object JSON in tool arguments can cause the next request to be rejected, preventing the agent from continuing to handle the error. [Tool calling documentation](https://docs.fireworks.ai/guides/function-calling), [fix description](https://github.com/langchain-ai/langchain/pull/40818)

In the new release, when serializing historical messages, arguments of this kind are placed in a JSON object field named `__invalid_tool_call_arguments`. This preserves the original content, the call identifier, and the pairing with the tool result. The handling covers historical tool calls in both parsed and raw forms; valid object strings are passed through unchanged, and the original message objects are not modified. [Pull request](https://github.com/langchain-ai/langchain/pull/40818)

This design suggests that agent workflows most directly benefit when they send tool errors back to the model and ask it to retry. After wrapping, the erroneous content remains available as a diagnostic clue, and the application can preserve the relationship between the call and its result. The maintainers explicitly state that this step does not infer the correct arguments or execute supposedly corrected arguments; it handles the transmission format of historical data. [Design notes](https://github.com/langchain-ai/langchain/pull/40818)

For deployment, teams should distinguish between “the request can be sent” and “the task can recover”: whether the model makes the correct call in the next turn depends on the model, tool descriptions, and error feedback. The public release notes provide no recovery rate or end-to-end latency tests, so they do not quantify any reliability gains.

Engineering teams should next run regression tests against existing failure records, covering truncated argument text, valid but non-object JSON, and the pairing of multiple tool results. If the system has separate history-cleanup or retry logic, teams should also check how wrapped content enters logs and subsequent prompts. To verify recovery to an executable state, they should record not only whether the API accepts the request, but also the tool name, argument types, and required fields in the next turn’s output.

Sources

  1. langchain-fireworks 1.6.3 發布說明
  2. PR #40818:preserve malformed tool arguments as diagnostic JSON
  3. langchain-fireworks 套件與 1.6.3 發布紀錄
  4. Fireworks AI Tool Calling 文件