Skip to content

[chore] Zero out web tsc errors and fail builds on type regressions#5464

Open
ardaerzin wants to merge 13 commits into
release/v0.106.0from
ts-chore/fix-tsc-issues
Open

[chore] Zero out web tsc errors and fail builds on type regressions#5464
ardaerzin wants to merge 13 commits into
release/v0.106.0from
ts-chore/fix-tsc-issues

Conversation

@ardaerzin

Copy link
Copy Markdown
Contributor

Context

The web apps carried 591 (OSS) and 525 (EE) TypeScript errors, and next.config.ts set typescript.ignoreBuildErrors: true in both apps, so none of it ever failed a build. The errors hid real drift: types that no longer matched what the backend sends, components reading fields that do not exist, and a handful of code paths that would throw at runtime.

This PR brings both apps to zero tsc errors and flips ignoreBuildErrors to false, so next build now fails on any type regression.

Changes

All fixes are behavior preserving. The convention (from WP-4e-2a on fe-chore/move-evals-to-packages) is: fix the wrong type, not the runtime. Where the code itself is a latent bug, it is typed as-is with a cast plus a NOTE (typed as-is) comment instead of being silently repaired.

The work landed in stages, one commit each, so the diff can be reviewed commit by commit:

  1. tsconfig scope - excluded tests/ from both app tsconfigs. The playwright suites belong to the tests workspace (which owns @playwright/test); the manual scripts imported state modules that no longer exist.
  2. Restored types and repaired imports - a cleanup commit had removed Parameter, CorrectAnswer, _EvaluationScenario, PreviewTestCase from lib/Types.ts while consumers remained; several imports pointed at moved or renamed symbols.
  3. High-count clusters - e.g. useRunMetricData typed a field as the atom while storing the unwrapped value; webhook builders destructured a discriminated union before narrowing; filtersAtom did not accept updater functions its callers passed.
  4. EvalRunDetails layer - mirrors the vetted WP-4e-2a fixes, adapted to OSS import paths.
  5. TraceSpanNode boundary - the entities package and oss/src/services/tracing each declare a structurally equivalent TraceSpanNode (zod literal unions vs TS enums, null vs undefined). Every crossing now has a documented boundary cast; no data is converted.
  6. InfiniteVirtualTable root - one canonical ExtendedColumnType exported from the barrel for the custom column props (columnVisibilityLabel, defaultHidden, maxWidth, ...) that three consumers had each redeclared locally.
  7. Area sweeps - observability, drawers, playground, url state, onboarding, evaluators, testcases, services, EE Billing. API types were verified against the backend before adding fields (e.g. AgentaNodeDTO.trace_id/span_id exist on the wire; Org.default_workspace does not, so those reads are flagged latent instead).
  8. Build gate - ignoreBuildErrors: false in both apps.

Latent bugs surfaced (typed as-is, not fixed here)

These compile-proof findings are documented in code comments and tracked as follow-ups:

  • updateWorkspaceNameAtom sends a bare string as the org PATCH body; the backend requires an object, so the org half of a workspace rename 422s.
  • AddToTestsetDrawer calls traceSpanMolecule.actions.discard/update, which do not exist on the molecule (the write atoms live under reducers), so removing or editing a trace draft throws.
  • SessionDrawerButton is an unadapted copy of TraceDrawerButton with no consumers.
  • InfiniteVirtualTableFeatureShell accepts locale but never forwards it, so custom empty-state text never renders.
  • Two ReferenceError sites in the eval metrics layer (applyAggregatesToRaw, metricProcessor) kept from WP-4e-2a.

One deliberate exception: the playground testset "Add column" modal footer had dead child buttons (ModalFooter never renders children), so Cancel/OK were no-ops. The real onCancel/onConfirm props are now wired.

Tests / notes

  • pnpm --filter @agenta/oss exec tsc --noEmit and pnpm --filter @agenta/ee exec tsc --noEmit: 0 errors each.
  • Full next build for both apps passes with the type gate active.
  • Every stage was gated on an error-signature diff against the previous run, not the count, so fixes could not mask new errors.
  • web/tsc-error-inventory.md records the full progression and methodology.
  • Not live-verified in the running app beyond the production builds; the changes are type-level by design.

What to QA

  • Playground > testset dropdown > "Add column" modal: Cancel and OK buttons now actually close/confirm (they were dead before).
  • Smoke the heavy surfaces the sweep touched: evaluation run details tables, observability traces/sessions tables, trace drawer, add-to-testset drawer. Expect no visual or behavioral change anywhere else.

ardaerzin added 13 commits July 22, 2026 03:13
The playwright suites are owned and type-checked by the tests workspace,
which holds the @playwright/test dependency; tests/manual scripts import
state modules that no longer exist.
- Restore Parameter, CorrectAnswer and _EvaluationScenario to lib/Types.ts
  (removed by cleanup while consumers remained)
- Re-export MetricColumnDefinition from the EvalRunDetails table barrel
- TooltipButtonProps was renamed EnhancedButtonProps; statusMap moved to
  @agenta/entity-ui/variant
- Synthesize full Parameter objects in UseApiContent
- useRunMetricData: type selection as the unwrapped value, not the atom
- Webhook builders: narrow WebhookFormValues union before field access
- filtersAtom: accept updater functions in the write signature
- Organization settings: drop stale react-query v4 useErrorBoundary and
  migrate setQueriesData to the v5 filters shape
- evaluations/utils: surface variantId from invocation metadata
- PreviewTableRow: add index signature required by InfiniteTableRowBase
Mirrors the vetted WP-4e-2a in-place fixes from fe-chore/move-evals-to-packages
(adapted to OSS import paths) plus new fixes for the component layer:

