Repository navigation
FE-3142 fix(agent): type the unknown value in the free-use placement test - #19840
dante01yoon wants to merge 1 commit into
Conversation
🎨 Storybook: ✅ Built — View Storybook🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 2bbba14425d6959a2f5c0180bb9833705041662b
Full docs: ADR-DEVEX-LINT-0015 🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measureExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight This candidate changes nothing the matrix measures, so every expensive stage was skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe unknown-placement test now assigns its unchanged configuration through a ChangesTest configuration assignment
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to This test-only typing change preserves the existing fixture and assertions, with no concrete merge-blocking risk identified. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 6 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (6 passed)
Full details: End-To-End Regression Coverage For FixesExplanation The PR title and commit subject contain the bug-fix signal “fix”. The PR changes
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #19840 +/- ##
==========================================
+ Coverage 84.74% 85.49% +0.74%
==========================================
Files 3412 2397 -1015
Lines 163766 137028 -26738
Branches 44655 36989 -7666
==========================================
- Hits 138790 117147 -21643
+ Misses 23029 19515 -3514
+ Partials 1947 366 -1581
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
christian-byrne
left a comment
There was a problem hiding this comment.
The test now models the unvalidated wire payload without weakening the generated production contract. The fallback assertions remain unchanged, the two-line diff is thread-free, and current-head CI is settled green.
|
Closing as superseded. While this sat in the merge queue, |
Summary
Type the unknown-value row of the free-use placement test as the untyped wire payload it models, so
maintypechecks again. Test-only change, two lines.Why
mainfailspnpm typechecksince #19712 merged (2026-10-02 00:02 UTC), so every PR's CI, which builds the PR merged withmain, fails the typecheck and everything that builds behind it:lint-pr / typecheck, the Tests E2E gates, Dist Telemetry Scan, OSS Assets Validation, Size Data and perf-tests all stop at the same single diagnostic:src/workbench/extensions/agent/experiments/freeUsePlacement.test.ts(44,7): error TS2322: Type 'string | undefined' is not assignable to type '"above-input" | "control" | "inside-input" | "near-composer" | "top-banner" | undefined'.Root cause
RemoteConfigisPartial<GetFeaturesResponses[200]> & {...}, and the generated ingest type (#19526) declares'agent-free-use-message-placement'as a closed five-value union. #19712 also added'agent-free-use-message-placement'?: stringinsrc/platform/remoteConfig/types.ts, but intersectingstringwith the union leaves the union, so that line has no effect.The union is only a compile-time claim: at runtime
commitRemoteConfigSuccessassigns a rawRecord<string, unknown>intoremoteConfig.valuewithout validating it, andisFreeUseVarianttakesstring | undefined, so the hook's fallback tocontrolfor a value it does not know is correct. The test was wrong to type its payload asRemoteConfig: the'unknown'row feeds a value the server could send but the generated type rules out.How
The row builds the payload as the untyped record it is on the wire (
Record<string, unknown>) and assigns that toremoteConfig.value, the same way production does. Both rows (undefinedand'unknown'), their names and their assertions are unchanged. No cast, noany, no suppression.Rejected: widening the production type with
Omit<..., key> & { key?: string }(the omit-and-redeclare patterndocs/guidance/typescript.mdforbids, and it would drop the generated contract for the values the server does send), a double assertion ('unknown' as unknown as ..., banned), andJSON.parse(returnsany).Review Focus
isFreeUseVariantalways return true turns both red.'agent-free-use-message-placement'?: stringline insrc/platform/remoteConfig/types.ts(a stale leftover, can be removed separately) and a similar unnecessary double cast insrc/composables/auth/useTurnstile.test.ts:59.cloud/1.55has no such key in its generated/featurestype (it is a plainstringthere), so the backport [backport cloud/1.55] feat(agent): run the free-use messaging placement experiment (#19712) #19830 already typechecks with the original test and cherry-picking this fix there is harmless. No backport label on purpose.srcfound no other plainstring | undefinedassigned to a literal-union key of the generated/featuresresponse.AS IS / TO BE
AS IS:
TO BE:
The evidence is the
pnpm typecheckoutput on the currentmaintip and on this branch, and the test run.