deerflow2/backend/packages/harness/deerflow/models
AochenShen99 4093c83383
refactor(provider): share assistant payload replay matching (#3307)
* Share assistant payload replay matching

* fix(provider): recover assistant field when ordinal AI index is taken

The mismatch-length fallback in `_match_ai_message` only tried the exact
`fallback_ordinal` AI index. When serialization drops or reorders an
assistant message, a unique signature match can consume a non-ordinal
index, leaving a later ambiguous payload's ordinal already used — so its
provider field (e.g. `reasoning_content`) was silently dropped.

Scan forward from the ordinal for the next unused `AIMessage` (wrapping to
earlier indices) to preserve the positional bias while still recovering
the field. Forward scanning avoids a naive min-unused pick that could
restore the wrong field after a leading message is dropped.

Add a regression test for the dropped-leading-message case.

* fix(provider): avoid earlier assistant fallback replay
2026-05-29 23:05:59 +08:00
..
__init__.py refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
assistant_payload_replay.py refactor(provider): share assistant payload replay matching (#3307) 2026-05-29 23:05:59 +08:00
claude_provider.py feat: static system prompt with DynamicContextMiddleware for prefix-cache optimization (#2801) 2026-05-09 09:27:02 +08:00
credential_loader.py Fix Windows backend test compatibility (#1384) 2026-03-26 17:39:16 +08:00
factory.py fix(tracing): propagate session_id and user_id into Langfuse traces (#2944) 2026-05-21 16:49:31 +08:00
mindie_provider.py chore(adpator):Adapt MindIE engine model and improve testing and fixes (#2523) 2026-04-28 15:09:31 +08:00
openai_codex_provider.py chroe(2585): keep polishing the code of codex token usage (#2689) 2026-05-02 15:04:11 +08:00
patched_deepseek.py refactor(provider): share assistant payload replay matching (#3307) 2026-05-29 23:05:59 +08:00
patched_mimo.py refactor(provider): share assistant payload replay matching (#3307) 2026-05-29 23:05:59 +08:00
patched_minimax.py feat(harness): integration ACP agent tool (#1344) 2026-03-26 14:20:18 +08:00
patched_openai.py refactor(provider): share assistant payload replay matching (#3307) 2026-05-29 23:05:59 +08:00
vllm_provider.py feat(models): add vLLM provider support (#1860) 2026-04-06 15:18:34 +08:00