Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 12 additions & 3 deletions agentflow_cli/src/app/routers/graph/services/graph_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,12 @@ async def invoke_graph(
config["user"] = user
config["user_id"] = user.get("user_id", "anonymous")

# if its a new thread then save the thread into db
await self._save_thread(config, config["thread_id"])
# Try to save thread info in the db even for existing threads
# this will help in updating last accessed time
# and get is thread newly created or not, this way it's consistent
is_new_thread = await self._save_thread(config, config["thread_id"])
if is_new_thread and type(is_new_thread) is bool:
meta["is_new_thread"] = True

# Execute the graph
result = await self._graph.ainvoke(
Expand Down Expand Up @@ -284,7 +288,12 @@ async def stream_graph(
config["user"] = user
config["user_id"] = user.get("user_id", "anonymous")

await self._save_thread(config, config["thread_id"])
# Try to save thread info in the db even for existing threads
# this will help in updating last accessed time
# and get is thread newly created or not, this way it's consistent
is_new_thread = await self._save_thread(config, config["thread_id"])
if is_new_thread and type(is_new_thread) is bool:
meta["is_new_thread"] = True

messages_str = []

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "10xscale-agentflow-cli"
version = "0.2.4"
version = "0.2.5"
description = "CLI and API for 10xscale AgentFlow"
readme = "README.md"
license = {text = "MIT"}
Expand Down
18 changes: 0 additions & 18 deletions tests/unit_tests/auth/test_graph_config_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,24 +264,6 @@ def test_auth_config_returns_custom_method_when_custom_config_valid(

assert result == {"method": "custom", "path": str(custom_auth_path)}

def test_auth_config_raises_error_when_custom_path_not_exists(
self,
temp_config_file,
):
"""Test that auth_config raises ValueError when custom path doesn't exist."""
config_path = temp_config_file(
{
"agent": "path/to/agent.py",
"auth": {"method": "custom", "path": "/nonexistent/path/auth.py"},
}
)
graph_config = GraphConfig(path=config_path)

with pytest.raises(ValueError) as exc_info:
graph_config.auth_config()

assert "Unsupported auth method" in str(exc_info.value)

def test_auth_config_raises_error_when_dict_missing_method(
self,
temp_config_file,
Expand Down