diff --git a/apps/vscode-e2e/src/suite/subtasks.test.ts b/apps/vscode-e2e/src/suite/subtasks.test.ts index 95d74970b..05b8178b1 100644 --- a/apps/vscode-e2e/src/suite/subtasks.test.ts +++ b/apps/vscode-e2e/src/suite/subtasks.test.ts @@ -241,10 +241,17 @@ suite("Roo Code Subtasks", function () { } finally { api.off(RooCodeEventName.Message, messageHandler) api.off(RooCodeEventName.TaskDelegationCompleted, delegationCompletedHandler) - if (api.getCurrentTaskStack().length > 0) { - await api.clearCurrentTask() + // TaskDelegationCompleted fires before createTaskWithHistoryItem completes, + // so the reopened parent may not be on the stack yet. Wait for it to appear + // before draining, otherwise the next test sees a late-rehydrated stray task. + if (delegationCompletedParentId) { + await waitFor( + () => + api.getCurrentTaskStack().length > 0 || + api.getCurrentTaskStack().includes(delegationCompletedParentId!), + ).catch(() => {}) } - if (api.getCurrentTaskStack().length > 0) { + while (api.getCurrentTaskStack().length > 0) { await api.clearCurrentTask() } await waitFor(() => api.getCurrentTaskStack().length === 0).catch(() => {}) diff --git a/package.json b/package.json index 5a61224b0..2c1dd7763 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "glob": "11.1.0", "@types/react": "18.3.31", "@types/react-dom": "18.3.7", - "csstype": "3.1.3", + "csstype": "3.2.3", "zod": "3.25.76" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 42ac84d18..c77f979c7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,7 +15,7 @@ overrides: glob: 11.1.0 '@types/react': 18.3.31 '@types/react-dom': 18.3.7 - csstype: 3.1.3 + csstype: 3.2.3 zod: 3.25.76 importers: @@ -4031,8 +4031,8 @@ packages: resolution: {integrity: sha512-W0Y2HOXlPkb2yaKrCVRjinYKciu/qSLEmK0K9mcfDei3zwlnHFEHAs/Du3cIRwPqY+J4JsiBzUjoHyc8RsJ03A==} engines: {node: '>=18'} - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} + csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} cytoscape-cose-bilkent@4.1.0: resolution: {integrity: sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ==} @@ -10779,7 +10779,7 @@ snapshots: '@types/react@18.3.31': dependencies: '@types/prop-types': 15.7.14 - csstype: 3.1.3 + csstype: 3.2.3 '@types/retry@0.12.0': {} @@ -11755,7 +11755,7 @@ snapshots: '@asamuzakjp/css-color': 3.2.0 rrweb-cssom: 0.8.0 - csstype@3.1.3: {} + csstype@3.2.3: {} cytoscape-cose-bilkent@4.1.0(cytoscape@3.34.0): dependencies: @@ -14457,7 +14457,7 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 css-tree: 1.1.3 - csstype: 3.1.3 + csstype: 3.2.3 fastest-stable-stringify: 2.0.2 inline-style-prefixer: 7.0.1 react: 18.3.1 @@ -15948,7 +15948,7 @@ snapshots: styled-components@6.4.3(css-to-react-native@3.2.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@emotion/is-prop-valid': 1.4.0 - csstype: 3.1.3 + csstype: 3.2.3 react: 18.3.1 stylis: 4.3.6 optionalDependencies: