diff --git a/typescript-sdk/apps/dojo/e2e/tests/crewAITests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/crewAITests/predictvieStateUpdatePage.spec.ts index e676e5043..aea45d2fc 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/crewAITests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/crewAITests/predictvieStateUpdatePage.spec.ts @@ -1,13 +1,12 @@ import { test, expect, - waitForAIResponse, retryOnAIFailure, } from "../../test-isolation-helper"; import { PredictiveStateUpdatesPage } from "../../pages/crewAIPages/PredictiveStateUpdatesPage"; test.describe("Predictive Status Updates Feature", () => { - test.fixme("[CrewAI] should interact with agent and approve asked changes", async ({ + test("[CrewAI] should interact with agent and approve asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { @@ -22,7 +21,7 @@ test.describe("Predictive Status Updates Feature", () => { await predictiveStateUpdates.sendMessage( "Give me a story for a dragon called Atlantis in document" ); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); await predictiveStateUpdates.getUserApproval(); await predictiveStateUpdates.confirmedChangesResponse.isVisible(); @@ -33,7 +32,7 @@ test.describe("Predictive Status Updates Feature", () => { // Send update to change the dragon name await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); await predictiveStateUpdates.getUserApproval(); await predictiveStateUpdates.confirmedChangesResponse.nth(1).isVisible(); @@ -44,7 +43,7 @@ test.describe("Predictive Status Updates Feature", () => { }); }); - test.fixme("[CrewAI] should interact with agent and reject asked changes", async ({ + test("[CrewAI] should interact with agent and reject asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { @@ -70,7 +69,7 @@ test.describe("Predictive Status Updates Feature", () => { // Send update to change the dragon name await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); await predictiveStateUpdates.getUserRejection(); await predictiveStateUpdates.rejectedChangesResponse.isVisible(); diff --git a/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/predictvieStateUpdatePage.spec.ts index 3ca0f0e37..fc11ba9fd 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/predictvieStateUpdatePage.spec.ts @@ -1,13 +1,12 @@ import { test, expect, - waitForAIResponse, retryOnAIFailure, } from "../../test-isolation-helper"; import { PredictiveStateUpdatesPage } from "../../pages/langGraphFastAPIPages/PredictiveStateUpdatesPage"; test.describe("Predictive Status Updates Feature", () => { - test.fixme("[LangGraph FastAPI] should interact with agent and approve asked changes", async ({ + test("[LangGraph FastAPI] should interact with agent and approve asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { @@ -23,7 +22,6 @@ test.describe("Predictive Status Updates Feature", () => { await predictiveStateUpdates.sendMessage( "Give me a story for a dragon called Atlantis in document" ); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); @@ -37,7 +35,6 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(3000); await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); @@ -50,7 +47,7 @@ test.describe("Predictive Status Updates Feature", () => { }); }); - test.fixme("[LangGraph FastAPI] should interact with agent and reject asked changes", async ({ + test("[LangGraph FastAPI] should interact with agent and reject asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { @@ -66,7 +63,6 @@ test.describe("Predictive Status Updates Feature", () => { await predictiveStateUpdates.sendMessage( "Give me a story for a dragon called Atlantis in document" ); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); @@ -80,7 +76,6 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(3000); await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); diff --git a/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/predictvieStateUpdatePage.spec.ts index ac3833ad2..22ae72f33 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/predictvieStateUpdatePage.spec.ts @@ -1,13 +1,12 @@ import { test, expect, - waitForAIResponse, retryOnAIFailure, } from "../../test-isolation-helper"; import { PredictiveStateUpdatesPage } from "../../pages/langGraphPages/PredictiveStateUpdatesPage"; test.describe("Predictive Status Updates Feature", () => { - test.fixme("[LangGraph] should interact with agent and approve asked changes", async ({ + test("[LangGraph] should interact with agent and approve asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { @@ -23,7 +22,6 @@ test.describe("Predictive Status Updates Feature", () => { await predictiveStateUpdates.sendMessage( "Give me a story for a dragon called Atlantis in document" ); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); @@ -37,7 +35,6 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(3000); await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); @@ -50,7 +47,7 @@ test.describe("Predictive Status Updates Feature", () => { }); }); - test.fixme("[LangGraph] should interact with agent and reject asked changes", async ({ + test("[LangGraph] should interact with agent and reject asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { @@ -66,7 +63,6 @@ test.describe("Predictive Status Updates Feature", () => { await predictiveStateUpdates.sendMessage( "Give me a story for a dragon called Atlantis in document" ); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); @@ -80,7 +76,6 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(3000); await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); diff --git a/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts index 0221871aa..3f386a236 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts @@ -1,7 +1,6 @@ import { test, expect, - waitForAIResponse, retryOnAIFailure, } from "../../test-isolation-helper"; import { PredictiveStateUpdatesPage } from "../../pages/pydanticAIPages/PredictiveStateUpdatesPage"; @@ -22,7 +21,7 @@ test.describe("Predictive Status Updates Feature", () => { await predictiveStateUpdates.sendMessage( "Give me a story for a dragon called Atlantis in document" ); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); await predictiveStateUpdates.getUserApproval(); await predictiveStateUpdates.confirmedChangesResponse.isVisible(); @@ -33,7 +32,7 @@ test.describe("Predictive Status Updates Feature", () => { // Send update to change the dragon name await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); await predictiveStateUpdates.getUserApproval(); await predictiveStateUpdates.confirmedChangesResponse.nth(1).isVisible(); @@ -70,7 +69,7 @@ test.describe("Predictive Status Updates Feature", () => { // Send update to change the dragon name await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); await predictiveStateUpdates.getUserRejection(); await predictiveStateUpdates.rejectedChangesResponse.isVisible(); diff --git a/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/predictvieStateUpdatePage.spec.ts index a5584c22a..d697e94cf 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/predictvieStateUpdatePage.spec.ts @@ -1,8 +1,8 @@ -import { test, expect, waitForAIResponse, retryOnAIFailure, } from "../../test-isolation-helper"; +import { test, expect, retryOnAIFailure, } from "../../test-isolation-helper"; import { PredictiveStateUpdatesPage } from "../../pages/serverStarterAllFeaturesPages/PredictiveStateUpdatesPage"; test.describe("Predictive Status Updates Feature", () => { - test.fixme("[Server Starter all features] should interact with agent and approve asked changes", async ({ page, }) => { + test("[Server Starter all features] should interact with agent and approve asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { const predictiveStateUpdates = new PredictiveStateUpdatesPage(page); @@ -14,7 +14,7 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(2000); await predictiveStateUpdates.sendMessage("Hi"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); @@ -27,7 +27,7 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(3000); await predictiveStateUpdates.sendMessage("Change the dog name"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); @@ -41,7 +41,7 @@ test.describe("Predictive Status Updates Feature", () => { }); }); - test.fixme("[Server Starter all features] should interact with agent and reject asked changes", async ({ page, }) => { + test("[Server Starter all features] should interact with agent and reject asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { const predictiveStateUpdates = new PredictiveStateUpdatesPage(page); @@ -53,7 +53,7 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(2000); await predictiveStateUpdates.sendMessage("Hi"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); @@ -66,7 +66,7 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(3000); await predictiveStateUpdates.sendMessage("Change the dog name"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); diff --git a/typescript-sdk/integrations/langgraph/examples/python/poetry.lock b/typescript-sdk/integrations/langgraph/examples/python/poetry.lock index b3c6e426e..478fd5122 100644 --- a/typescript-sdk/integrations/langgraph/examples/python/poetry.lock +++ b/typescript-sdk/integrations/langgraph/examples/python/poetry.lock @@ -2,14 +2,14 @@ [[package]] name = "ag-ui-langgraph" -version = "0.0.5" +version = "0.0.7" description = "Implementation of the AG-UI protocol for LangGraph." optional = false python-versions = "<3.14,>=3.10" groups = ["main"] files = [ - {file = "ag_ui_langgraph-0.0.5-py3-none-any.whl", hash = "sha256:77ef1a3121818a95907f797972acd7290ec730ada57efeee7bdb6bc6ab24baed"}, - {file = "ag_ui_langgraph-0.0.5.tar.gz", hash = "sha256:63bd4934bab95042d9095940321d3ee1930b662141e704617d942006943d2a07"}, + {file = "ag_ui_langgraph-0.0.7-py3-none-any.whl", hash = "sha256:35b43bf74b3dc568943bb0808141ae6e583b3c08596892b21a647072434d2f34"}, + {file = "ag_ui_langgraph-0.0.7.tar.gz", hash = "sha256:5ca32d6f04f40073493227fb272d3493e84cd0e0f5a269d74d0ac1a4234cfe04"}, ] [package.dependencies] @@ -2970,4 +2970,4 @@ cffi = ["cffi (>=1.11)"] [metadata] lock-version = "2.1" python-versions = ">=3.12,<3.14" -content-hash = "d8bfe3601f3fc50ba1f596c05f61c98c24455bb6751c5d491a2b923bbf617a26" +content-hash = "8e613797f8505b4f0067cb5a413b992cd63ce1ccaa4b4bda9b65a019c723d45b" diff --git a/typescript-sdk/integrations/langgraph/examples/python/pyproject.toml b/typescript-sdk/integrations/langgraph/examples/python/pyproject.toml index 36ebdeb6d..e17abfa59 100644 --- a/typescript-sdk/integrations/langgraph/examples/python/pyproject.toml +++ b/typescript-sdk/integrations/langgraph/examples/python/pyproject.toml @@ -21,7 +21,7 @@ langchain-experimental = ">=0.0.11" langchain-google-genai = ">=2.1.9" langchain-openai = ">=0.0.1" langgraph = "^0.6.1" -ag-ui-langgraph = { version = "0.0.5", extras = ["fastapi"] } +ag-ui-langgraph = { version = "0.0.7", extras = ["fastapi"] } python-dotenv = "^1.0.0" fastapi = "^0.115.12" diff --git a/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/agent.py b/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/agent.py index 493fbbf4b..03ff8fe5a 100644 --- a/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/agent.py +++ b/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/agent.py @@ -100,11 +100,13 @@ async def run(self, input: RunAgentInput) -> AsyncGenerator[str, None]: async def _handle_stream_events(self, input: RunAgentInput) -> AsyncGenerator[str, None]: thread_id = input.thread_id or str(uuid.uuid4()) - self.active_run = { + INITIAL_ACTIVE_RUN = { "id": input.run_id, "thread_id": thread_id, "thinking_process": None, + "node_name": None, } + self.active_run = INITIAL_ACTIVE_RUN forwarded_props = input.forwarded_props node_name_input = forwarded_props.get('node_name', None) if forwarded_props else None @@ -256,7 +258,8 @@ async def _handle_stream_events(self, input: RunAgentInput) -> AsyncGenerator[st yield self._dispatch_event( RunFinishedEvent(type=EventType.RUN_FINISHED, thread_id=thread_id, run_id=self.active_run["id"]) ) - self.active_run = None + # Reset active run to how it was before the stream started + self.active_run = INITIAL_ACTIVE_RUN async def prepare_stream(self, input: RunAgentInput, agent_state: State, config: RunnableConfig):