Skip to content

fix(agent): preserve complete model messages - #44502

Draft
WH-2099 wants to merge 5 commits into
mainfrom
fix/agent-message-replay
Draft

WH-2099 wants to merge 5 commits into
mainfrom
fix/agent-message-replay

Conversation

@WH-2099

@WH-2099 WH-2099 commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Part of #41092.

Agents currently rebuild model responses from visible text, losing reasoning signatures, encrypted state and content order.
This keeps the full messages through tool calls and restored history in legacy Agents, workflow Agents and Agent v2.

  • Check saved messages against their original tenant, app, provider and model.
  • Keep old history readable and add matching results for interrupted tool calls.
  • Trim workflow history by complete turns using the existing token budget.

CI passed on 11eff180, including API, Agent, database migration and web E2E checks.
Live provider replay still needs verification.

This PR is still a draft and conflicts with main.
Before merge:

SDK 0.11.0 and daemon 0.6.14 are published.

Preserve current tracing and dependency updates alongside complete-call validation and replay state. Load app ownership with history messages to avoid per-message queries, and adapt regression fixtures to the current dataclass models.
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-10-28 06:35:55.180842040 +0000
+++ /tmp/pyrefly_pr.txt	2026-10-28 06:35:43.912772370 +0000
@@ -2811,91 +2811,91 @@
 ERROR No matching overload found for function `str.join` called with arguments: (list[AgentScratchpadUnit.Action | str]) [no-matching-overload]
    --> tests/unit_tests/core/agent/output_parser/test_cot_output_parser.py:249:25
 ERROR `None` is not assignable to attribute `agent_callback` with type `DifyAgentCallbackHandler` [bad-assignment]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:121:29
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:122:29
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:124:5
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:125:5
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:129:9
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:130:9
 ERROR Missing required key `action` for TypedDict `ActionDict` [bad-typed-dict-key]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:157:44
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:158:44
 ERROR Missing required key `action_input` for TypedDict `ActionDict` [bad-typed-dict-key]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:157:44
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:158:44
 ERROR Key `invalid` is not defined in TypedDict `ActionDict` [bad-typed-dict-key]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:157:45
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:158:45
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:211:55
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:212:55
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:224:55
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:225:55
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:248:35
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:249:35
 ERROR Object of class `FunctionType` has no attribute `call_args` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:250:33
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:251:33
 ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:251:61
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:252:61
 ERROR `None` is not assignable to attribute `agent_callback` with type `DifyAgentCallbackHandler` [bad-assignment]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:269:33
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:270:33
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:272:29
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:273:29
 ERROR Object of class `NoneType` has no attribute `max_iteration` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:275:9
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:276:9
 ERROR `None` is not assignable to attribute `agent_callback` with type `DifyAgentCallbackHandler` [bad-assignment]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:291:33
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:292:33
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:294:29
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:295:29
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:305:35
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:306:35
 ERROR Object of class `NoneType` has no attribute `max_iteration` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:309:9
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:310:9
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:321:29
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:322:29
 ERROR Object of class `NoneType` has no attribute `max_iteration` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:326:9
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:327:9
 ERROR `Literal[1]` is not assignable to attribute `prompt_price` with type `Decimal` [bad-assignment]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:332:32
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:333:32
 ERROR `Literal[1]` is not assignable to attribute `completion_price` with type `Decimal` [bad-assignment]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:333:36
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:334:36
 ERROR `Literal[2]` is not assignable to attribute `total_price` with type `Decimal` [bad-assignment]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:334:31
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:335:31
 ERROR `Literal[1]` is not assignable to attribute `prompt_price` with type `Decimal` [bad-assignment]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:340:32
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:341:32
 ERROR `Literal[1]` is not assignable to attribute `completion_price` with type `Decimal` [bad-assignment]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:341:36
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:342:36
 ERROR `Literal[2]` is not assignable to attribute `total_price` with type `Decimal` [bad-assignment]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:342:31
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:343:31
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:370:35
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:371:35
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:382:19
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:383:19
 ERROR Object of class `FunctionType` has no attribute `return_value` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:402:9
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:405:9
 ERROR Object of class `FunctionType` has no attribute `call_args` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:410:16
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:413:16
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:428:25
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:431:25
 ERROR Object of class `NoneType` has no attribute `max_iteration` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:448:9
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:451:9
 ERROR `None` is not assignable to attribute `agent_callback` with type `DifyAgentCallbackHandler` [bad-assignment]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:456:33
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:459:33
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:458:25
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:461:25
 ERROR `list[str]` is not assignable to attribute `_agent_scratchpad` with type `list[AgentScratchpadUnit]` [bad-assignment]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:488:36
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:491:36
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:510:55
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:513:55
 ERROR Object of class `FunctionType` has no attribute `assert_called` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:514:9
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:517:9
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:580:35
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:582:35
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:594:35
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:596:35
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:608:35
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:610:35
 ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:623:35