- restore PreviewTestCase to lib/Types; re-export MetricProcessor/MetricScope
- add "input" to EvaluationColumnKind (backend mapping emits it) and type the
  visibility-label column extension in buildPreviewColumns
- recharts v3 API drift in EvaluatorMetricsChart (TooltipContentProps, tuple
  radius, MetricStripEntry contextual typing)
- widen evaluationType to EvaluationRunKind; type query atoms as nullable
- latent runtime bugs typed as-is per WP-4e-2a convention (applyAggregatesToRaw,
  metricProcessor ReferenceErrors, dead metric-group branches) - flagged, not fixed
…ant id

- createPaginatedEntityStore: refreshAtom/actions.refresh accept an optional
  value or updater (bare set() still bumps the counter) - clears the
  'Expected 0 arguments' cluster across testset modals and other consumers
- EnvironmentStatus: variant.id optional; the component already guards it
…ing layers; oss tsc 347->105

Parallel per-area pass, behavior-preserving throughout (latent runtime bugs are
typed as-is with NOTE comments per the WP-4e-2a convention, not silently fixed):

- TraceSpanNode OSS<->entities dual-type: aligned at every crossing with
  documented boundary casts (16 errors -> 0); annotations field added to the
  OSS node (drawer stores attach it at runtime)
- SharedDrawers: broken SessionDrawerButton imports repaired, JSON-schema
  access typed, null-safety in SelectEvaluators/AnnotateDrawer, drawer
  payload/ref/label types aligned with runtime
- observability: extended-column types for custom antd props, TraceRow/
  SessionRow InfiniteTableRowBase conformance, traceTabsAtom updater support,
  ag-attributes selector typing at the producer
- playground/url-state: removed drifted local duplicates of package types,
  eagerAtom->atom where deps are sync, modal/store prop alignment
- onboarding/testsets/org: updater-widened widget UI atom, tour placement
  vocabulary fix, OnboardingLoader next/dynamic compat, org provider API
  types matched to the backend wire shape (settings/flags dicts)
- EvalRunDetails remainder: WP-4e-2a-vetted atom fixes adapted, recharts v3
  formatter/content signatures, stale import paths repointed

Flagged for triage (typed as-is): AddToTestsetDrawer trace draft discard/
update call missing molecule actions; orphaned SessionDrawerButton
…atterns; oss tsc 105->82

- InfiniteVirtualTable: canonical ExtendedColumnType exported from the barrel
  (three local extended-column copies repointed as aliases); pure read fn for
  columnHiddenKeys (write path reconciles versions); memo generic preservation;
  onRow/getRowProps/rowSelection.fixed aligned with antd 6
- antd v6 PopoverStylesType 'body' drops typed as-is (2 sites, existing pattern)
- React 19: JSX.Element -> ReactElement in RequireWorkflowKind
- AgentaNodeDTO: trace_id/span_id added (backend SpanDTO sends them)
- Org.default_workspace: list endpoint strips it - both lookups are latent
  dead code, typed as-is with comments
- FiltersPreview: operatorLabel is a display string, not the operator union
…windowing export

- DrillInUIContext: EditorProvider/SharedEditor slots typed with the real
  component prop types instead of a hand-written subset (root cause of the
  OSS provider assignment errors)
- InfiniteVirtualTable: rowSelection.fixed accepts antd FixedType; locale
  accepted (not yet forwarded - flagged); Editor barrel exports CodeLanguage
- workflow barrel exports WorkflowRevisionWindowing
Wave-2 parallel pass over the final ~105 OSS + 11 EE-only errors, behavior-
preserving throughout (latent bugs typed as-is with NOTE comments per the
WP-4e-2a convention):

- Evaluators/Evaluations: generic evaluator filtering, chart datum typing
- pages/evaluations: NewEvaluation modal props retyped to entities-package
  shapes (stale legacy Types imports dropped); antd 6 tabPlacement vocabulary
- Testcases/Testsets/Deployments: canonical ExtendedColumnType adoption,
  dataset-store variance via Pick<...,'hooks'>
- DrillInView/EditorViews: TMode narrowing via consts, Format|CodeLanguage
  state union, html format menu typing
- app-shell misc: services/state/pages sweep with backend-verified API types
- EE Billing + misc EE-only files

Latent bugs surfaced and typed as-is (chips filed where actionable):
workspace rename sends invalid org PATCH body; SessionInspector reads
status.code the backend never sends; axios.isCancel dead on created
instance; invite accept can interpolate undefined ids
Both apps are at zero tsc errors; flip ignoreBuildErrors to false so
next build guards the baseline. Verified: full oss and ee builds pass
with the gate on.
@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 23, 2026 1:53pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR enables TypeScript errors to fail OSS and EE builds, excludes test directories from compilation, and updates numerous frontend contracts, state atoms, evaluation views, observability components, shared UI packages, API types, and TypeScript remediation documentation.

Changes

Build enforcement and EE compatibility

