Skip to content

fix(tasks): acknowledge cloud task messages asynchronously - #72907

Closed
tatoalo wants to merge 1 commit into
masterfrom
posthog-code/async-cloud-task-message-delivery
Closed

tatoalo wants to merge 1 commit into
masterfrom
posthog-code/async-cloud-task-message-delivery

Conversation

@tatoalo

@tatoalo tatoalo commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Problem

Cloud task startup currently waits for the agent's full first turn before confirming message delivery. A long turn can exceed the sandbox tunnel timeout, causing a healthy run to be marked failed and its sandbox to be removed.

Changes

Request the asynchronous message acknowledgement introduced by PostHog/code#3711. The task workflow can clear the pending message after acceptance while turn progress and completion continue through the existing event stream.

Note

Deploy the linked agent change before this PR. Older agents ignore the opt-in field and retain the current synchronous behavior.

How did you test this code?

  • Extended the existing delivery test to verify the workflow opts into asynchronous acknowledgement. This guards against reintroducing full-turn blocking during startup.
  • Ran Ruff lint and format checks on all changed files.
  • The database-backed test suite could not start locally because this environment has no Docker or reachable Postgres service. Pytest collection and non-database cases completed before the database setup failures.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Automatic notifications

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

Docs update

No user-facing documentation change. This corrects internal message-delivery behavior.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Codex investigated task lifecycle telemetry and session logs, then implemented the smallest protocol change that separates message acceptance from turn completion. I used the /querying-posthog-data, /writing-tests, and /setup-web-tests skills. A blanket 504-as-success approach was rejected because a tunnel timeout does not prove the sandbox received the message.


Created with PostHog Code

Generated-By: PostHog Code
Task-Id: 7e2afcdb-b4f2-4a41-80a3-7e0d53b4abc3
@tatoalo tatoalo self-assigned this Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hey @tatoalo! 👋

It looks like your git author email on this PR isn't your @posthog.com address (apogliaghi@gmail.com). Since you're on the PostHog team, it's worth pointing your local git author email at your @posthog.com address. Why it matters:

  • Consistent work identity in git history — internal tooling that attributes commits to team members keys off your @posthog.com address.
  • Keeps team contributions easy to tell apart from external community ones when scanning history.

You can fix it for this repo with:

git config user.email "you@posthog.com"

Or set it globally with git config --global user.email "you@posthog.com". No need to redo this PR — just a nudge for next time. 🙂

tatoalo commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

not needed

@tatoalo tatoalo closed this Jul 22, 2026
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.

1 participant