Conversation
jonathanlab
approved these changes
Sep 30, 2025
Contributor
jonathanlab
left a comment
There was a problem hiding this comment.
LGTM, I usually use https://github.com/openapi-ts/openapi-typescript instead of https://github.com/astahmer/typed-openapi but I figure there's not too much of a difference 👍🏻
10 tasks
VojtechBartos
added a commit
that referenced
this pull request
Apr 29, 2026
Cloud follow-up messages typed during sandbox setup, sandbox death, or restore could be silently lost: the dispatcher's old retry-loop drained the queue up-front, held the prompt in a local var, and on retry exhaustion surfaced a generic toast without re-enqueuing. Multiple auto-flush triggers also raced with the agent's initial `prompt()` call, producing `stopReason: cancelled` on otherwise-good user messages. - Dispatcher refactored to peek-and-confirm: drain → send → re-prepend on failure. Per-taskId re-entrance guard (`dispatchingCloudQueues`) prevents two concurrent triggers from double-dispatching. - `_posthog/run_started` flips `session.status` to `"connected"` (the explicit agent-ready handshake from #1). - `_posthog/turn_complete` is the only queue-drain trigger now — it's the safe boundary, fires when the agent has actually finished a turn. - `sendCloudPrompt` queues if `status !== "connected"` — covers the initial-boot window and sandbox restart/restore window with one signal instead of the previous optimistic-pending heuristic. - Removed the cloudStatus="in_progress" and post-log `!isPromptPending` auto-flushes; both raced with `sendInitialTaskMessage`. - `dequeueMessages` now reads the frozen committed state before entering the immer draft. Drained items used to be revoked proxies that crashed `combineQueuedCloudPrompts` once the setState callback exited — the silent root cause of "queue clears, message lost". - `prependQueuedMessages` setter rolls the queue back when a dispatch fails so the next trigger retries. Generated-By: PostHog Code Task-Id: 8228d7eb-50f0-4148-bbc3-d47617e982f7
7 tasks
VojtechBartos
added a commit
that referenced
this pull request
Apr 29, 2026
Cloud follow-up messages typed during sandbox setup, sandbox death, or restore could be silently lost: the dispatcher's old retry-loop drained the queue up-front, held the prompt in a local var, and on retry exhaustion surfaced a generic toast without re-enqueuing. Multiple auto-flush triggers also raced with the agent's initial `prompt()` call, producing `stopReason: cancelled` on otherwise-good user messages. - Dispatcher refactored to peek-and-confirm: drain → send → re-prepend on failure. Per-taskId re-entrance guard (`dispatchingCloudQueues`) prevents two concurrent triggers from double-dispatching. - `_posthog/run_started` flips `session.status` to `"connected"` (the explicit agent-ready handshake from #1). - `_posthog/turn_complete` is the only queue-drain trigger now — it's the safe boundary, fires when the agent has actually finished a turn. - `sendCloudPrompt` queues if `status !== "connected"` — covers the initial-boot window and sandbox restart/restore window with one signal instead of the previous optimistic-pending heuristic. - Removed the cloudStatus="in_progress" and post-log `!isPromptPending` auto-flushes; both raced with `sendInitialTaskMessage`. - `dequeueMessages` now reads the frozen committed state before entering the immer draft. Drained items used to be revoked proxies that crashed `combineQueuedCloudPrompts` once the setState callback exited — the silent root cause of "queue clears, message lost". - `prependQueuedMessages` setter rolls the queue back when a dispatch fails so the next trigger retries. Generated-By: PostHog Code Task-Id: 8228d7eb-50f0-4148-bbc3-d47617e982f7
VojtechBartos
added a commit
that referenced
this pull request
May 4, 2026
Cloud follow-up messages typed during sandbox setup, sandbox death, or restore could be silently lost: the dispatcher's old retry-loop drained the queue up-front, held the prompt in a local var, and on retry exhaustion surfaced a generic toast without re-enqueuing. Multiple auto-flush triggers also raced with the agent's initial `prompt()` call, producing `stopReason: cancelled` on otherwise-good user messages. - Dispatcher refactored to peek-and-confirm: drain → send → re-prepend on failure. Per-taskId re-entrance guard (`dispatchingCloudQueues`) prevents two concurrent triggers from double-dispatching. - `_posthog/run_started` flips `session.status` to `"connected"` (the explicit agent-ready handshake from #1). - `_posthog/turn_complete` is the only queue-drain trigger now — it's the safe boundary, fires when the agent has actually finished a turn. - `sendCloudPrompt` queues if `status !== "connected"` — covers the initial-boot window and sandbox restart/restore window with one signal instead of the previous optimistic-pending heuristic. - Removed the cloudStatus="in_progress" and post-log `!isPromptPending` auto-flushes; both raced with `sendInitialTaskMessage`. - `dequeueMessages` now reads the frozen committed state before entering the immer draft. Drained items used to be revoked proxies that crashed `combineQueuedCloudPrompts` once the setState callback exited — the silent root cause of "queue clears, message lost". - `prependQueuedMessages` setter rolls the queue back when a dispatch fails so the next trigger retries. Generated-By: PostHog Code Task-Id: 8228d7eb-50f0-4148-bbc3-d47617e982f7
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.
Adds a generated api client based off of the OpenAPI schema.
Not added it to CI for now since the tasks schema isn't merged into production yet.