Skip to content

fix(cloud-task): relay questions over the durable event stream and park unanswerable ones#3199

Merged
tatoalo merged 1 commit into
mainfrom
posthog-code/fix-cloud-question-relay
Jul 7, 2026
Merged

fix(cloud-task): relay questions over the durable event stream and park unanswerable ones#3199
tatoalo merged 1 commit into
mainfrom
posthog-code/fix-cloud-question-relay

Conversation

@tatoalo

@tatoalo tatoalo commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Problem

AskUserQuestion prompts in cloud runs stopped surfacing to the user; the agent's question fails and the model then picks an answer on its own. Closes #3082.

ph_code_ask_user_question.mp4

Root cause: question (and permission) relays in createCloudClient.requestPermission are gated on session.hasDesktopConnected, which is only ever set by an inbound SSE connection to the sandbox's GET /events.

@trunk-io

trunk-io Bot commented Jul 6, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 0d1d10d.

@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(cloud-task): relay questions over th..." | Re-trigger Greptile

Comment thread packages/agent/src/server/agent-server.ts Outdated
Comment thread packages/agent/src/server/agent-server.ts Outdated
Comment thread packages/agent/src/server/question-relay.test.ts Outdated
With durable event ingest enabled, cloud task views receive permission_request frames through the durable stream instead of the sandbox SSE relay. Treat an active event stream sender as a reachable client for AskUserQuestion and permission requests.

When a question still cannot be relayed, return a cancelled outcome that tells the model to restate the question and wait for the user instead of selecting an answer automatically. Cancelled outcomes carrying a message now reach the model as a denial so the parked-question instruction is delivered.

Generated-By: PostHog Code
@tatoalo tatoalo force-pushed the posthog-code/fix-cloud-question-relay branch from 97cbb2e to 0d1d10d Compare July 7, 2026 11:22
@tatoalo tatoalo added the Stamphog This will request an autostamp by stamphog on small changes label Jul 7, 2026
@tatoalo tatoalo marked this pull request as ready for review July 7, 2026 11:26
@tatoalo tatoalo requested a review from a team July 7, 2026 11:26

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gates denied this PR: it matches the auth deny-list (modifies permission-handling logic) and is classified as T2-never, both of which require human review before auto-approval.

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 7, 2026
@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Reviews (2): Last reviewed commit: "fix(cloud-task): relay questions over du..." | Re-trigger Greptile

@tatoalo tatoalo merged commit ff4a733 into main Jul 7, 2026
31 checks passed
@tatoalo tatoalo deleted the posthog-code/fix-cloud-question-relay branch July 7, 2026 11:52
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.

permission requests not showing to user

2 participants