+   --> tests/unit_tests/core/agent/test_cot_agent_runner.py:625:35
 ERROR `list[DummyTool]` is not assignable to attribute `_prompt_messages_tools` with type `Sequence[PromptMessageTool]` [bad-assignment]
   --> tests/unit_tests/core/agent/test_cot_chat_agent_runner.py:49:37
 ERROR `DummyGenerateEntity` is not assignable to attribute `application_generate_entity` with type `AgentChatAppGenerateEntity` [bad-assignment]
-  --> tests/unit_tests/core/agent/test_cot_chat_agent_runner.py:53:42
+  --> tests/unit_tests/core/agent/test_cot_chat_agent_runner.py:54:42
 ERROR `in` is not supported between `Literal['History']` and `None` [not-iterable]
    --> tests/unit_tests/core/agent/test_cot_completion_agent_runner.py:175:16
 ERROR `in` is not supported between `Literal['Thought: Thinking']` and `None` [not-iterable]
@@ -2909,79 +2909,69 @@
 ERROR `in` is not supported between `Literal['Question: What is Python?']` and `None` [not-iterable]
    --> tests/unit_tests/core/agent/test_cot_completion_agent_runner.py:180:16
 ERROR `Literal[0]` is not assignable to attribute `prompt_price` with type `Decimal` [bad-assignment]
-  --> tests/unit_tests/core/agent/test_fc_agent_runner.py:51:26
+  --> tests/unit_tests/core/agent/test_fc_agent_runner.py:48:26
 ERROR `Literal[0]` is not assignable to attribute `completion_price` with type `Decimal` [bad-assignment]
-  --> tests/unit_tests/core/agent/test_fc_agent_runner.py:52:30
+  --> tests/unit_tests/core/agent/test_fc_agent_runner.py:49:30
 ERROR `Literal[0]` is not assignable to attribute `total_price` with type `Decimal` [bad-assignment]
-  --> tests/unit_tests/core/agent/test_fc_agent_runner.py:53:25
+  --> tests/unit_tests/core/agent/test_fc_agent_runner.py:50:25
 ERROR Missing argument `session` in function `core.agent.base_agent_runner.BaseAgentRunner.__init__` [missing-argument]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:194:37
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:165:37
 ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:227:5
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:198:5
 ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:238:9
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:209:9
 ERROR Argument `None` is not assignable to parameter `query` with type `str` in function `core.agent.fc_agent_runner.FunctionCallAgentRunner._organize_user_query` [bad-argument-type]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:339:46
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:310:46
 ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:407:58
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:358:58
 ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:455:19
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:406:19
 ERROR Object of class `FunctionType` has no attribute `return_value` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:512:9
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:463:9
 ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:514:35
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:465:35
 ERROR Object of class `FunctionType` has no attribute `call_args` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:516:33
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:467:33
 ERROR Object of class `FunctionType` has no attribute `call_args` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:517:33
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:468:33
 ERROR Object of class `FunctionType` has no attribute `call_args` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:518:16
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:469:16
 ERROR Object of class `FunctionType` has no attribute `assert_called` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:523:9
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:474:9
 ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:525:23
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:476:23
 ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:531:19
-ERROR Argument `list[TextPromptMessageContent]` is not assignable to parameter `content` with type `str | None` in function `DummyMessage.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:548:57
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:482:19
 ERROR Object of class `FunctionType` has no attribute `return_value` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:554:9
-ERROR Argument `list[TextPromptMessageContent]` is not assignable to parameter `content` with type `str | None` in function `DummyMessage.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:570:57
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:505:9
 ERROR Object of class `FunctionType` has no attribute `side_effect` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:578:9
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:526:9
 ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:580:35
