{functionNamePropertyId ? (
@@ -130,7 +130,7 @@ const PromptMessageHeader: React.FC
= ({
variantId={variantId}
rowId={rowId}
as="SimpleInput"
- className="message-user-select px-0 text-right"
+ className="message-user-select px-2 text-right"
disabled={disabled}
placeholder="Tool call id"
/>
diff --git a/web/oss/src/state/testset/index.tsx b/web/oss/src/state/testset/index.tsx
index 1a018f9dd8..62d20f7a37 100644
--- a/web/oss/src/state/testset/index.tsx
+++ b/web/oss/src/state/testset/index.tsx
@@ -7,20 +7,24 @@ import axios from "@/oss/lib/api/assets/axiosConfig"
import {getAgentaApiUrl} from "@/oss/lib/helpers/api"
import {TestSet} from "@/oss/lib/Types"
-import {previewTestsetsQueryAtom, testsetsQueryAtom} from "./atoms/fetcher"
+import {previewTestsetsQueryAtom, testsetsQueryAtomFamily} from "./atoms/fetcher"
import {useTestset} from "./hooks/useTestset"
/**
* Hook for regular/legacy testsets
*/
export const useTestsetsData = ({enabled = true} = {}) => {
- const [{data: testsets, isPending, refetch, error, isError}] = useAtom(testsetsQueryAtom)
+ const [{data: testsets, isPending, isLoading, refetch, error, isError}] = useAtom(
+ testsetsQueryAtomFamily({enabled}),
+ )
const queryClient = useQueryClient()
const [columnsFallback, setColumnsFallback] = useState>({})
const [csvVersion, setCsvVersion] = useState(0)
+ const [isValidating, setIsValidating] = useState(false)
// Extract CSV columns from the TanStack Query cache for any testset
const cachedColumnsByTestsetId = useMemo(() => {
+ if (!enabled) return {}
const result: Record = {}
;(testsets ?? []).forEach((ts: any) => {
const csv = queryClient.getQueryData(["testsetCsvData", ts?._id])
@@ -43,6 +47,7 @@ export const useTestsetsData = ({enabled = true} = {}) => {
// Merge cache with fallback (from preview single testcase query)
const columnsByTestsetId = useMemo(() => {
+ if (!enabled) return {}
const merged: Record = {...cachedColumnsByTestsetId}
Object.entries(columnsFallback).forEach(([id, cols]) => {
if (!merged[id] || (merged[id]?.length ?? 0) === 0) {
@@ -55,6 +60,9 @@ export const useTestsetsData = ({enabled = true} = {}) => {
// Background fill: for testsets without cached columns, fetch a single testcase to infer columns
const triedRef = useRef>(new Set())
useEffect(() => {
+ if (!enabled) return
+ if (isPending || isLoading) return
+
const controller = new AbortController()
const tried = triedRef.current
const run = async () => {
@@ -74,6 +82,8 @@ export const useTestsetsData = ({enabled = true} = {}) => {
await Promise.all(
toFetch.map(async (ts: any) => {
try {
+ setIsValidating(true)
+
const url = `${getAgentaApiUrl()}/preview/testcases/query`
const {data} = await axios.post(
url,
@@ -97,7 +107,7 @@ export const useTestsetsData = ({enabled = true} = {}) => {
if (cols.length) {
setColumnsFallback((prev) => ({...prev, [ts._id]: cols}))
// Also hydrate the primary cache so all consumers see columns immediately
- queryClient.setQueryData(["testsetCsvData", ts._id], [dataObj])
+ // queryClient.setQueryData(["testsetCsvData", ts._id], [dataObj])
} else {
tried.add(ts._id)
}
@@ -105,13 +115,16 @@ export const useTestsetsData = ({enabled = true} = {}) => {
// swallow; keep fallback empty for this id
tried.add(ts._id)
// console.warn("Failed to infer columns for testset", ts?._id, e)
+ } finally {
+ setIsValidating(false)
}
}),
)
+
}
run()
return () => controller.abort()
- }, [testsets, columnsByTestsetId, columnsFallback])
+ }, [testsets, columnsByTestsetId, columnsFallback, isPending, isLoading])
// When any testsetCsvData query updates, bump csvVersion
useEffect(() => {
@@ -130,7 +143,7 @@ export const useTestsetsData = ({enabled = true} = {}) => {
testsets: testsets ?? [],
isError,
error,
- isLoading: isPending,
+ isLoading: isPending || isLoading || isValidating,
mutate: refetch,
// New helpers (non-breaking):
columnsByTestsetId,
diff --git a/web/oss/src/styles/code-editor-styles.css b/web/oss/src/styles/code-editor-styles.css
index 7f28485ac3..b35b1bf5bf 100644
--- a/web/oss/src/styles/code-editor-styles.css
+++ b/web/oss/src/styles/code-editor-styles.css
@@ -173,12 +173,15 @@
.editor-code.language-json .editor-code-line[data-old-line-number],
.editor-code.language-json .editor-code-line[data-new-line-number],
.editor-code.language-yaml .editor-code-line[data-old-line-number],
- .editor-code.language-yaml .editor-code-line[data-new-line-number] {
+ .editor-code.language-yaml .editor-code-line[data-new-line-number],
+ .editor-code.language-code .editor-code-line[data-old-line-number],
+ .editor-code.language-code .editor-code-line[data-new-line-number] {
padding-left: 64px;
}
.editor-code.language-json .editor-code-line[data-old-line-number]::before,
- .editor-code.language-yaml .editor-code-line[data-old-line-number]::before {
+ .editor-code.language-yaml .editor-code-line[data-old-line-number]::before,
+ .editor-code.language-code .editor-code-line[data-old-line-number]::before {
content: attr(data-old-line-number) !important;
padding-right: 4px;
box-sizing: border-box;
@@ -199,7 +202,8 @@
}
.editor-code.language-json .editor-code-line[data-new-line-number]::after,
- .editor-code.language-yaml .editor-code-line[data-new-line-number]::after {
+ .editor-code.language-yaml .editor-code-line[data-new-line-number]::after,
+ .editor-code.language-code .editor-code-line[data-new-line-number]::after {
content: attr(data-new-line-number) !important;
padding-right: 0px;
padding-left: 4px;
@@ -458,4 +462,4 @@
margin-bottom: 0px;
font-size: 10px;
}
-}
\ No newline at end of file
+}
diff --git a/web/package.json b/web/package.json
index 68d5ab27f4..ce1ef87cde 100644
--- a/web/package.json
+++ b/web/package.json
@@ -1,6 +1,6 @@
{
"name": "agenta-web",
- "version": "0.59.10",
+ "version": "0.59.11",
"workspaces": [
"ee",
"oss",