Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
7bf7704
test(api): migrate App and Agent runner coverage to service adapters
41tair Oct 8, 2026
d953ee5
Merge updated stack base and resolve conflicts in refactor/api-76-10-5
41tair Oct 8, 2026
34097ad
test(app): adapt generation and agent execution to injected ports
41tair Oct 9, 2026
008b1bc
Merge updated stack base into refactor/api-76-10-5
41tair Oct 9, 2026
ad96262
Merge updated refactor/api-76-10-4
41tair Oct 15, 2026
48f58dd
fix(workflow): address review findings in #43689
41tair Oct 15, 2026
f2319c8
Merge updated refactor/api-76-10-4 into refactor/api-76-10-5
41tair Oct 19, 2026
a18ca61
Merge updated refactor/api-76-10-4 into refactor/api-76-10-5
41tair Oct 19, 2026
715d85e
Merge updated refactor/api-76-10-4 into refactor/api-76-10-5
41tair Oct 19, 2026
f7280cc
Merge updated refactor/api-76-10-4 into refactor/api-76-10-5
41tair Oct 19, 2026
27ecb1c
Merge updated refactor/api-76-10-5 parent with Graphon 0.8 compatibility
41tair Oct 20, 2026
48ee911
Merge workflow migration compatibility from updated parent
41tair Oct 20, 2026
80142f6
test(api): adapt tests to merged execution interfaces
41tair Oct 20, 2026
6966e0c
Merge updated refactor/api-76-10-4 into refactor/api-76-10-5
41tair Oct 26, 2026
17efdd8
Sync validated refactor/api-76-10-4 fixes
41tair Oct 26, 2026
0b2bf80
Adapt migrated runner tests to explicit typed service ports
41tair Oct 26, 2026
304b24e
Sync validated refactor/api-76-10-4 fixes
41tair Oct 26, 2026
78e1b02
Patch the service request builder in tracing recovery tests
41tair Oct 26, 2026
09c0fcb
Sync validated refactor/api-76-10-4 fixes
41tair Oct 26, 2026
26d9cda
Sync validated refactor/api-76-10-4 fixes
41tair Oct 26, 2026
bea4569
Sync validated refactor/api-76-10-4 fixes
41tair Oct 26, 2026
e9a0fea
Sync validated refactor/api-76-10-4 fixes
41tair Oct 26, 2026
8c91a13
Preserve service runner tests through workflow model migration
41tair Oct 26, 2026
a6d75dd
Sync validated refactor/api-76-10-4 fixes
41tair Oct 26, 2026
f50ffb9
Sync validated refactor/api-76-10-4 fixes
41tair Oct 26, 2026
be5fc66
Sync validated refactor/api-76-10-4 fixes
41tair Oct 26, 2026
cea3652
Sync validated refactor/api-76-10-4 fixes
41tair Oct 27, 2026
0da5f11
Sync validated refactor/api-76-10-4 fixes
41tair Oct 27, 2026
3749b8e
Sync validated refactor/api-76-10-4 fixes
41tair Oct 27, 2026
432b776
[autofix.ci] apply automated fixes
autofix-ci[bot] Oct 27, 2026
a412f9a
Merge updated refactor/api-76-10-4 into refactor/api-76-10-5
41tair Oct 31, 2026
bf20b2d
Sync validated refactor/api-76-10-2 fixes
41tair Oct 31, 2026
579608a
Sync validated refactor/api-76-10-3 fixes
41tair Oct 31, 2026
fce431a
Sync validated refactor/api-76-10-4 fixes
41tair Oct 31, 2026
51d3e60
Sync validated refactor/api-76-10-4 fixes
41tair Oct 31, 2026
2a8630d
Sync validated refactor/api-76-10-4 fixes
41tair Oct 31, 2026
06285b1
Sync validated refactor/api-76-10-4 fixes
41tair Oct 31, 2026
7362160
Inject migrated workflow contexts in HITL reconnect tests
41tair Oct 31, 2026
eff3602
Pass typed converter dependencies in HITL v2 tests
41tair Oct 31, 2026
102a69c
Sync validated refactor/api-76-10-4 fixes
41tair Oct 31, 2026
f9d8d8e
Sync validated refactor/api-76-10-4 fixes
41tair Oct 31, 2026
778e1ea
Sync validated refactor/api-76-10-4 fixes
41tair Oct 31, 2026
bc7074d
Format migrated test fixtures
41tair Oct 31, 2026
51391e2
Use workflow identity service at invocation boundary
41tair Oct 31, 2026
8c03a73
Sync validated refactor/api-76-10-4 fixes
41tair Oct 31, 2026
f58d796
Sync validated refactor/api-76-10-4 fixes
41tair Oct 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/services/agent/chat/base_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,9 @@ def organize_agent_history(
else:
tool_responses = dict.fromkeys(tool_names, observation_payload)

for tool in tool_names:
# generate a uuid for tool call
tool_call_id = str(uuid.uuid4())
for index, tool in enumerate(tool_names):
# Keep IDs stable across turns so replayed history can use prompt caching.
tool_call_id = str(uuid.uuid5(uuid.NAMESPACE_OID, f"{agent_thought.id}:{index}:{tool}"))
tool_calls.append(
AssistantPromptMessage.ToolCall(
id=tool_call_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ def workflow_start_to_stream_response(
run_id = self._ensure_workflow_run_id(workflow_run_id)
started_at = naive_utc_now()
self._workflow_started_at = started_at
self._application_generate_entity.workflow_execution_timing.start()
if reason == WorkflowStartReason.RESUMPTION:
self._node_snapshots.update(
(NodeExecutionId(snapshot.execution_id), snapshot) for snapshot in node_execution_snapshots
Expand Down Expand Up @@ -310,7 +311,7 @@ def workflow_finish_to_stream_response(
)

finished_at = naive_utc_now()
elapsed_time = (finished_at - started_at).total_seconds()
elapsed_time = self._application_generate_entity.workflow_execution_timing.finish()

outputs_mapping = graph_runtime_state.outputs or {}
encoded_outputs = WorkflowRuntimeTypeConverter().to_json_encodable(outputs_mapping)
Expand Down Expand Up @@ -363,8 +364,7 @@ def workflow_pause_to_stream_response(
raise ValueError(
"workflow_pause_to_stream_response called before workflow_start_to_stream_response",
)
paused_at = naive_utc_now()
elapsed_time = (paused_at - started_at).total_seconds()
elapsed_time = self._application_generate_entity.workflow_execution_timing.finish()
encoded_outputs = self._encode_outputs(event.outputs) or {}
if self._application_generate_entity.invoke_from == InvokeFrom.SERVICE_API:
encoded_outputs = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
from models.enums import WorkflowRunTriggeredFrom
from models.model import App, EndUser
from models.workflow import WorkflowNodeExecutionTriggeredFrom
from repositories.entities.workflow_execution import WorkflowExecutionIdentity
from services.app.file_input_defaults import grant_file_default_access
from services.app.generation.input_adapter import AppInputAdapter
from services.workflow.contracts import WorkflowSnapshot
Expand All @@ -60,6 +59,7 @@

if TYPE_CHECKING:
from services.workflow.execution.contracts import WorkflowRunDriver
from services.workflow_execution_identity import WorkflowExecutionIdentity

logger = logging.getLogger(__name__)

Expand Down
9 changes: 9 additions & 0 deletions api/tests/unit_tests/core/agent/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from unittest.mock import MagicMock, create_autospec

import pytest

from services.agent.chat.ports import AgentToolInvoker


class DummyTool:
def __init__(self, name):
Expand Down Expand Up @@ -78,3 +82,8 @@ def _factory(**kwargs):
return DummyScratchpadUnit(**kwargs)

return _factory


@pytest.fixture
def agent_tool_invoker() -> MagicMock:
return create_autospec(AgentToolInvoker, instance=True, spec_set=True)
Loading
Loading