-ERROR Argument `list[TextPromptMessageContent]` is not assignable to parameter `content` with type `str | None` in function `DummyMessage.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:586:46
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:528:35
 ERROR Object of class `FunctionType` has no attribute `return_value` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:589:9
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:537:9
 ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:591:35
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:539:35
 ERROR Object of class `FunctionType` has no attribute `call_args` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:593:16
-ERROR Object of class `FunctionType` has no attribute `return_value` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:609:9
-ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:620:35
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:541:16
 ERROR Object of class `FunctionType` has no attribute `side_effect` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:636:9
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:553:9
 ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:638:35
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:555:35
 ERROR Object of class `FunctionType` has no attribute `side_effect` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:653:9
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:567:9
 ERROR Object of class `FunctionType` has no attribute `return_value` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:658:9
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:572:9
 ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:667:35
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:581:35
 ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:673:25
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:587:25
 ERROR Object of class `NoneType` has no attribute `max_iteration` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:677:9
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:591:9
 ERROR Object of class `FunctionType` has no attribute `return_value` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:689:9
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:600:9
 ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
-   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:692:29
+   --> tests/unit_tests/core/agent/test_fc_agent_runner.py:603:29
 ERROR Missing argument `description` in function `core.agent.plugin_entities.AgentStrategyEntity.__init__` [missing-argument]
    --> tests/unit_tests/core/agent/test_plugin_entities.py:292:32
 ERROR Argument `dict[str, dict[str, str | dict[str, float | list[str]]]]` is not assignable to parameter `config` with type `AppModelConfigDict` in function `core.app.app_config.easy_ui_based_app.model_config.manager.ModelConfigManager.convert` [bad-argument-type]
@@ -4066,8 +4056,22 @@
   --> tests/unit_tests/core/memory/test_token_buffer_memory.py:59:16
 ERROR `in` is not supported between `int` and `object` [not-iterable]
    --> tests/unit_tests/core/memory/test_token_buffer_memory.py:325:16
+ERROR Object of class `PromptMessage` has no attribute `files` [missing-attribute]
+   --> tests/unit_tests/core/memory/test_token_buffer_memory.py:354:47
+ERROR Object of class `PromptMessage` has no attribute `is_user_message` [missing-attribute]
+   --> tests/unit_tests/core/memory/test_token_buffer_memory.py:355:16
+ERROR Object of class `PromptMessage` has no attribute `files` [missing-attribute]
+   --> tests/unit_tests/core/memory/test_token_buffer_memory.py:356:16
 ERROR Object of class `FunctionType` has no attribute `side_effect` [missing-attribute]
-   --> tests/unit_tests/core/memory/test_token_buffer_memory.py:429:9
+   --> tests/unit_tests/core/memory/test_token_buffer_memory.py:439:9
+ERROR Object of class `PromptMessage` has no attribute `files` [missing-attribute]
+   --> tests/unit_tests/core/memory/test_token_buffer_memory.py:697:16
+ERROR Object of class `PromptMessage` has no attribute `files` [missing-attribute]
+   --> tests/unit_tests/core/memory/test_token_buffer_memory.py:698:20
+ERROR Object of class `PromptMessage` has no attribute `image_detail` [missing-attribute]
+   --> tests/unit_tests/core/memory/test_token_buffer_memory.py:699:16
+ERROR Object of class `PromptMessage` has no attribute `files` [missing-attribute]
+   --> tests/unit_tests/core/memory/test_token_buffer_memory.py:792:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow_execution` with type `WorkflowExecution | None` in function `core.ops.ops_trace_manager.TraceTask.__init__` [bad-argument-type]
    --> tests/unit_tests/core/ops/entities/test_trace_entity.py:103:28
 ERROR Object of class `dict` has no attribute `metadata` [missing-attribute]

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 79.89% 79.90% +0.01%
Strict coverage 79.58% 79.59% +0.01%
Typed symbols 76,592 76,621 +29
Untyped symbols 19,357 19,354 -3
Modules 3978 3982 +4

@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.44737% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.53%. Comparing base (1f500e5) to head (11eff18).

Files with missing lines Patch % Lines
api/services/agent/workflow_message_history.py 86.95% 4 Missing and 2 partials ⚠️
api/services/agent/message_history.py 94.11% 1 Missing and 1 partial ⚠️
api/core/agent/base_agent_runner.py 92.85% 0 Missing and 1 partial ⚠️
api/core/agent/fc_agent_runner.py 92.85% 0 Missing and 1 partial ⚠️
api/core/memory/token_buffer_memory.py 94.44% 0 Missing and 1 partial ⚠️
...i/core/workflow/nodes/agent/message_transformer.py 80.00% 0 Missing and 1 partial ⚠️
api/core/workflow/nodes/agent/runtime_support.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #44502   +/-   ##
=======================================
  Coverage   89.52%   89.53%           
=======================================
  Files        6009     6011    +2     
  Lines      376843   376876   +33     
  Branches    76238    76230    -8     
=======================================
+ Hits       337380   337433   +53     
+ Misses      33465    33443   -22     
- Partials     5998     6000    +2     
Flag Coverage Δ
api 89.40% <90.78%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Keep a single migration head after the current KnowledgeFS chain, emit complete calls once in the model fixture, and update history fixtures and their types for complete database turns.
Include the existing replay tests in the KnowledgeFS glue gate and verify that a malformed persisted snapshot falls back atomically to legacy tool history without leaking stale replay data.
@WH-2099 WH-2099 removed this from the 1.19.0 milestone Nov 2, 2026
@WH-2099 WH-2099 changed the title fix(agent): preserve complete model messages through tools and history fix(agent): preserve complete model messages Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant