Skip to content

[fix]: testset sync related issues#3958

Open
ashrafchowdury wants to merge 8 commits intorelease/v0.93.1from
forntend/fix-stateless-playground-bug-fixes
Open

[fix]: testset sync related issues#3958
ashrafchowdury wants to merge 8 commits intorelease/v0.93.1from
forntend/fix-stateless-playground-bug-fixes

Conversation

@ashrafchowdury
Copy link
Contributor

@ashrafchowdury ashrafchowdury commented Mar 11, 2026

What's fixed??

  • Load the JSON testcase on playground
  • Removed version 0 testset from the UI
  • Removed testcase_dedup_id and parent data column from the testset modal
  • Cleanup

QA

  1. You should be able to load the JSON data testcase on the playground
  2. You should not be able to see the version 0 testset on the testset modals version list
  3. You should not be able to see testcase_dedup_id and the parent data column on the testset table
  4. The testset sync flow works as before

Open with Devin

@vercel
Copy link

vercel bot commented Mar 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Mar 12, 2026 11:39am

Request Review

@ashrafchowdury ashrafchowdury marked this pull request as ready for review March 11, 2026 13:40
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Mar 11, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2026

Railway Preview Environment

Preview URL https://gateway-production-8c30.up.railway.app/w
Project agenta-oss-pr-3958
Image tag pr-3958-aa9937d
Status Deployed
Railway logs Open logs
Workflow logs View workflow run
Updated at 2026-03-12T11:41:48.035Z

@ashrafchowdury ashrafchowdury linked an issue Mar 11, 2026 that may be closed by this pull request
@ashrafchowdury ashrafchowdury changed the base branch from main to release/v0.93.1 March 11, 2026 14:44
ashrafchowdury and others added 2 commits March 11, 2026 21:23
…estset-sync-confirmation

[feat]: Added warning UIs for `testset` disconnect & change
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Mar 12, 2026
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

View 6 additional findings in Devin Review.

Open in Devin Review

Comment on lines +503 to +504
? revisionVersion
? `${testsetName} (v${revisionVersion})`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Truthy check on revisionVersion drops version 0 from display name

The old code used revisionVersion != null to gate the version suffix in the display name, which correctly allowed version 0 through. The new code uses a bare truthy check (revisionVersion ? ...), which treats 0 as falsy. If a v0 (draft) revision is ever connected, the display name will omit the version suffix entirely, producing just testsetName instead of testsetName (v0). While the PR also filters v0 from the selection UI (testsetRelationAdapter.ts:95), other code paths (e.g. snapshot hydration, direct connectToTestset calls) could still pass revisionVersion: 0.

Suggested change
? revisionVersion
? `${testsetName} (v${revisionVersion})`
? revisionVersion != null
? `${testsetName} (v${revisionVersion})`
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines 539 to 544
hasSuccessfulResults,
handleSyncOpen,
handleDisconnect,
handleChangeTestset,
handleAddToTestset,
])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 handleManageTestcasesClick missing from menuItems useMemo dependency array

The menuItems useMemo at TestsetDropdown/index.tsx:479 references handleManageTestcasesClick in the onClick handler for the "manage" menu item (line 512), but handleManageTestcasesClick is not listed in the dependency array (lines 536-544). This means the memoized menu will capture a stale closure of handleManageTestcasesClick if its dependencies (loadableId, connectedSource?.id, store, initSelectionDraft) change. This was a pre-existing issue but is still present after the PR's changes to the dependency array.

(Refers to lines 536-544)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 new potential issues.

View 10 additional findings in Devin Review.

Open in Devin Review

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 mutations.ts SYSTEM_FIELDS replacement expands filtering of entity.data keys from 6 to 20+ fields

In web/packages/agenta-entities/src/testset/state/mutations.ts:76-79, the currentColumnsAtom iterates over entity.data keys and filters using SYSTEM_FIELDS. The old local constant only had 6 entries (id, __id, __isSkeleton, key, created_at, updated_at). The replacement SYSTEM_FIELDS from @agenta/entities/testcase has 20+ entries including flags, tags, meta, set_id, testset_id, etc.

While entity.data (nested testcase format) normally only contains user columns, if a user's column data happens to be named tags, meta, or flags (all plausible column names), those columns would now be silently excluded from currentColumnsAtom derivation. This was not the case before.

(Refers to lines 76-79)

Prompt for agents
In web/packages/agenta-entities/src/testset/state/mutations.ts, the currentColumnsAtom (around line 59-99) reads keys from entity.data (the nested data sub-object which is user column space). The old local SYSTEM_FIELDS only had 6 entries: 'id', '__id', '__isSkeleton', 'key', 'created_at', 'updated_at'. The new imported SYSTEM_FIELDS has 20+ entries. Consider keeping a smaller set for this specific use case (filtering within entity.data), since fields like 'tags', 'meta', 'flags' could be legitimate user-defined column names. The broader SYSTEM_FIELDS set is correct for top-level entity filtering but too aggressive for filtering within the data sub-object.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +32 to +35
export const isSystemColumnPath = (columnKey: string): boolean => {
if (!columnKey) return false

return columnKey.split(".").some((segment) => SYSTEM_COLUMN_SET.has(segment))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 isSystemColumnPath over-filters nested user data columns by checking every path segment

The new isSystemColumnPath function splits a column key on . and returns true if ANY segment is in SYSTEM_COLUMN_SET. This means legitimate nested user data columns like event.id, response.meta, user.tags, item.key, or data.created_at would be incorrectly filtered from the table display. Fields like id, key, meta, tags, flags, created_at, updated_at are extremely common in nested API response objects that users store as testcase data.

This function is called in web/oss/src/components/TestcasesTableNew/hooks/useTestcasesTable.ts:193-198 to filter both baseColumns and columns (which include expanded/nested columns from expandedColumnsAtom). The top-level system field filtering is already handled by currentColumnKeysAtom in columnState.ts, so this function only needs to handle nested paths — but it incorrectly applies system field matching to intermediate and leaf segments of user data.

Prompt for agents
In web/oss/src/components/TestcasesTableNew/hooks/constants.ts, the isSystemColumnPath function (lines 32-35) needs to be changed so it only checks the FIRST segment (top-level key) against the system column set, not every segment. Nested sub-keys like 'id', 'meta', 'tags', 'key' etc. are common in user data objects and should not be filtered. For example:

export const isSystemColumnPath = (columnKey: string): boolean => {
    if (!columnKey) return false
    const segments = columnKey.split(".")
    return SYSTEM_COLUMN_SET.has(segments[0])
}

Alternatively, only check the leaf segment for internal-only fields (like __dedup_id__, __isSkeleton) while checking the root segment for all system fields.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +424 to +425
// Never expose internal/system fields as nested columns.
if (SYSTEM_FIELDS.has(subKey) || subKey.startsWith("_")) return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 collectObjectSubKeysRecursive hides legitimate nested fields named id, key, meta, etc.

The new guard if (SYSTEM_FIELDS.has(subKey) || subKey.startsWith("_")) return in collectObjectSubKeysRecursive filters out nested object properties that share names with system fields. SYSTEM_FIELDS includes id, key, meta, tags, flags, created_at, updated_at, etc. — all common field names in user data objects.

For example, a testcase with data {response: {id: "resp-123", text: "Hello"}} would only expand to column response.text; response.id would be silently hidden. The subKey.startsWith("_") check is also too broad, filtering legitimate fields like _id (MongoDB), _type, _source (Elasticsearch).

Previously this function had no such filter, so all nested properties were expanded into sub-columns. This is a regression.

Suggested change
// Never expose internal/system fields as nested columns.
if (SYSTEM_FIELDS.has(subKey) || subKey.startsWith("_")) return
// Never expose double-underscore internal fields as nested columns.
if (subKey.startsWith("__")) return
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loading JSON test set fields breaks playground display

3 participants