[chore] Zero out web tsc errors and fail builds on type regressions#5464
[chore] Zero out web tsc errors and fail builds on type regressions#5464ardaerzin wants to merge 13 commits into
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis 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. ChangesBuild enforcement and EE compatibility
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 winAvoid redundant navigation when clearing an absent parameter.
When
currentValueisundefined,setValue(null)compares unequal and still dispatchespatch-querywithundefined. Treatnullandundefinedas 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 winProtect billing usage rendering when usage is unavailable.
usage!is only a type assertion, soObject.entries(usage!)becomesObject.entries(undefined)at runtime and crashes when the usage request fails. Guard the render and avoid castingundefinedinto 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 winPreserve resolver-form
styleswhen merging width.When
stylesis a function,baseStylesbecomesundefined, so any caller-provided resolver styles are discarded wheneverwidthis passed. Wrap the resolver and mergewrapper.widthinto 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 winPreserve the required attachment discriminator.
PromptPreviewAttachmentrequirestype: "image", but this object omits it and hides the mismatch withas unknown as. Add the discriminator or introduce a separate runtime type if all consumers intentionally use onlyurl/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 winMake batched lookup keys unique per reference.
runId: nullis used byqueryReferenceLookupAtomFamily, but the serializer at Line 291 still produces the sameprojectId::nonekey for every reference in that project.batchFnthen overwrites entries inresults, 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 liftKeep the runtime step shape aligned with the type.
scenarioSteps.tsruns each raw step throughsnakeToCamelCaseKeysbefore storing it, while this type explicitly permits reads such astrace_idandtestcase_idthroughRecord<string, any>. Those properties can type-check yet remainundefinedat 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 winPreserve extra payload fields or narrow the contract.
The new index signature allows arbitrary keys, but
buildEvaluationDrawerPayloadreturns onlyinputs,outputs,evaluators, andmetrics. 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 winTreat online evaluations as auto evaluations in the visibility map.
After adding
"online", Lines 160-163 route it to the human metric set, whilebuildPreviewColumns.tsxandusePreviewEvaluationsconsistently 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 winRead workflow variants from the query payload.
result.datais the query-observer object, so readingworkflow_variantsdirectly from it leavesvariantsempty 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 winPreserve extra payload keys in
buildPlaygroundDrawerPayload.The new index signature advertises arbitrary editor values, but the builder returns only
inputs,suggestedFields, andoutputs; any additional keys are silently lost. Destructure...restand 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 winDo not cast optional trace IDs to
Requiredhere.
AnnotateDrawerIdsTypeallows either ID to be absent, butgenerateNewAnnotationPayloadDatafalls through totransforms.tslines 503-509 and builds links with possibly undefinedtrace_idorspan_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 liftDo not cast organizations-list items to recover omitted
default_workspacedata.The list response does not provide this details-only field, so the cast cannot restore it at runtime. Projects without
organization_idcan be silently dropped from organization menus, while deletion cleanup receivesnullinstead 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 winValidate invite IDs before calling the accept endpoint.
workspaceIdandprojectIdare optional here, butacceptWorkspaceInviterequires both strings and interpolates them into the request URL. These assertions only silence TypeScript; incomplete invites can sendundefinedin the path/query and then be consumed by the error/redirect flow. Reject incomplete invites before settingaccept.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 liftHydrate evaluator display metadata before building preview payloads.
The comment says these rows always lack
slugandname, but the resulting objects are passed as evaluators.usePreviewEvaluationslater builds step keys fromev.slug, so preview requests can emit keys such asinvocation.undefinedand 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 liftHydrate 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,createScenariosdereferences 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 winCopy the canonical row ID instead of
_id.
TestsetTableRowusesid, sorecord._idis normally undefined. The new fallback passes""tocopyToClipboard, 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 winSend 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 winValidate the wire value instead of asserting
FilterValue.
as FilterValueis compile-time only; malformed or null API values can still enter local filter state and reachinferReferenceOptionKey. Parse and reject/normalize the payload with the project’s boundary validator before constructingFilter.As per coding guidelines, “Keep Zod validation at API boundaries using
safeParseWithLoggingfrom@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 winDo not cast away nullable trace rows.
A stale selection can produce
{key: undefined, data: null}, violatingTestsetTraceData. The cast only suppresses TypeScript and can pass invalid rows to the drawer; filter missing nodes/data before callingsetTestsetDrawerData.web/oss/src/lib/Types.ts-71-80 (1)
71-80: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftAlign
PreviewTestCasewith its documented legacy shape.
datais required, but the interface says legacy cases carryinputsinstead. A legacy payload withoutdatacannot satisfy this type and may be treated as ifdataalways exists. Use a union or makedataoptional and normalizedata ?? inputsat the boundary.web/oss/src/components/pages/evaluations/utils.ts-87-93 (1)
87-93: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winDo not discard variant-only invocation metadata.
The early return at Line 113 still ignores
rawVariantId. If the payload contains only a variant identifier,parseInvocationMetadatareturnsnulland the newvariantIdnever reaches downstream export resolution.Proposed fix
- if (!rawAppId && !rawRevisionId && !rawVariantName) return null + if (!rawAppId && !rawRevisionId && !rawVariantId && !rawVariantName) return nullweb/oss/src/services/evaluationRuns/api/types.ts-11-14 (1)
11-14: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winDo not expose optional
datawhile downstream code assumes it is required.
usePreviewEvaluations.createScenariosdereferencestestset.datawithout checking it. An unhydratedTestsetcan 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 callingcreateScenarios(or makedatarequired only after hydration).
🟡 Minor comments (5)
web/tsc-error-inventory.md-8-16 (1)
8-16: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winMake the inventory snapshot internally consistent.
The document reports final counts of
0, but then calls a105 OSS + 11 EE-onlysection “final,” describes Wave 1/2 work as pending, and later presents the591/525baselines 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 winKeep a runtime
projectIdguard insidequeryFn.
enabledcontrols when the query is enabled for automatic/background fetching, but it is not a runtime invariant for manual refetches. IfprojectIdis null,projectId!forwards null tofetchEvaluationScenarioWindow; 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 winPreserve falsy numeric React content.
ReactNodeallows0, but the placeholder render sites usetitle ?anddescription ?, sotitle={0}ordescription={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 winWire
locale.emptyTextthrough 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
localeto 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 winUse an AntD v6-supported Popover style key.
The
bodystyle key is legacy and ignored by AntD v6, somaxWidthand the panel styles here won’t apply. Usestyles.containerorstyles.contentfor 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 winRemove the unreachable
"table"checks instead of castingviewtostring.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 winPreserve generic atom-value inference in both default-store wrappers.
The
Atom<unknown>parameter andas typeof useAtomValueassertion 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 winModel the enriched annotation instead of using
any.
mergedAnnWithEvaluatoraddsevaluatorat Line 97, so this is not dead access. However,groupedByReferenceis typed asAnnotationDto[], forcing the cast here and hiding the actual runtime contract. Introduce an enriched annotation type for the mapped/grouped values and readevaluatorthrough that type.web/oss/src/components/SharedDrawers/TraceDrawer/components/TraceSidePanel/TraceLinkedSpans/index.tsx (1)
57-58: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winType the live
tracefield instead of hiding it behindany.
web/oss/src/components/SharedDrawers/TraceDrawer/store/traceDrawerStore.tsattachestraceto merged links at Lines 637-642, so this access is live—not dead. Add the optional field toTraceDrawerSpanLinkor 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
📒 Files selected for processing (205)
web/ee/next.config.tsweb/ee/src/components/PostSignupForm/PostSignupHeader.tsxweb/ee/src/components/pages/app-management/components/ApiKeyInput.tsxweb/ee/src/components/pages/overview/deployments/HistoryConfig.tsxweb/ee/src/components/pages/settings/Billing/Modals/PricingModal/assets/SubscriptionPlanDetails/index.tsxweb/ee/src/components/pages/settings/Billing/Modals/PricingModal/assets/types.d.tsweb/ee/src/components/pages/settings/Billing/index.tsxweb/ee/tsconfig.jsonweb/oss/next.config.tsweb/oss/src/components/AgentChatSlice/components/clientTools/ElicitationWidget.tsxweb/oss/src/components/DeploymentsDashboard/Table/assets/deploymentColumns.tsxweb/oss/src/components/DeploymentsDashboard/assets/UseApiContent.tsxweb/oss/src/components/DeploymentsDashboard/modals/DeploymentConfirmationModalWrapper.tsxweb/oss/src/components/DrillInView/TraceSpanDrillInView.tsxweb/oss/src/components/DrillInView/viewModes.tsweb/oss/src/components/EditorViews/SimpleSharedEditor/index.tsxweb/oss/src/components/EditorViews/SimpleSharedEditor/types.tsweb/oss/src/components/EditorViews/assets/helper.tsweb/oss/src/components/EnhancedUIs/Drawer/index.tsxweb/oss/src/components/EntityIdentity/useRenameApp.tsweb/oss/src/components/EvalRunDetails/Table.tsxweb/oss/src/components/EvalRunDetails/atoms/metricProcessor.tsweb/oss/src/components/EvalRunDetails/atoms/metrics.tsweb/oss/src/components/EvalRunDetails/atoms/query.tsweb/oss/src/components/EvalRunDetails/atoms/runMetrics.tsweb/oss/src/components/EvalRunDetails/atoms/runMetrics/types.tsweb/oss/src/components/EvalRunDetails/atoms/scenarioColumnValues.tsweb/oss/src/components/EvalRunDetails/atoms/scenarioSteps.tsweb/oss/src/components/EvalRunDetails/atoms/table/columnAccess.tsweb/oss/src/components/EvalRunDetails/atoms/table/columns.tsweb/oss/src/components/EvalRunDetails/atoms/table/run.tsweb/oss/src/components/EvalRunDetails/atoms/table/scenarios.tsweb/oss/src/components/EvalRunDetails/atoms/table/testcases.tsweb/oss/src/components/EvalRunDetails/atoms/table/types.tsweb/oss/src/components/EvalRunDetails/atoms/tableRows.tsweb/oss/src/components/EvalRunDetails/atoms/traces.tsweb/oss/src/components/EvalRunDetails/atoms/types.tsweb/oss/src/components/EvalRunDetails/atoms/variantConfig.tsweb/oss/src/components/EvalRunDetails/components/CompareRunsMenu.tsxweb/oss/src/components/EvalRunDetails/components/EvalTestcaseDrawerAdapter/drawerPayload.tsweb/oss/src/components/EvalRunDetails/components/EvaluatorMetricsChart/BarChart.tsxweb/oss/src/components/EvalRunDetails/components/EvaluatorMetricsChart/index.tsxweb/oss/src/components/EvalRunDetails/components/FocusDrawer.tsxweb/oss/src/components/EvalRunDetails/components/TableCells/MetricCell.tsxweb/oss/src/components/EvalRunDetails/components/columnVisibility/ColumnVisibilityPopoverContent.tsxweb/oss/src/components/EvalRunDetails/components/views/ConfigurationView/components/ContextChipList.tsxweb/oss/src/components/EvalRunDetails/components/views/ConfigurationView/components/EvaluatorSection.tsxweb/oss/src/components/EvalRunDetails/components/views/ConfigurationView/components/InvocationSection.tsxweb/oss/src/components/EvalRunDetails/components/views/ConfigurationView/utils.tsweb/oss/src/components/EvalRunDetails/components/views/OverviewView/components/BaseRunMetricsSection.tsxweb/oss/src/components/EvalRunDetails/components/views/OverviewView/components/EvaluatorTemporalMetricsChart.tsxweb/oss/src/components/EvalRunDetails/components/views/OverviewView/components/MetadataSummaryTable.tsxweb/oss/src/components/EvalRunDetails/components/views/OverviewView/components/MetricComparisonCard.tsxweb/oss/src/components/EvalRunDetails/components/views/OverviewView/components/OverviewPlaceholders.tsxweb/oss/src/components/EvalRunDetails/components/views/OverviewView/hooks/useRunMetricData.tsweb/oss/src/components/EvalRunDetails/components/views/OverviewView/utils/evaluatorMetrics.tsweb/oss/src/components/EvalRunDetails/components/views/SingleScenarioViewerPOC/ScenarioAnnotationPanel/useAnnotationState.tsweb/oss/src/components/EvalRunDetails/components/views/SingleScenarioViewerPOC/types.tsweb/oss/src/components/EvalRunDetails/hooks/usePreviewTableData.tsweb/oss/src/components/EvalRunDetails/utils/buildPreviewColumns.tsxweb/oss/src/components/EvalRunDetails/utils/buildSkeletonColumns.tsweb/oss/src/components/EvalRunDetails/utils/renderChatMessages.tsxweb/oss/src/components/EvaluationRunsTablePOC/atoms/view.tsweb/oss/src/components/EvaluationRunsTablePOC/components/EvaluationRunsDeleteButton.tsxweb/oss/src/components/EvaluationRunsTablePOC/components/EvaluationRunsTable/export/referenceResolvers.tsweb/oss/src/components/EvaluationRunsTablePOC/components/EvaluationRunsTable/index.tsxweb/oss/src/components/EvaluationRunsTablePOC/components/cells/RunMetricCell/index.tsxweb/oss/src/components/EvaluationRunsTablePOC/components/filters/EvaluationRunsHeaderFilters.tsxweb/oss/src/components/EvaluationRunsTablePOC/types.tsweb/oss/src/components/Evaluations/MetricDetailsPopover/assets/ResponsiveMetricChart.tsxweb/oss/src/components/Evaluations/components/MetricDetailsPreviewPopover.tsxweb/oss/src/components/Evaluators/Drawers/HumanEvaluatorDrawer/index.tsxweb/oss/src/components/Evaluators/assets/evaluatorFiltering.tsweb/oss/src/components/Filters/Filters.tsxweb/oss/src/components/InfiniteVirtualTable/atoms/columnHiddenKeys.tsweb/oss/src/components/InfiniteVirtualTable/columns/cells.tsxweb/oss/src/components/InfiniteVirtualTable/columns/createStandardColumns.tsxweb/oss/src/components/InfiniteVirtualTable/columns/types.tsweb/oss/src/components/InfiniteVirtualTable/components/InfiniteVirtualTableInner.tsxweb/oss/src/components/InfiniteVirtualTable/hooks/useColumnVisibility.tsweb/oss/src/components/InfiniteVirtualTable/hooks/useExpandableRows.tsxweb/oss/src/components/InfiniteVirtualTable/hooks/useTableKeyboardShortcuts.tsweb/oss/src/components/InfiniteVirtualTable/types.tsweb/oss/src/components/Layout/assets/Breadcrumbs.tsxweb/oss/src/components/Onboarding/tours/evaluationResultsTour.tsweb/oss/src/components/Playground/Components/Menus/SelectVariant/index.tsxweb/oss/src/components/Playground/Components/Modals/CreateVariantModal/assets/types.d.tsweb/oss/src/components/Playground/Components/Modals/CreateVariantModal/index.tsxweb/oss/src/components/Playground/Components/Modals/DeployVariantModal/types.d.tsweb/oss/src/components/Playground/Components/PlaygroundFocusDrawerAdapter/drawerPayload.tsweb/oss/src/components/Playground/Components/PlaygroundVariantConfig/index.tsxweb/oss/src/components/Playground/Components/TestsetDropdown/TestsetPreviewPanelWrapper.tsxweb/oss/src/components/Playground/Components/TestsetDropdown/index.tsxweb/oss/src/components/Playground/Components/WebWorkerProvider/index.tsxweb/oss/src/components/Playground/Playground.tsxweb/oss/src/components/PlaygroundRouter/PlaygroundLoadingShell.tsxweb/oss/src/components/References/cells/ApplicationCells.tsxweb/oss/src/components/References/cells/TestsetCells.tsxweb/oss/src/components/RequireWorkflowKind/index.tsxweb/oss/src/components/SessionInspector/tabs/StreamsTab.tsxweb/oss/src/components/SharedDrawers/AddToTestsetDrawer/atoms/drawerState.tsweb/oss/src/components/SharedDrawers/AddToTestsetDrawer/components/DataPreviewEditor.tsxweb/oss/src/components/SharedDrawers/AddToTestsetDrawer/hooks/useTestsetDrawer.tsweb/oss/src/components/SharedDrawers/AnnotateDrawer/assets/AnnotateDrawerTitle/index.tsxweb/oss/src/components/SharedDrawers/AnnotateDrawer/assets/SelectEvaluators/index.tsxweb/oss/src/components/SharedDrawers/AnnotateDrawer/assets/hooks/useEvaluatorSchemas.tsweb/oss/src/components/SharedDrawers/AnnotateDrawer/assets/transforms.tsweb/oss/src/components/SharedDrawers/AnnotateDrawer/assets/types.d.tsweb/oss/src/components/SharedDrawers/SessionDrawer/components/SessionDrawerButton/index.tsxweb/oss/src/components/SharedDrawers/SessionDrawer/store/sessionDrawerStore.tsweb/oss/src/components/SharedDrawers/TraceDrawer/components/AccordionTreePanel.tsxweb/oss/src/components/SharedDrawers/TraceDrawer/components/TraceContent/components/AnnotationTabItem/index.tsxweb/oss/src/components/SharedDrawers/TraceDrawer/components/TraceContent/components/OverviewTabItem/index.tsxweb/oss/src/components/SharedDrawers/TraceDrawer/components/TraceContent/components/TraceTypeHeader/index.tsxweb/oss/src/components/SharedDrawers/TraceDrawer/components/TraceHeader/index.tsxweb/oss/src/components/SharedDrawers/TraceDrawer/components/TraceSidePanel/TraceLinkedSpans/index.tsxweb/oss/src/components/SharedDrawers/TraceDrawer/components/TraceSidePanel/TraceReferences/index.tsxweb/oss/src/components/SharedDrawers/TraceDrawer/components/TraceTree/index.tsxweb/oss/src/components/SharedDrawers/TraceDrawer/index.tsxweb/oss/src/components/SharedDrawers/TraceDrawer/store/openInPlayground.tsweb/oss/src/components/SharedDrawers/TraceDrawer/store/traceDrawerStore.tsweb/oss/src/components/Sidebar/components/ListOfOrgs.tsxweb/oss/src/components/Sidebar/components/ListOfProjects.tsxweb/oss/src/components/TestcasesTableNew/components/CommitTestsetModal.tsxweb/oss/src/components/TestcasesTableNew/components/TestcaseRowActionsDropdown.tsxweb/oss/src/components/TestcasesTableNew/components/TestcasesTableShell.tsxweb/oss/src/components/TestcasesTableNew/hooks/useTestcasesTable.tsweb/oss/src/components/TestsetsTable/components/TestsetsHeaderFilters.tsxweb/oss/src/components/TestsetsTable/hooks/useTestsetsColumns.tsxweb/oss/src/components/VariantsComponents/store/registryStore.tsweb/oss/src/components/Webhooks/WebhookLogsTab.tsxweb/oss/src/components/Webhooks/utils/buildPreviewRequest.tsweb/oss/src/components/Webhooks/utils/buildSubscription.tsweb/oss/src/components/pages/agent-home/PlaygroundOnboarding/OnboardingLoader.tsxweb/oss/src/components/pages/app-management/modals/CreateAppStatusModal.tsxweb/oss/src/components/pages/app-management/modals/CustomWorkflowModal/hooks/types.d.tsweb/oss/src/components/pages/evaluations/NewEvaluation/Components/NewEvaluationModalContent.tsxweb/oss/src/components/pages/evaluations/NewEvaluation/Components/NewEvaluationModalInner.tsxweb/oss/src/components/pages/evaluations/NewEvaluation/Components/SelectEvaluatorSection/SelectEvaluatorSection.tsxweb/oss/src/components/pages/evaluations/NewEvaluation/types.tsweb/oss/src/components/pages/evaluations/cellRenderers/cellRenderers.tsxweb/oss/src/components/pages/evaluations/onlineEvaluation/assets/helpers.tsweb/oss/src/components/pages/evaluations/onlineEvaluation/components/FiltersPreview.tsxweb/oss/src/components/pages/evaluations/utils.tsweb/oss/src/components/pages/observability/assets/getObservabilityColumns.tsxweb/oss/src/components/pages/observability/components/NodeNameCell.tsxweb/oss/src/components/pages/observability/components/ObservabilityHeader/index.tsxweb/oss/src/components/pages/observability/components/ObservabilityTable/index.tsxweb/oss/src/components/pages/observability/components/SessionsTable/assets/getSessionColumns.tsxweb/oss/src/components/pages/observability/components/SessionsTable/index.tsxweb/oss/src/components/pages/observability/components/TimestampCell.tsxweb/oss/src/components/pages/observability/dashboard/CustomAreaChart.tsxweb/oss/src/components/pages/overview/variants/VariantPopover.tsxweb/oss/src/components/pages/settings/Organization/index.tsxweb/oss/src/hooks/usePostAuthRedirect.tsweb/oss/src/lib/Types.tsweb/oss/src/lib/api/assets/fetchClient.tsweb/oss/src/lib/evaluations/legacy.tsweb/oss/src/lib/helpers/analytics/AgPosthogProvider.tsxweb/oss/src/lib/helpers/dateTimeHelper/index.tsweb/oss/src/lib/hooks/useEvaluationRunMetrics/index.tsweb/oss/src/lib/hooks/useEvaluationRunMetrics/types.tsweb/oss/src/lib/hooks/usePreviewEvaluations/index.tsweb/oss/src/lib/hooks/usePreviewEvaluations/types.tsweb/oss/src/lib/onboarding/widget/store.tsweb/oss/src/lib/traces/traceUtils.tsweb/oss/src/pages/auth/[[...path]].tsxweb/oss/src/pages/w/[workspace_id]/p/[project_id]/apps/[app_id]/overview/index.tsxweb/oss/src/pages/workspaces/accept.tsxweb/oss/src/services/evaluationRuns/api/index.tsweb/oss/src/services/evaluationRuns/api/types.tsweb/oss/src/services/evaluations/api/index.tsweb/oss/src/services/observability/types/index.tsweb/oss/src/services/organization/api/index.tsweb/oss/src/services/runMetrics/api/index.tsweb/oss/src/services/tracing/types/index.tsweb/oss/src/services/workspace/index.tsweb/oss/src/state/app/selectors/app.tsweb/oss/src/state/appCreation/status.tsweb/oss/src/state/appState/hooks.tsweb/oss/src/state/entities/shared/createPaginatedEntityStore.tsweb/oss/src/state/newObservability/atoms/controls.tsweb/oss/src/state/newObservability/atoms/queries.tsweb/oss/src/state/newObservability/atoms/queryHelpers.tsweb/oss/src/state/newObservability/helpers/index.tsweb/oss/src/state/newObservability/selectors/tracing.tsweb/oss/src/state/newPlayground/workflowEntityBridge.tsweb/oss/src/state/org/index.tsweb/oss/src/state/project/index.tsweb/oss/src/state/project/selectors/project.tsweb/oss/src/state/url/auth.tsweb/oss/src/state/url/focusDrawer.tsweb/oss/src/state/url/index.tsweb/oss/src/state/url/playground.tsweb/oss/src/state/workspace/atoms/mutations.tsweb/oss/tsconfig.jsonweb/packages/agenta-entities/src/shared/paginated/createPaginatedEntityStore.tsweb/packages/agenta-entities/src/workflow/index.tsweb/packages/agenta-entity-ui/src/variant/components/EnvironmentStatus.tsxweb/packages/agenta-ui/src/Editor/index.tsweb/packages/agenta-ui/src/InfiniteVirtualTable/columns/createStandardColumns.tsxweb/packages/agenta-ui/src/InfiniteVirtualTable/features/InfiniteVirtualTableFeatureShell.tsxweb/packages/agenta-ui/src/InfiniteVirtualTable/types.tsweb/packages/agenta-ui/src/drill-in/context/DrillInUIContext.tsxweb/tsc-error-inventory.md
| // 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) |
There was a problem hiding this comment.
🩺 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
Context
The web apps carried 591 (OSS) and 525 (EE) TypeScript errors, and
next.config.tssettypescript.ignoreBuildErrors: truein 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
ignoreBuildErrorsto false, sonext buildnow 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 aNOTE (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:
tests/from both app tsconfigs. The playwright suites belong to thetestsworkspace (which owns@playwright/test); the manual scripts imported state modules that no longer exist.Parameter,CorrectAnswer,_EvaluationScenario,PreviewTestCasefromlib/Types.tswhile consumers remained; several imports pointed at moved or renamed symbols.useRunMetricDatatyped a field as the atom while storing the unwrapped value; webhook builders destructured a discriminated union before narrowing;filtersAtomdid not accept updater functions its callers passed.oss/src/services/tracingeach declare a structurally equivalentTraceSpanNode(zod literal unions vs TS enums, null vs undefined). Every crossing now has a documented boundary cast; no data is converted.ExtendedColumnTypeexported from the barrel for the custom column props (columnVisibilityLabel,defaultHidden,maxWidth, ...) that three consumers had each redeclared locally.AgentaNodeDTO.trace_id/span_idexist on the wire;Org.default_workspacedoes not, so those reads are flagged latent instead).ignoreBuildErrors: falsein 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:
updateWorkspaceNameAtomsends a bare string as the org PATCH body; the backend requires an object, so the org half of a workspace rename 422s.AddToTestsetDrawercallstraceSpanMolecule.actions.discard/update, which do not exist on the molecule (the write atoms live underreducers), so removing or editing a trace draft throws.SessionDrawerButtonis an unadapted copy ofTraceDrawerButtonwith no consumers.InfiniteVirtualTableFeatureShellacceptslocalebut never forwards it, so custom empty-state text never renders.ReferenceErrorsites 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 (
ModalFooternever renders children), so Cancel/OK were no-ops. The realonCancel/onConfirmprops are now wired.Tests / notes
pnpm --filter @agenta/oss exec tsc --noEmitandpnpm --filter @agenta/ee exec tsc --noEmit: 0 errors each.next buildfor both apps passes with the type gate active.web/tsc-error-inventory.mdrecords the full progression and methodology.What to QA