Repository navigation
Conversation
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-11-01 09:56:30.397717370 +0000
+++ /tmp/pyrefly_pr.txt 2026-11-01 09:56:10.205515687 +0000
@@ -3708,6 +3708,8 @@
--> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1529:25
ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `RuntimeState | None` in function `core.app.apps.workflow.app_generator.WorkflowAppGenerator._generate_worker` [bad-argument-type]
--> tests/unit_tests/core/app/apps/workflow/test_app_generator.py:1533:37
+ERROR Missing argument `user_from` in function `core.app.entities.app_invoke_entities.WorkflowAppGenerateEntity.__init__` [missing-argument]
+ --> tests/unit_tests/core/app/apps/workflow/test_app_runner.py:23:52
ERROR Cannot index into `str` [bad-index]
--> tests/unit_tests/core/app/apps/workflow/test_generate_response_converter.py:75:16
ERROR Cannot index into `str` [bad-index]
|
Contributor
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (68.66%) is below the adjusted base coverage (88.85%). You can increase the head coverage or adjust the Removed Code Behavior.
Additional details and impacted files@@ Coverage Diff @@
## main #45235 +/- ##
===========================================
- Coverage 89.85% 68.66% -21.19%
===========================================
Files 6249 6093 -156
Lines 398125 369547 -28578
Branches 80223 78263 -1960
===========================================
- Hits 357739 253758 -103981
- Misses 34076 112977 +78901
+ Partials 6310 2812 -3498
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Eapp1e
force-pushed
the
fix/app-runner-sys-timestamp
branch
2 times, most recently
from
November 1, 2026 09:54
273053c to
3413b07
Compare
… workflow app runner `WorkflowAppRunner.prepare()` builds the START node system variables with `timestamp=int(naive_utc_now().timestamp())`. That value is a naive UTC wall clock, and `datetime.timestamp()` interprets naive values in the process-local timezone, so every workflow run started from the app runner reports an epoch that is shifted by the host's UTC offset (`sys.timestamp` is 8 hours behind on a `TZ=Asia/Shanghai` host). `_setup_variable_pool()` in `services/workflow_service.py` had the same call and was fixed the same way, so this brings the second START node bootstrap path in line with the `to_utc_timestamp()` contract in `libs/datetime_utils.py`. Signed-off-by: Eapp1e <163811520+Eapp1e@users.noreply.github.com>
Eapp1e
force-pushed
the
fix/app-runner-sys-timestamp
branch
from
November 1, 2026 10:02
3413b07 to
0dd4b6d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WorkflowAppRunner.prepare()seeds the START node system variables withtimestamp=int(naive_utc_now().timestamp()).naive_utc_now()returns a naive UTC wall clock, anddatetime.timestamp()reads naive values as process-local time, sosys.timestampis offset by the host's UTC offset — 8 hours behind on aTZ=Asia/Shanghaideployment.sys.timestampis handed to workflow authors as a Unix epoch, so a shifted value silently breaks any duration/expiry arithmetic built on it.This is the second START-node bootstrap path.
_setup_variable_pool()inapi/services/workflow_service.pycarried the same call and was corrected the same way in #44847, which left the app-runner path behind. The fix reuses the contract that already exists inapi/libs/datetime_utils.py:Nothing else changes: the value keeps the same type and the same field name, and UTC hosts see no difference.
Fixes #44987 (same class of naive-UTC epoch conversion; this is the app-runner call site that issue's sweep of
api/fields,api/controllersandapi/tasksdid not cover).Screenshots
Not applicable — backend value only.
Test plan
api/tests/unit_tests/core/app/apps/workflow/test_app_runner.py(new file, mirroring the production path perapi/README.md#testing):WorkflowAppRunnerand runsprepare()with the START-node collaborators patched, capturing the kwargs handed tobuild_system_variables.naive_utc_nowto a known instant and runs the host clock atTZ=Asia/Shanghai(time.tzset()), then asserts the capturedtimestampequals the epoch of that instant.time.tzset(Windows); CI runs Linux, so the assertion is exercised there.Before/after on this machine (host clock at UTC+8,
TZset toXXX-8,naive_utc_nowpinned to2024-05-01T00:00:00Z):ruff checkandruff format --checkare clean on both files withapi/.ruff.toml(line-length 120).Checklist
make lint && make type-check(backend) andvp staged(frontend) to appease the lint godsFrom Claude Code