Skip to content

fix: honor file input defaults across app execution (lts/1.13.x) - #45666

Merged
wylswz merged 2 commits into
lts/1.13.xfrom
backport/file-input-defaults-lts-1.13.x
Nov 10, 2026
Merged

wylswz merged 2 commits into
lts/1.13.xfrom
backport/file-input-defaults-lts-1.13.x

Conversation

@zhangx1n

@zhangx1n zhangx1n commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Backports #44780 (430d9aff) to lts/1.13.x with cherry-pick -x. Fixes Linear ENG-1427: a Start node file input with a configured default works in Studio, but the published WebApp shows an empty field and produces no output. Companion to #45665 (lts/1.17.x).

  • Run Once, Workflow debug, and published Chat/Chatflow now display and submit configured file / file-list defaults.
  • The backend fills omitted file inputs with the configured default before the required check, and converts saved editor file objects to API mappings. Explicit values win.
  • An optional single file that the user clears submits '', and a cleared list submits [], so a clear no longer silently restores the default.

Differences from upstream on this branch:

  • No access grant. lts/1.13.x has no core.app.file_access scope, and factories.file_factory resolves uploads by tenant only, so default files are already reachable. This PR ports apply_file_input_defaults and omits grant_file_default_access, its generator calls, the related generator tests, and the .importlinter entries. If the access-scope work is ever backported here, the grant must come with it.
  • Kept the uploader isActive guards and the chat reset from the partial backport fix(web): reset attachment inputs when starting a new conversation #45550 instead of applying them again.
  • app-parameters-select.ts and share.spec.ts don't exist on LTS. fetchAppParams already passes default through unchanged.
  • Widening default broke config-var/config-modal, where the text, number and select editors pass default to Input. A scalarDefault narrowing fixes that.
  • Ported the upstream regression tests to the LTS test layout. Backend tests use a tenant-scoped fake for the file lookup. Web tests use local fixtures.

Validation

  • uv run --project api pytest on core/app/apps/, services/app/ and test_app_generate_service.py: 437 passed. With the production changes reverted, 13 of the new backend tests fail.
  • vp test on the chat, file-uploader, text-generation, workflow inputs panel and model-config suites: 1772 passed. With the production changes reverted, the new Run Once and chat tests fail.
  • ruff format --check, ruff check, and lint-imports (10 contracts kept): passed.
  • tsc --noEmit and tsgo --noEmit: 0 errors. eslint on the touched files: 0 errors.
  • check-hotfix-cherry-picks.sh: verified the cherry-pick provenance from main.

@zhangx1n
zhangx1n requested a review from a team November 5, 2026 10:48
@github-actions github-actions Bot added web This relates to changes on the web. size:XL This PR changes 500-999 lines, ignoring generated files. labels Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-11-10 06:23:02.011440887 +0000
+++ /tmp/pyrefly_pr.txt	2026-11-10 06:22:55.859414288 +0000
@@ -2869,7 +2869,9 @@
 ERROR No matching overload found for function `core.app.apps.advanced_chat.app_generator.AdvancedChatAppGenerator.generate` called with arguments: (app_model=SimpleNamespace, workflow=SimpleNamespace, user=SimpleNamespace, args=dict[str, dict[@_, @_] | str], invoke_from=Literal[InvokeFrom.SERVICE_API], workflow_run_id=Literal['workflow-run-id'], streaming=Literal[False]) [no-matching-overload]
    --> tests/unit_tests/core/app/apps/test_advanced_chat_app_generator.py:165:49
 ERROR Object of class `Account` has no attribute `tenant_id` [missing-attribute]
-   --> tests/unit_tests/core/app/apps/test_base_app_generator.py:488:9
+   --> tests/unit_tests/core/app/apps/test_base_app_generator.py:494:9
+ERROR `list[str]` is not assignable to attribute `allowed_file_types` with type `Sequence[FileType] | None` [bad-assignment]
+   --> tests/unit_tests/core/app/apps/test_base_app_generator.py:622:35
 ERROR Argument `SimpleNamespace` is not assignable to parameter `model_config` with type `ModelConfigWithCredentialsEntity` in function `core.app.apps.base_app_runner.AppRunner.recalc_llm_max_tokens` [bad-argument-type]
   --> tests/unit_tests/core/app/apps/test_base_app_runner.py:64:38
 ERROR Argument `SimpleNamespace` is not assignable to parameter `model_config` with type `ModelConfigWithCredentialsEntity` in function `core.app.apps.base_app_runner.AppRunner.recalc_llm_max_tokens` [bad-argument-type]

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 39.06% 39.08% +0.02%
Strict coverage 38.45% 38.48% +0.02%
Typed symbols 19,929 19,955 +26
Untyped symbols 31,583 31,594 +11
Modules 2866 2869 +3

@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.52381% with 13 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (lts/1.13.x@634b4a4). Learn more about missing BASE report.

Files with missing lines Patch % Lines
api/services/app/file_input_defaults.py 33.33% 10 Missing ⚠️
...pp/configuration/config-var/config-modal/index.tsx 50.00% 2 Missing ⚠️
api/core/app/apps/base_app_generator.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             lts/1.13.x   #45666   +/-   ##
=============================================
  Coverage              ?   66.42%           
=============================================
  Files                 ?     4681           
  Lines                 ?   186431           
  Branches              ?    36437           
=============================================
  Hits                  ?   123829           
  Misses                ?    60426           
  Partials              ?     2176           
Flag Coverage Δ
api 53.52% <35.29%> (?)
web 83.94% <97.01%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zhangx1n
zhangx1n requested a review from xhdnoah November 6, 2026 02:30
@wylswz
wylswz merged commit 53f1ba8 into lts/1.13.x Nov 10, 2026
15 of 17 checks passed
@wylswz
wylswz deleted the backport/file-input-defaults-lts-1.13.x branch November 10, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants