Skip to content

feat: generated api client for tasks#1

Merged
joshsny merged 1 commit intomainfrom
generated-api
Sep 30, 2025
Merged

feat: generated api client for tasks#1
joshsny merged 1 commit intomainfrom
generated-api

Conversation

@joshsny
Copy link
Copy Markdown
Contributor

@joshsny joshsny commented Sep 29, 2025

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.

Copy link
Copy Markdown
Contributor

@jonathanlab jonathanlab left a comment

Choose a reason for hiding this comment

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

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 👍🏻

@joshsny joshsny merged commit 7bbd1c6 into main Sep 30, 2025
2 checks passed
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 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
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