Automated OpenWiki documentation update.
OpenWiki result: success
When the result is `failure`, this PR intentionally preserves only the
pages completed before the failure. Merge it to make that progress the
baseline for the next scheduled run.
Co-authored-by: npentrel <5212232+npentrel@users.noreply.github.com>
`ModelFallbackMiddleware` now removes unsupported cache keys and
Fireworks session-affinity headers before fallback attempts, while
preserving cache settings supported by the selected fallback model.
---
When an agent falls back to another provider, explicitly supplied cache
settings in `ModelRequest.model_settings` can reach a model that does
not accept them and cause the fallback to fail.
`ModelFallbackMiddleware` now removes `x-session-affinity` for
non-Fireworks fallbacks and removes `prompt_cache_key` for providers
outside Fireworks, OpenAI, and Azure OpenAI. It preserves unrelated
settings and headers, retains the existing Anthropic cache-marker
handling, and leaves the original request unchanged. Unit tests cover
synchronous and asynchronous fallback, supported cache-key preservation,
and header cleanup.
Stacked on #38823. This PR contains only the fallback cleanup and its
tests. The Fireworks middleware in the base PR works independently
because its generated affinity is consumed directly by `ChatFireworks`.
Review focus: provider support is determined through `_llm_type`;
`prompt_cache_key` is shared by multiple providers and must not be
treated as Fireworks-only.
Added `FireworksPromptCachingMiddleware` to improve prompt-cache reuse
across calls in the same agent thread. Explicit affinity settings take
precedence, and no affinity is generated without a thread ID.
---
Fireworks agents need consistent routing to reuse a replica's prompt
cache across turns. `FireworksPromptCachingMiddleware` supplies session
affinity from a SHA-256 hash of `config.configurable.thread_id`, while
respecting explicit `user`, `prompt_cache_key`, and `x-session-affinity`
settings on the selected model or request.
Affinity is scoped to the call and applied by `ChatFireworks` when
invoking the API. Generated affinity stays out of shared request
settings, and model-local headers remain scoped to their owning model,
including during fallback. This works with either ordering of the
caching and fallback middleware for a Fireworks primary model.
Related fallback cleanup for explicitly supplied cache settings is in
#40886, stacked on this PR. This PR works independently of that change.
---------
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
`ChatFireworks` now reports mid-stream read timeouts as retryable
`ModelTimeoutError`s while remaining catchable as `httpx.ReadTimeout`.
Partial streams are not automatically replayed.
---
Fireworks stream read timeouts currently bypass LangChain's model-error
classification after the first chunk. Classify them as retryable
`ModelTimeoutError`s while preserving `httpx.ReadTimeout` compatibility,
the original cause, and request context when available.
- Covers synchronous and asynchronous stream consumption.
- Keeps setup retries unchanged. Does **not** replay partial streams:
doing so could duplicate text or corrupt tool-call arguments.
Whole-generation recovery remains the caller's responsibility.
- Built-in streaming retry and fallback behavior is unchanged:
`.with_retry()` does not retry streaming, and `.with_fallbacks()` only
switches models before the first chunk. Applications must explicitly
handle recovery after output has started.
Made by [Open SWE](https://github.com/langchain-ai/open-swe) · [view
thread](https://openswe.vercel.app/agents/c2ba7088-1448-5e4d-9541-ae6f25b513c7)
· openai:gpt-6-astra (medium)
Co-authored-by: Mason Daugherty <mdrxy@users.noreply.github.com>
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Automated OpenWiki documentation update.
OpenWiki result: success
When the result is `failure`, this PR intentionally preserves only the
pages completed before the failure. Merge it to make that progress the
baseline for the next scheduled run.
Co-authored-by: npentrel <5212232+npentrel@users.noreply.github.com>
`ChatFireworks` can replay historical tool calls with malformed or
non-object JSON arguments without forwarding invalid argument strings to
Fireworks.
---
Fireworks rejects conversation history containing malformed or
non-object tool-call arguments, preventing an agent from recovering on
its next turn.
Wrap these arguments in a JSON object under
`__invalid_tool_call_arguments` when serializing history, preserving the
original payload, call IDs, and tool-result pairing. Apply this to
parsed and raw tool-call history without mutating messages or executing
repaired arguments; valid object strings stay unchanged.
Made by [Open SWE](https://github.com/langchain-ai/open-swe) · [view
thread](https://openswe.vercel.app/agents/0da06f8d-3ea1-5f01-aa55-953acb9a71fa)
· openai:gpt-6-astra (medium)
Co-authored-by: Mason Daugherty <mdrxy@users.noreply.github.com>
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Closes#40793
---
Docs-only repair from a full audit of developer-facing markdown against
the repository as source of truth. A new contributor following
`AGENTS.md` from the repo root currently hits missing files and commands
that cannot run; package docs and a workflow comment also drift from
reality.
**What was wrong**
- `AGENTS.md` listed root-level `pyproject.toml`, `uv.lock`, and
`Makefile` as key config files — none exist at the repo root (config is
per package under `libs/*/`).
- Setup/test/lint examples (`uv sync --all-groups`, `make test` / `lint`
/ `format`) had no working directory, so they fail if copy-pasted from
the root.
- The monorepo structure tree omitted `openwiki/` and `AGENTS.md`.
- `libs/README.md` omitted the `model-profiles/` package from its
directory list.
- Root `README.md` linked Deep Agents with `http://` while every other
docs link uses `https://`.
- The PR-title paragraph claimed scopes are mandatory “with no
exceptions”, but `pr_lint.yml` sets `requireScope: false` (only empty
`type():` parens are rejected).
- Grammar (“require” → “requires”), an unfinished editable-installs
sentence, incomplete `pr_lint.yml` scope comment (missing `openrouter`,
`typesafe`), and a stale `make help` line pointing at a non-existent
top-level Makefile.
**What changed**
- Clarified per-package config layout and required `cd` into
`libs/<package>` before `uv` / `make` commands.
- Completed the structure diagram; added `model-profiles/` to
`libs/README.md`.
- Switched Deep Agents links to `https://`.
- Aligned the scope guidance with actual CI behavior (documented, did
not change `requireScope`).
- Tightened the `pr_lint.yml` comment and removed the dead Makefile help
line.
No runtime code, tests, or CI logic changed — comments and markdown
only.
AI assistance was used to prepare this change; I reviewed the diff
against the repository layout.
Automated OpenWiki documentation update.
OpenWiki result: success
When the result is `failure`, this PR intentionally preserves only the
pages completed before the failure. Merge it to make that progress the
baseline for the next scheduled run.
Co-authored-by: npentrel <5212232+npentrel@users.noreply.github.com>
Bumps `langchain-deepseek` to 1.1.1, a patch release carrying the
changes merged since 1.1.0.
PRs included in this release:
- `fix(deepseek): route strict mode to the beta endpoint` (#40249)
- `fix(deepseek): map prompt_cache_hit_tokens to cache_read` (#39668)
- `chore(deps): bump anyio from 4.11.0 to 4.14.2 in
/libs/partners/deepseek` (#40641)
- `chore(model-profiles): refresh model profile data` (#40399)
Updates the package version, importable `__version__`, and lockfile
package entry. `uv lock` resolved successfully; its unrelated workspace
dependency churn was intentionally excluded.
This release PR was prepared with AI assistance (Open SWE).
Made by [Open SWE](https://github.com/langchain-ai/open-swe) · [view
thread](https://openswe.vercel.app/agents/c0f86652-eaed-5672-a4bc-94f03c88fe41)
· fireworks:accounts/fireworks/models/glm-5p3-flash (max)
Co-authored-by: mdrxy <mdrxy@users.noreply.github.com>
Bumps `langchain-fireworks` to 1.6.2, a patch release carrying
dependency and model profile updates merged since 1.6.1.
PRs included in this release:
- `chore(model-profiles): refresh model profile data` (#40665)
- `chore(deps): bump anyio from 4.11.0 to 4.14.2 in
/libs/partners/fireworks` (#40639)
- `chore(deps): bump urllib3 from 2.7.0 to 2.8.0 in
/libs/partners/fireworks` (#40587)
- `chore(deps): bump langsmith from 0.12.1 to 0.12.6 in
/libs/partners/fireworks` (#40586)
- `chore(deps): bump pygments from 2.20.0 to 2.21.0 in
/libs/partners/fireworks` (#40585)
- `chore(deps): bump idna from 3.19 to 3.20 in /libs/partners/fireworks`
(#40584)
- `chore(model-profiles): refresh model profile data` (#40541)
- `chore(model-profiles): refresh model profile data` (#40500)
- `chore(model-profiles): refresh model profile data` (#40452)
- `chore(model-profiles): refresh model profile data` (#40416)
- `chore(model-profiles): refresh model profile data` (#40399)
- `chore(model-profiles): refresh model profile data` (#40277)
- `chore(model-profiles): refresh model profile data` (#40217)
- `chore(model-profiles): refresh model profile data` (#40198)
- `chore(model-profiles): refresh model profile data` (#40171)
- `chore(model-profiles): refresh model profile data` (#40009)
- `chore(deps): bump orjson from 3.11.6 to 3.12.0 in
/libs/partners/fireworks` (#40129)
- `chore(deps): bump langsmith from 0.10.16 to 0.12.1 in
/libs/partners/fireworks` (#40130)
Updates the package version, importable `__version__`, and lockfile
package entry. `uv lock` resolved successfully; its unrelated workspace
dependency churn was intentionally excluded.
This release PR was prepared with AI assistance (Open SWE).
Made by [Open SWE](https://github.com/langchain-ai/open-swe) · [view
thread](https://openswe.vercel.app/agents/c0f86652-eaed-5672-a4bc-94f03c88fe41)
· fireworks:accounts/fireworks/models/glm-5p3-flash (max)
Co-authored-by: mdrxy <mdrxy@users.noreply.github.com>