Skip to content

refactor(core): rename cloud task service as engine - #3624

Merged
trunk-io[bot] merged 11 commits into
mainfrom
posthog-code/share-cloud-task-engine
Jul 29, 2026
Merged

refactor(core): rename cloud task service as engine#3624
trunk-io[bot] merged 11 commits into
mainfrom
posthog-code/share-cloud-task-engine

Conversation

@richardsolomou

@richardsolomou richardsolomou commented Jul 21, 2026

Copy link
Copy Markdown
Member

Problem

The cloud-task implementation needs to become a reusable engine, but keeping cloud-task.ts as a wrapper in the same diff prevents GitHub from showing the implementation move.

Depends on #3623
Refs PostHog/posthog#76229

Changes

Phase 1 only: I renamed cloud-task.ts to cloud-task-engine.ts byte-for-byte and updated imports. GitHub shows this as a 100% rename; the engine refactor and wrapper are deferred to the next PR.

How did you test this?

  • Full monorepo typecheck at this checkpoint
  • Final stack: 711 shared, 153 API-client, 2,599 core, and 451 mobile tests

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit d4c7d62.

@richardsolomou richardsolomou changed the title refactor(cloud): share portable task engine refactor(cloud): share task engine and session orchestration Jul 21, 2026
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-policies branch from c05b44e to dc82fa7 Compare July 21, 2026 13:38
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-engine branch from 2dafbcd to 1b48f46 Compare July 21, 2026 13:46
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-policies branch from 9e39cdd to 7936c58 Compare July 23, 2026 12:47
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-engine branch from 32895be to 54e687e Compare July 23, 2026 12:55
@richardsolomou richardsolomou changed the title refactor(cloud): share task engine and session orchestration refactor(mobile): reuse the cloud task engine Jul 23, 2026
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-policies branch from 7936c58 to ac8c23a Compare July 23, 2026 13:35
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-engine branch from 54e687e to 25563d8 Compare July 23, 2026 13:35
@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
packages/core/src/cloud-task/cloud-task-engine.ts:2165
**Archived fetch can hang hydration**

When a terminal run has no persisted session-log rows and its archive request stalls, this unbounded fetch never emits a snapshot or retryable error, leaving the mobile task session loading indefinitely.

### Issue 2 of 2
packages/core/src/cloud-task/cloud-task-engine.ts:2169-2170
**Malformed line discards entire archive**

When an archived NDJSON log contains one malformed line, parsing the complete array throws and returns `null`, causing hydration to reject every otherwise valid entry; the previous mobile parser skipped malformed lines and retained the remaining task history.

Reviews (1): Last reviewed commit: "fix(core): restore archived cloud task l..." | Re-trigger Greptile

Comment thread packages/core/src/cloud-task/cloud-task-engine.ts Outdated
Comment thread packages/core/src/cloud-task/cloud-task-engine.ts Outdated
Comment thread packages/core/src/cloud-task/cloud-task-engine.ts Outdated
@veria-ai

veria-ai Bot commented Jul 23, 2026

Copy link
Copy Markdown

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 1 · PR risk: 0/10

@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-policies branch from 1155a8c to afb4875 Compare July 23, 2026 17:28
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-engine branch from bdfa389 to 5e38056 Compare July 23, 2026 17:28
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-policies branch from afb4875 to 7428c49 Compare July 24, 2026 16:41
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-engine branch from 5e38056 to f703289 Compare July 24, 2026 16:41
@richardsolomou richardsolomou changed the title refactor(mobile): reuse the cloud task engine refactor(core): rename cloud task service as engine Jul 24, 2026
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-policies branch from 7428c49 to 1573cb1 Compare July 24, 2026 16:47
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-engine branch from f703289 to 5bbe73f Compare July 24, 2026 16:47
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-policies branch from 1573cb1 to dcbc4b1 Compare July 24, 2026 22:26
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-engine branch 2 times, most recently from ae97a33 to 059b248 Compare July 24, 2026 22:57
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-policies branch from dcbc4b1 to 3a25e72 Compare July 24, 2026 22:57
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-engine branch from 059b248 to ee6ce05 Compare July 24, 2026 23:07
Generated-By: PostHog Code
Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code
Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code
Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code
Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Keep the extracted domain declaration as the single source after rebasing onto current main.

Generated-By: PostHog Code
Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-engine branch from ee6ce05 to df1e4cc Compare July 28, 2026 09:06
Generated-By: PostHog Code
Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-policies branch from 0fec9d1 to 7195e61 Compare July 28, 2026 09:28
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-engine branch from df1e4cc to 6b33a73 Compare July 28, 2026 09:28
Preserve the shared model-policy extraction while incorporating current main's Modal model support.

Generated-By: PostHog Code
Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code
Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code
Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code
Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-policies branch from 7195e61 to 01aec6d Compare July 29, 2026 07:58
@richardsolomou
richardsolomou force-pushed the posthog-code/share-cloud-task-engine branch from 6b33a73 to 53e5383 Compare July 29, 2026 07:58
Base automatically changed from posthog-code/share-cloud-task-policies to main July 29, 2026 09:43
@trunk-io

trunk-io Bot commented Jul 29, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

Generated-By: PostHog Code
Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
@trunk-io
trunk-io Bot merged commit 3d18b42 into main Jul 29, 2026
34 checks passed
@trunk-io
trunk-io Bot deleted the posthog-code/share-cloud-task-engine branch July 29, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants