Skip to content

feat: generated api client for tasks - #1

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

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

Conversation

@joshsny

@joshsny joshsny commented Sep 29, 2025

Copy link
Copy Markdown
Contributor

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.

@jonathanlab jonathanlab left a comment

Copy link
Copy Markdown
Contributor

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
MattBro added a commit that referenced this pull request May 13, 2026
Addresses the issues surfaced in the review pass.

Affinity router (#1 — embedding API) — no new SDK dependency needed.
PostHog already exposes embedText() as a HogQL function and
DocumentSimilarityQuery as a query type. v1 issues a HogQL query that
embeds goal_prompt on the fly and ranks distance against existing
signal-report embeddings. Goal prompts don't need server-side
persistence; embed-on-query handles goal edits cleanly.

Signal ingestion (#2 — autonomy overlap) — defer to existing autonomy
auto-start, adopt after. Hedgemony watches for autonomy-created Tasks
tied to signal reports and inserts a hedgemony_hoglet sidecar row,
binding to a nest via the affinity router. Uniqueness constraint on
signal_report_id prevents adoption races.

v1 safety caps (#3) — new section with conservative defaults: 10
active hoglets per nest, 3 spawns per tick, 30s tick debounce, 60
ticks/hour/nest, 8k+2k token cap per tick, 25 wild hoglets in holding.
All surfaced in settingsStore for per-machine override; over-cap
events logged to telemetry under hedgemony.cap_*.

Feedback routing (#4 — completed-session injection) — sendPromptToAgent
requires session.status === "connected". For hoglets whose session
is closed (PR merged), Hedgemony spawns a follow-up hoglet in the
same nest with a prompt referencing the original PR + the comment,
linked via hedgemony_pr_dependency. Mirrors how a human dev handles
late review comments.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dmarticus added a commit that referenced this pull request Jun 17, 2026
Two cleanups from the Greptile pass on #2700:

- Delete the `getAgentApplicationStats` / `getAgentFleetStats` client
  methods + their hooks (`useAgentApplicationStats`,
  `useAgentFleetStats`), the `AgentAggregateStats` wire type, and the
  `stats` / `fleetStats` query keys. Nobody called them — M7 replaced
  these endpoints with the HogQL `\$ai_*` analytics rollup, but the
  endpoint-backed surface was never removed. Side-benefit: the type's
  camelCase fields no longer violate the file's stated snake_case
  convention (Greptile #1).
- Replace `AgentApplicationsListView`'s file-private `EmptyState` with
  the already-exported `AgentDetailEmptyState` (same markup, same prop
  shape) so we have one canonical empty-tile component (Greptile #2).
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