Layer / File(s) Summary
Build configuration and EE adapters
web/ee/next.config.ts, web/oss/next.config.ts, web/*/tsconfig.json, web/ee/src/...
TypeScript build errors are no longer ignored, test directories are excluded, and EE components use corrected organization, billing, workspace, and re-export contracts.
Shared UI and editor contracts
web/oss/src/components/EditorViews/..., web/oss/src/components/EnhancedUIs/..., web/packages/agenta-ui/...
Editor languages, button props, drawer styles, table columns, injected editor components, and Ant Design integrations are aligned with shared types.
Evaluation and observability typing
web/oss/src/components/EvalRunDetails/..., web/oss/src/components/pages/observability/...
Evaluation data, metric charts, scenario records, trace rows, and table renderers receive explicit nullable and boundary-compatible types.
State, service, and package contracts
web/oss/src/state/..., web/oss/src/services/..., web/packages/agenta-entities/...
Jotai setters, pagination refresh atoms, URL state, organization providers, tracing data, and workflow exports are updated to reflect runtime shapes.
TypeScript inventory
web/tsc-error-inventory.md
A generated inventory documents baseline errors, remediation waves, quick wins, medium-effort clusters, and the suggested fix order.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 60.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the main change: eliminating web TypeScript errors and making builds fail on regressions.
Description check ✅ Passed The description directly matches the changeset and explains the type-fix sweep, build gate change, and inventory file.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ts-chore/fix-tsc-issues

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ardaerzin
ardaerzin marked this pull request as ready for review July 23, 2026 19:31
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. Frontend refactoring A code change that neither fixes a bug nor adds a feature typescript labels Jul 23, 2026
@ardaerzin
ardaerzin changed the base branch from main to release/v0.106.0 July 23, 2026 19:32

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Note

Due to the large number of review comments, Critical severity comments were prioritized as inline comments.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/oss/src/state/appState/hooks.ts (1)

124-145: 🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win

Avoid redundant navigation when clearing an absent parameter.

When currentValue is undefined, setValue(null) compares unequal and still dispatches patch-query with undefined. Treat null and undefined as equivalent for the no-op check.

🟠 Major comments (21)
web/ee/src/components/pages/settings/Billing/index.tsx-173-174 (1)

173-174: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Protect billing usage rendering when usage is unavailable.

usage! is only a type assertion, so Object.entries(usage!) becomes Object.entries(undefined) at runtime and crashes when the usage request fails. Guard the render and avoid casting undefined into quota props that currently read as unlimited; use an explicit unavailable/error state instead.

Applies to the usage rendering around lines 173-222.

web/oss/src/components/EnhancedUIs/Drawer/index.tsx-20-29 (1)

20-29: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve resolver-form styles when merging width.

When styles is a function, baseStyles becomes undefined, so any caller-provided resolver styles are discarded whenever width is passed. Wrap the resolver and merge wrapper.width into the styles it returns instead of replacing the function.

web/oss/src/components/EvalRunDetails/components/views/ConfigurationView/utils.ts-177-183 (1)

177-183: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve the required attachment discriminator.

PromptPreviewAttachment requires type: "image", but this object omits it and hides the mismatch with as unknown as. Add the discriminator or introduce a separate runtime type if all consumers intentionally use only url/alt.

Proposed fix
                     attachments.push({
+                        type: "image",
                         id: (item.id ?? `${index}`) as string,
                         url: item.url,
                         alt: typeof item.alt === "string" ? item.alt : undefined,
                     } as unknown as PromptPreviewAttachment)
web/oss/src/components/EvalRunDetails/atoms/query.ts-280-282 (1)

280-282: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make batched lookup keys unique per reference.

runId: null is used by queryReferenceLookupAtomFamily, but the serializer at Line 291 still produces the same projectId::none key for every reference in that project. batchFn then overwrites entries in results, so one lookup can receive another reference’s revision. Include a stable descriptor/reference key in the serialized result key.

web/oss/src/components/EvalRunDetails/atoms/types.ts-6-12 (1)

6-12: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Keep the runtime step shape aligned with the type.

scenarioSteps.ts runs each raw step through snakeToCamelCaseKeys before storing it, while this type explicitly permits reads such as trace_id and testcase_id through Record<string, any>. Those properties can type-check yet remain undefined at runtime. Preserve raw fields alongside camel-cased fields, or update consumers and types to use the actual camel-cased shape.

web/oss/src/components/EvalRunDetails/components/EvalTestcaseDrawerAdapter/drawerPayload.ts-2-3 (1)

2-3: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Preserve extra payload fields or narrow the contract.

The new index signature allows arbitrary keys, but buildEvaluationDrawerPayload returns only inputs, outputs, evaluators, and metrics. Any additional field accepted by the new contract is silently dropped. Return the payload with its extra fields preserved, or remove the index signature if extras are not supported.

web/oss/src/components/EvalRunDetails/components/columnVisibility/ColumnVisibilityPopoverContent.tsx-22-22 (1)

22-22: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Treat online evaluations as auto evaluations in the visibility map.

After adding "online", Lines 160-163 route it to the human metric set, while buildPreviewColumns.tsx and usePreviewEvaluations consistently map online evaluations to auto metrics. The visibility menu will therefore expose the wrong static metrics for online runs.

Proposed fix
-            evaluationType === "auto"
+            evaluationType === "auto" || evaluationType === "online"
web/oss/src/components/EvaluationRunsTablePOC/atoms/view.ts-681-685 (1)

681-685: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Read workflow variants from the query payload.

result.data is the query-observer object, so reading workflow_variants directly from it leaves variants empty and prevents the variant filter from showing options. Use the actual nested query payload or its selector instead of casting the observer object.

web/oss/src/components/Playground/Components/PlaygroundFocusDrawerAdapter/drawerPayload.ts-16-17 (1)

16-17: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Preserve extra payload keys in buildPlaygroundDrawerPayload.

The new index signature advertises arbitrary editor values, but the builder returns only inputs, suggestedFields, and outputs; any additional keys are silently lost. Destructure ...rest and spread it into the returned object, or keep the payload closed.

web/oss/src/components/SharedDrawers/AnnotateDrawer/assets/AnnotateDrawerTitle/index.tsx-131-132 (1)

131-132: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Do not cast optional trace IDs to Required here.

AnnotateDrawerIdsType allows either ID to be absent, but generateNewAnnotationPayloadData falls through to transforms.ts lines 503-509 and builds links with possibly undefined trace_id or span_id. Pass the optional shape through and omit links—or reject the save—unless both IDs are present.

web/oss/src/components/Sidebar/components/ListOfProjects.tsx-79-83 (1)

79-83: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Do not cast organizations-list items to recover omitted default_workspace data.

The list response does not provide this details-only field, so the cast cannot restore it at runtime. Projects without organization_id can be silently dropped from organization menus, while deletion cleanup receives null instead of the deleted workspace key. Use a response that includes the workspace ID, fetch organization details before these operations, or handle missing IDs explicitly.

  • web/oss/src/components/Sidebar/components/ListOfProjects.tsx#L79-L83: replace the cast-based lookup with a runtime-provided workspace/organization mapping.
  • web/oss/src/components/Sidebar/components/ListOfOrgs.tsx#L803-L806: resolve the deleted workspace from a real details/current-context source before clearing workspace and project caches.
web/oss/src/pages/workspaces/accept.tsx-97-100 (1)

97-100: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Validate invite IDs before calling the accept endpoint.

workspaceId and projectId are optional here, but acceptWorkspaceInvite requires both strings and interpolates them into the request URL. These assertions only silence TypeScript; incomplete invites can send undefined in the path/query and then be consumed by the error/redirect flow. Reject incomplete invites before setting accept.current/processedTokens, or change the service contract to support missing IDs.

web/oss/src/components/pages/evaluations/NewEvaluation/Components/NewEvaluationModalInner.tsx-220-231 (1)

220-231: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Hydrate evaluator display metadata before building preview payloads.

The comment says these rows always lack slug and name, but the resulting objects are passed as evaluators. usePreviewEvaluations later builds step keys from ev.slug, so preview requests can emit keys such as invocation.undefined and evaluator mappings lose their identity. Resolve the slug/name from the workflow molecule or populate them in the paginated store; widening the type only masks the missing runtime data.

web/oss/src/lib/hooks/usePreviewEvaluations/index.ts-420-427 (1)

420-427: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Hydrate or reject the testset before creating the run.

The cast in Lines 424-426 does not populate testset.data. When a caller supplies a non-revision testset, createScenarios dereferences missing data and throws after the run POST has already succeeded, leaving an orphaned evaluation. Populate the testcase data for every path, or make scenario creation consume the canonical unhydrated testset representation before submitting the run.

Also applies to: 450-472

web/oss/src/components/TestsetsTable/hooks/useTestsetsColumns.tsx-114-115 (1)

114-115: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Copy the canonical row ID instead of _id.

TestsetTableRow uses id, so record._id is normally undefined. The new fallback passes "" to copyToClipboard, which intentionally returns without copying; the Copy ID action is therefore broken for every normal row.

Proposed fix
-                                            copyToClipboard(String(record._id ?? ""))
+                                            copyToClipboard(record.id)
web/oss/src/state/workspace/atoms/mutations.ts-26-27 (1)

26-27: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Send the object payload required by updateOrganization.

The cast only silences TypeScript—the request body is still a bare JSON string, not {name: string}. This can fail the organization PATCH after the workspace update has already succeeded.

Proposed fix
-            // typed as-is (latent bug): sends the bare name string, not {name}, as the PATCH body
-            updateOrganization(organizationId, name as unknown as {name: string}),
+            updateOrganization(organizationId, {name}),
web/oss/src/components/pages/evaluations/onlineEvaluation/assets/helpers.ts-84-85 (1)

84-85: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Validate the wire value instead of asserting FilterValue.

as FilterValue is compile-time only; malformed or null API values can still enter local filter state and reach inferReferenceOptionKey. Parse and reject/normalize the payload with the project’s boundary validator before constructing Filter.

As per coding guidelines, “Keep Zod validation at API boundaries using safeParseWithLogging from @agenta/entities/shared.”

Source: Coding guidelines

web/oss/src/components/pages/observability/components/ObservabilityHeader/index.tsx-362-367 (1)

362-367: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Do not cast away nullable trace rows.

A stale selection can produce {key: undefined, data: null}, violating TestsetTraceData. The cast only suppresses TypeScript and can pass invalid rows to the drawer; filter missing nodes/data before calling setTestsetDrawerData.

web/oss/src/lib/Types.ts-71-80 (1)

71-80: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Align PreviewTestCase with its documented legacy shape.

data is required, but the interface says legacy cases carry inputs instead. A legacy payload without data cannot satisfy this type and may be treated as if data always exists. Use a union or make data optional and normalize data ?? inputs at the boundary.

web/oss/src/components/pages/evaluations/utils.ts-87-93 (1)

87-93: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not discard variant-only invocation metadata.

The early return at Line 113 still ignores rawVariantId. If the payload contains only a variant identifier, parseInvocationMetadata returns null and the new variantId never reaches downstream export resolution.

Proposed fix
-    if (!rawAppId && !rawRevisionId && !rawVariantName) return null
+    if (!rawAppId && !rawRevisionId && !rawVariantId && !rawVariantName) return null
web/oss/src/services/evaluationRuns/api/types.ts-11-14 (1)

11-14: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Do not expose optional data while downstream code assumes it is required.

usePreviewEvaluations.createScenarios dereferences testset.data without checking it. An unhydrated Testset can therefore reach this path and crash at runtime despite compiling through the intersection type. Introduce an explicit hydrated-testset type and validate/normalize the payload before calling createScenarios (or make data required only after hydration).

🟡 Minor comments (5)
web/tsc-error-inventory.md-8-16 (1)

8-16: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Make the inventory snapshot internally consistent.

The document reports final counts of 0, but then calls a 105 OSS + 11 EE-only section “final,” describes Wave 1/2 work as pending, and later presents the 591/525 baselines without clearly labeling them as historical. It also says the report was generated on July 22, 2026 while naming July 24, 2026 as the final wave date, which is still in the future as of July 23, 2026.

Either regenerate the inventory from the final commands with the actual date, or explicitly label the wave plan and baseline sections as historical/pre-fix snapshots.

Also applies to: 18-53, 55-67

web/oss/src/components/EvalRunDetails/atoms/table/scenarios.ts-274-276 (1)

274-276: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep a runtime projectId guard inside queryFn.

enabled controls when the query is enabled for automatic/background fetching, but it is not a runtime invariant for manual refetches. If projectId is null, projectId! forwards null to fetchEvaluationScenarioWindow; handle it inside the query function before making the request.

web/oss/src/components/EvalRunDetails/components/views/OverviewView/components/OverviewPlaceholders.tsx-14-16 (1)

14-16: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Preserve falsy numeric React content.

ReactNode allows 0, but the placeholder render sites use title ? and description ?, so title={0} or description={0} will silently disappear. Use explicit nullish checks instead.

web/packages/agenta-ui/src/InfiniteVirtualTable/features/InfiniteVirtualTableFeatureShell.tsx-142-146 (1)

142-146: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Wire locale.emptyText through or remove the prop.

Callers can now pass this option successfully, but the component explicitly drops it, so custom empty-state text never renders. Forward locale to the inner table or avoid exposing a no-op public prop.

web/oss/src/components/TestsetsTable/components/TestsetsHeaderFilters.tsx-49-58 (1)

49-58: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use an AntD v6-supported Popover style key.

The body style key is legacy and ignored by AntD v6, so maxWidth and the panel styles here won’t apply. Use styles.container or styles.content for the v6 semantic node instead of casting invalid keys.

🧹 Nitpick comments (4)
web/oss/src/components/EvalRunDetails/utils/renderChatMessages.tsx (1)

173-176: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the unreachable "table" checks instead of casting view to string.

After the early return for view === "table", these branches cannot observe "table". Remove the dead conditions, or capture the predicate before the return if a future path requires it. The added explanations also exceed the one-short-line comment guideline.

Also applies to: 233-236

Source: Coding guidelines

web/oss/src/components/References/cells/ApplicationCells.tsx (1)

35-36: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Preserve generic atom-value inference in both default-store wrappers.

The Atom<unknown> parameter and as typeof useAtomValue assertion hide the atom-to-result type relationship. Replace both wrappers with a generic <Value,>(atom: Atom<Value>) => useAtomValue(atom, {store: defaultStore}) implementation and verify it against Jotai 2.16.1.

  • web/oss/src/components/References/cells/ApplicationCells.tsx#L35-L36: replace the casted wrapper with the generic implementation.
  • web/oss/src/components/References/cells/TestsetCells.tsx#L24-L25: apply the same generic wrapper.
web/oss/src/components/SharedDrawers/TraceDrawer/components/TraceContent/components/AnnotationTabItem/index.tsx (1)

193-194: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Model the enriched annotation instead of using any.

mergedAnnWithEvaluator adds evaluator at Line 97, so this is not dead access. However, groupedByReference is typed as AnnotationDto[], forcing the cast here and hiding the actual runtime contract. Introduce an enriched annotation type for the mapped/grouped values and read evaluator through that type.

web/oss/src/components/SharedDrawers/TraceDrawer/components/TraceSidePanel/TraceLinkedSpans/index.tsx (1)

57-58: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Type the live trace field instead of hiding it behind any.

web/oss/src/components/SharedDrawers/TraceDrawer/store/traceDrawerStore.ts attaches trace to merged links at Lines 637-642, so this access is live—not dead. Add the optional field to TraceDrawerSpanLink or expose a shared enriched-link type, then remove the cast and misleading comment.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 516e0352-b734-4bc4-83d4-c84012764526

📥 Commits

Reviewing files that changed from the base of the PR and between b5d4596 and cb415f6.

📒 Files selected for processing (205)
  • web/ee/next.config.ts
  • web/ee/src/components/PostSignupForm/PostSignupHeader.tsx
  • web/ee/src/components/pages/app-management/components/ApiKeyInput.tsx
  • web/ee/src/components/pages/overview/deployments/HistoryConfig.tsx
  • web/ee/src/components/pages/settings/Billing/Modals/PricingModal/assets/SubscriptionPlanDetails/index.tsx
  • web/ee/src/components/pages/settings/Billing/Modals/PricingModal/assets/types.d.ts
  • web/ee/src/components/pages/settings/Billing/index.tsx
  • web/ee/tsconfig.json
  • web/oss/next.config.ts
  • web/oss/src/components/AgentChatSlice/components/clientTools/ElicitationWidget.tsx
  • web/oss/src/components/DeploymentsDashboard/Table/assets/deploymentColumns.tsx
  • web/oss/src/components/DeploymentsDashboard/assets/UseApiContent.tsx
  • web/oss/src/components/DeploymentsDashboard/modals/DeploymentConfirmationModalWrapper.tsx
  • web/oss/src/components/DrillInView/TraceSpanDrillInView.tsx
  • web/oss/src/components/DrillInView/viewModes.ts
  • web/oss/src/components/EditorViews/SimpleSharedEditor/index.tsx
  • web/oss/src/components/EditorViews/SimpleSharedEditor/types.ts
  • web/oss/src/components/EditorViews/assets/helper.ts
  • web/oss/src/components/EnhancedUIs/Drawer/index.tsx
  • web/oss/src/components/EntityIdentity/useRenameApp.ts
  • web/oss/src/components/EvalRunDetails/Table.tsx
  • web/oss/src/components/EvalRunDetails/atoms/metricProcessor.ts
  • web/oss/src/components/EvalRunDetails/atoms/metrics.ts
  • web/oss/src/components/EvalRunDetails/atoms/query.ts
  • web/oss/src/components/EvalRunDetails/atoms/runMetrics.ts
  • web/oss/src/components/EvalRunDetails/atoms/runMetrics/types.ts
  • web/oss/src/components/EvalRunDetails/atoms/scenarioColumnValues.ts
  • web/oss/src/components/EvalRunDetails/atoms/scenarioSteps.ts
  • web/oss/src/components/EvalRunDetails/atoms/table/columnAccess.ts
  • web/oss/src/components/EvalRunDetails/atoms/table/columns.ts
  • web/oss/src/components/EvalRunDetails/atoms/table/run.ts
  • web/oss/src/components/EvalRunDetails/atoms/table/scenarios.ts
  • web/oss/src/components/EvalRunDetails/atoms/table/testcases.ts
  • web/oss/src/components/EvalRunDetails/atoms/table/types.ts
  • web/oss/src/components/EvalRunDetails/atoms/tableRows.ts
  • web/oss/src/components/EvalRunDetails/atoms/traces.ts
  • web/oss/src/components/EvalRunDetails/atoms/types.ts
  • web/oss/src/components/EvalRunDetails/atoms/variantConfig.ts
  • web/oss/src/components/EvalRunDetails/components/CompareRunsMenu.tsx
  • web/oss/src/components/EvalRunDetails/components/EvalTestcaseDrawerAdapter/drawerPayload.ts
  • web/oss/src/components/EvalRunDetails/components/EvaluatorMetricsChart/BarChart.tsx
  • web/oss/src/components/EvalRunDetails/components/EvaluatorMetricsChart/index.tsx
  • web/oss/src/components/EvalRunDetails/components/FocusDrawer.tsx
  • web/oss/src/components/EvalRunDetails/components/TableCells/MetricCell.tsx
  • web/oss/src/components/EvalRunDetails/components/columnVisibility/ColumnVisibilityPopoverContent.tsx
  • web/oss/src/components/EvalRunDetails/components/views/ConfigurationView/components/ContextChipList.tsx
  • web/oss/src/components/EvalRunDetails/components/views/ConfigurationView/components/EvaluatorSection.tsx
  • web/oss/src/components/EvalRunDetails/components/views/ConfigurationView/components/InvocationSection.tsx
  • web/oss/src/components/EvalRunDetails/components/views/ConfigurationView/utils.ts
  • web/oss/src/components/EvalRunDetails/components/views/OverviewView/components/BaseRunMetricsSection.tsx
  • web/oss/src/components/EvalRunDetails/components/views/OverviewView/components/EvaluatorTemporalMetricsChart.tsx
  • web/oss/src/components/EvalRunDetails/components/views/OverviewView/components/MetadataSummaryTable.tsx
  • web/oss/src/components/EvalRunDetails/components/views/OverviewView/components/MetricComparisonCard.tsx
  • web/oss/src/components/EvalRunDetails/components/views/OverviewView/components/OverviewPlaceholders.tsx
  • web/oss/src/components/EvalRunDetails/components/views/OverviewView/hooks/useRunMetricData.ts
  • web/oss/src/components/EvalRunDetails/components/views/OverviewView/utils/evaluatorMetrics.ts
  • web/oss/src/components/EvalRunDetails/components/views/SingleScenarioViewerPOC/ScenarioAnnotationPanel/useAnnotationState.ts
  • web/oss/src/components/EvalRunDetails/components/views/SingleScenarioViewerPOC/types.ts
  • web/oss/src/components/EvalRunDetails/hooks/usePreviewTableData.ts
  • web/oss/src/components/EvalRunDetails/utils/buildPreviewColumns.tsx
  • web/oss/src/components/EvalRunDetails/utils/buildSkeletonColumns.ts
  • web/oss/src/components/EvalRunDetails/utils/renderChatMessages.tsx
  • web/oss/src/components/EvaluationRunsTablePOC/atoms/view.ts
  • web/oss/src/components/EvaluationRunsTablePOC/components/EvaluationRunsDeleteButton.tsx
  • web/oss/src/components/EvaluationRunsTablePOC/components/EvaluationRunsTable/export/referenceResolvers.ts
  • web/oss/src/components/EvaluationRunsTablePOC/components/EvaluationRunsTable/index.tsx
  • web/oss/src/components/EvaluationRunsTablePOC/components/cells/RunMetricCell/index.tsx
  • web/oss/src/components/EvaluationRunsTablePOC/components/filters/EvaluationRunsHeaderFilters.tsx
  • web/oss/src/components/EvaluationRunsTablePOC/types.ts
  • web/oss/src/components/Evaluations/MetricDetailsPopover/assets/ResponsiveMetricChart.tsx
  • web/oss/src/components/Evaluations/components/MetricDetailsPreviewPopover.tsx
  • web/oss/src/components/Evaluators/Drawers/HumanEvaluatorDrawer/index.tsx
  • web/oss/src/components/Evaluators/assets/evaluatorFiltering.ts
  • web/oss/src/components/Filters/Filters.tsx
  • web/oss/src/components/InfiniteVirtualTable/atoms/columnHiddenKeys.ts
  • web/oss/src/components/InfiniteVirtualTable/columns/cells.tsx
  • web/oss/src/components/InfiniteVirtualTable/columns/createStandardColumns.tsx
  • web/oss/src/components/InfiniteVirtualTable/columns/types.ts
  • web/oss/src/components/InfiniteVirtualTable/components/InfiniteVirtualTableInner.tsx
  • web/oss/src/components/InfiniteVirtualTable/hooks/useColumnVisibility.ts
  • web/oss/src/components/InfiniteVirtualTable/hooks/useExpandableRows.tsx
  • web/oss/src/components/InfiniteVirtualTable/hooks/useTableKeyboardShortcuts.ts
  • web/oss/src/components/InfiniteVirtualTable/types.ts
  • web/oss/src/components/Layout/assets/Breadcrumbs.tsx
  • web/oss/src/components/Onboarding/tours/evaluationResultsTour.ts
  • web/oss/src/components/Playground/Components/Menus/SelectVariant/index.tsx
  • web/oss/src/components/Playground/Components/Modals/CreateVariantModal/assets/types.d.ts
  • web/oss/src/components/Playground/Components/Modals/CreateVariantModal/index.tsx
  • web/oss/src/components/Playground/Components/Modals/DeployVariantModal/types.d.ts
  • web/oss/src/components/Playground/Components/PlaygroundFocusDrawerAdapter/drawerPayload.ts
  • web/oss/src/components/Playground/Components/PlaygroundVariantConfig/index.tsx
  • web/oss/src/components/Playground/Components/TestsetDropdown/TestsetPreviewPanelWrapper.tsx
  • web/oss/src/components/Playground/Components/TestsetDropdown/index.tsx
  • web/oss/src/components/Playground/Components/WebWorkerProvider/index.tsx
  • web/oss/src/components/Playground/Playground.tsx
  • web/oss/src/components/PlaygroundRouter/PlaygroundLoadingShell.tsx
  • web/oss/src/components/References/cells/ApplicationCells.tsx
  • web/oss/src/components/References/cells/TestsetCells.tsx
  • web/oss/src/components/RequireWorkflowKind/index.tsx
  • web/oss/src/components/SessionInspector/tabs/StreamsTab.tsx
  • web/oss/src/components/SharedDrawers/AddToTestsetDrawer/atoms/drawerState.ts
  • web/oss/src/components/SharedDrawers/AddToTestsetDrawer/components/DataPreviewEditor.tsx
  • web/oss/src/components/SharedDrawers/AddToTestsetDrawer/hooks/useTestsetDrawer.ts
  • web/oss/src/components/SharedDrawers/AnnotateDrawer/assets/AnnotateDrawerTitle/index.tsx
  • web/oss/src/components/SharedDrawers/AnnotateDrawer/assets/SelectEvaluators/index.tsx
  • web/oss/src/components/SharedDrawers/AnnotateDrawer/assets/hooks/useEvaluatorSchemas.ts
  • web/oss/src/components/SharedDrawers/AnnotateDrawer/assets/transforms.ts
  • web/oss/src/components/SharedDrawers/AnnotateDrawer/assets/types.d.ts
  • web/oss/src/components/SharedDrawers/SessionDrawer/components/SessionDrawerButton/index.tsx
  • web/oss/src/components/SharedDrawers/SessionDrawer/store/sessionDrawerStore.ts
  • web/oss/src/components/SharedDrawers/TraceDrawer/components/AccordionTreePanel.tsx
  • web/oss/src/components/SharedDrawers/TraceDrawer/components/TraceContent/components/AnnotationTabItem/index.tsx
  • web/oss/src/components/SharedDrawers/TraceDrawer/components/TraceContent/components/OverviewTabItem/index.tsx
  • web/oss/src/components/SharedDrawers/TraceDrawer/components/TraceContent/components/TraceTypeHeader/index.tsx
  • web/oss/src/components/SharedDrawers/TraceDrawer/components/TraceHeader/index.tsx
  • web/oss/src/components/SharedDrawers/TraceDrawer/components/TraceSidePanel/TraceLinkedSpans/index.tsx
  • web/oss/src/components/SharedDrawers/TraceDrawer/components/TraceSidePanel/TraceReferences/index.tsx
  • web/oss/src/components/SharedDrawers/TraceDrawer/components/TraceTree/index.tsx
  • web/oss/src/components/SharedDrawers/TraceDrawer/index.tsx
  • web/oss/src/components/SharedDrawers/TraceDrawer/store/openInPlayground.ts
  • web/oss/src/components/SharedDrawers/TraceDrawer/store/traceDrawerStore.ts
  • web/oss/src/components/Sidebar/components/ListOfOrgs.tsx
  • web/oss/src/components/Sidebar/components/ListOfProjects.tsx
  • web/oss/src/components/TestcasesTableNew/components/CommitTestsetModal.tsx
  • web/oss/src/components/TestcasesTableNew/components/TestcaseRowActionsDropdown.tsx
  • web/oss/src/components/TestcasesTableNew/components/TestcasesTableShell.tsx
  • web/oss/src/components/TestcasesTableNew/hooks/useTestcasesTable.ts
  • web/oss/src/components/TestsetsTable/components/TestsetsHeaderFilters.tsx
  • web/oss/src/components/TestsetsTable/hooks/useTestsetsColumns.tsx
  • web/oss/src/components/VariantsComponents/store/registryStore.ts
  • web/oss/src/components/Webhooks/WebhookLogsTab.tsx
  • web/oss/src/components/Webhooks/utils/buildPreviewRequest.ts
  • web/oss/src/components/Webhooks/utils/buildSubscription.ts
  • web/oss/src/components/pages/agent-home/PlaygroundOnboarding/OnboardingLoader.tsx
  • web/oss/src/components/pages/app-management/modals/CreateAppStatusModal.tsx
  • web/oss/src/components/pages/app-management/modals/CustomWorkflowModal/hooks/types.d.ts
  • web/oss/src/components/pages/evaluations/NewEvaluation/Components/NewEvaluationModalContent.tsx
  • web/oss/src/components/pages/evaluations/NewEvaluation/Components/NewEvaluationModalInner.tsx
  • web/oss/src/components/pages/evaluations/NewEvaluation/Components/SelectEvaluatorSection/SelectEvaluatorSection.tsx
  • web/oss/src/components/pages/evaluations/NewEvaluation/types.ts
  • web/oss/src/components/pages/evaluations/cellRenderers/cellRenderers.tsx
  • web/oss/src/components/pages/evaluations/onlineEvaluation/assets/helpers.ts
  • web/oss/src/components/pages/evaluations/onlineEvaluation/components/FiltersPreview.tsx
  • web/oss/src/components/pages/evaluations/utils.ts
  • web/oss/src/components/pages/observability/assets/getObservabilityColumns.tsx
  • web/oss/src/components/pages/observability/components/NodeNameCell.tsx
  • web/oss/src/components/pages/observability/components/ObservabilityHeader/index.tsx
  • web/oss/src/components/pages/observability/components/ObservabilityTable/index.tsx
  • web/oss/src/components/pages/observability/components/SessionsTable/assets/getSessionColumns.tsx
  • web/oss/src/components/pages/observability/components/SessionsTable/index.tsx
  • web/oss/src/components/pages/observability/components/TimestampCell.tsx
  • web/oss/src/components/pages/observability/dashboard/CustomAreaChart.tsx
  • web/oss/src/components/pages/overview/variants/VariantPopover.tsx
  • web/oss/src/components/pages/settings/Organization/index.tsx
  • web/oss/src/hooks/usePostAuthRedirect.ts
  • web/oss/src/lib/Types.ts
  • web/oss/src/lib/api/assets/fetchClient.ts
  • web/oss/src/lib/evaluations/legacy.ts
  • web/oss/src/lib/helpers/analytics/AgPosthogProvider.tsx
  • web/oss/src/lib/helpers/dateTimeHelper/index.ts
  • web/oss/src/lib/hooks/useEvaluationRunMetrics/index.ts
  • web/oss/src/lib/hooks/useEvaluationRunMetrics/types.ts
  • web/oss/src/lib/hooks/usePreviewEvaluations/index.ts
  • web/oss/src/lib/hooks/usePreviewEvaluations/types.ts
  • web/oss/src/lib/onboarding/widget/store.ts
  • web/oss/src/lib/traces/traceUtils.ts
  • web/oss/src/pages/auth/[[...path]].tsx
  • web/oss/src/pages/w/[workspace_id]/p/[project_id]/apps/[app_id]/overview/index.tsx
  • web/oss/src/pages/workspaces/accept.tsx
  • web/oss/src/services/evaluationRuns/api/index.ts
  • web/oss/src/services/evaluationRuns/api/types.ts
  • web/oss/src/services/evaluations/api/index.ts
  • web/oss/src/services/observability/types/index.ts
  • web/oss/src/services/organization/api/index.ts
  • web/oss/src/services/runMetrics/api/index.ts
  • web/oss/src/services/tracing/types/index.ts
  • web/oss/src/services/workspace/index.ts
  • web/oss/src/state/app/selectors/app.ts
  • web/oss/src/state/appCreation/status.ts
  • web/oss/src/state/appState/hooks.ts
  • web/oss/src/state/entities/shared/createPaginatedEntityStore.ts
  • web/oss/src/state/newObservability/atoms/controls.ts
  • web/oss/src/state/newObservability/atoms/queries.ts
  • web/oss/src/state/newObservability/atoms/queryHelpers.ts
  • web/oss/src/state/newObservability/helpers/index.ts
  • web/oss/src/state/newObservability/selectors/tracing.ts
  • web/oss/src/state/newPlayground/workflowEntityBridge.ts
  • web/oss/src/state/org/index.ts
  • web/oss/src/state/project/index.ts
  • web/oss/src/state/project/selectors/project.ts
  • web/oss/src/state/url/auth.ts
  • web/oss/src/state/url/focusDrawer.ts
  • web/oss/src/state/url/index.ts
  • web/oss/src/state/url/playground.ts
  • web/oss/src/state/workspace/atoms/mutations.ts
  • web/oss/tsconfig.json
  • web/packages/agenta-entities/src/shared/paginated/createPaginatedEntityStore.ts
  • web/packages/agenta-entities/src/workflow/index.ts
  • web/packages/agenta-entity-ui/src/variant/components/EnvironmentStatus.tsx
  • web/packages/agenta-ui/src/Editor/index.ts
  • web/packages/agenta-ui/src/InfiniteVirtualTable/columns/createStandardColumns.tsx
  • web/packages/agenta-ui/src/InfiniteVirtualTable/features/InfiniteVirtualTableFeatureShell.tsx
  • web/packages/agenta-ui/src/InfiniteVirtualTable/types.ts
  • web/packages/agenta-ui/src/drill-in/context/DrillInUIContext.tsx
  • web/tsc-error-inventory.md

Comment on lines +261 to +265
// Discard any draft for the removed span.
// NOTE (latent runtime bug, typed as-is): traceSpanMolecule.actions only exposes
// prefetchByIds/evictByIds — discard/update live under reducers. These set() calls
// receive undefined and would throw if reached; kept as-is pending triage.
set((traceSpanMolecule as any).actions.discard, traceKey)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🔴 Critical | 🏗️ Heavy lift

Restore the real molecule write actions before merging.

traceSpanMolecule.actions does not expose discard/update; these casts therefore pass undefined to set. Remove, edit, and revert flows will throw, and removal mutates traceSpanIdsAtom before failing. Bind the reducer-backed actions through the molecule’s actual public API instead of bypassing the type system.

Also applies to: 509-509, 518-518, 572-572

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

Labels

Frontend refactoring A code change that neither fixes a bug nor adds a feature size:L This PR changes 100-499 lines, ignoring generated files. typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant