Skip to content

fix(orchestrator): name the model allow-list where enqueue_task picks it - #1194

Merged
edwinyjlim merged 1 commit into
mainfrom
posthog/enqueue-task-model-allow-list
Sep 3, 2026
Merged

fix(orchestrator): name the model allow-list where enqueue_task picks it#1194
edwinyjlim merged 1 commit into
mainfrom
posthog/enqueue-task-model-allow-list

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Problem

enqueue_task accepts an optional model override. The guard behind it
(checkEnqueueGuards) rejects any value outside the wizard's VALID_MODELS
allow-list — but the field was declared as a bare optional string on both
harness schemas, with no description. The allow-list existed only inside the
rejection message.

So an agent that wanted to pin a task's model had to guess a gateway model id,
trip the invalid-model guard, read the list back out of the error, and
re-issue the enqueue. Telemetry shows this happening across separate runs of
the seeded warehouse-source flow: every occurrence is one wasted turn on a
question the schema could have answered up front.

Why

Raised while reading orchestrator telemetry for the data-source connection
task: orchestrator guard tripped / invalid-model was one of the few
structured failure signals in the window, and it is entirely self-inflicted —
the agent is asked to supply a value from a list it is never shown.

Changes

  • Add ENQUEUE_MODEL_DESCRIPTION to queue-tools.ts, built from
    VALID_MODELS, so the guard and the description share one source.
  • Describe the model field with it on both enqueue_task schemas: the zod
    shape used by the wizard-tools MCP server and the typebox mirror the pi
    harness mounts. The orchestrator runs on pi, so a description present only
    on the MCP schema would not be in effect.
  • The description also steers toward omitting the field, which is the right
    default — the task's own model is already resolved by the switchboard.

No behaviour change to the guard itself; a rejected model is still rejected.

Test plan

pnpm build && pnpm fix clean. New tests in
orchestrator/__tests__/queue-tools.test.ts:

  • the description lists exactly the models isValidModel accepts, so the
    advertised list and the guard cannot drift apart
  • the MCP enqueue_task schema's model field actually carries it

Existing orchestrator suite (156 tests) passes.


Created with PostHog Desktop

The `model` parameter on `enqueue_task` was declared as a bare optional
string on both harness schemas, while `checkEnqueueGuards` rejects anything
outside `VALID_MODELS`. The allow-list only appeared in the rejection
message, so an agent had to guess a gateway model id, trip the
`invalid-model` guard, and spend a turn reading the list back.

Move the list into a shared `ENQUEUE_MODEL_DESCRIPTION` and describe the
field with it on both the zod schema and the pi typebox mirror, so the guard
and the description cannot disagree.

Generated-By: PostHog Desktop
Task-Id: 93b396ed-9a30-4d56-bd97-6bd31c232436
Copilot AI lite review requested due to automatic review settings September 2, 2026 11:54
@Gilbert09
Gilbert09 requested a review from a team as a code owner September 2, 2026 11:54

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/groq
  • /wizard-ci ai-observability/manual-capture
Show more apps
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a Context Mill branch:

  • /wizard-ci all context-mill:my-branch

Add context-mill:<branch> to any command above to pin the Context Mill branch. It defaults to main.

Results will be posted here when complete.

@edwinyjlim
edwinyjlim merged commit e62eb38 into main Sep 3, 2026
20 checks passed
@edwinyjlim
edwinyjlim deleted the posthog/enqueue-task-model-allow-list branch September 3, 2026 01:20
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.

3 participants