Skip to content

fix(agents): stop unversioned builds pointing prompts at the latest release - #379

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixagents-stop-the-agent-menu-pointing-e3d77e
Draft

fix(agents): stop unversioned builds pointing prompts at the latest release#379
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixagents-stop-the-agent-menu-pointing-e3d77e

Conversation

@posthog

@posthog posthog Bot commented Sep 2, 2026

Copy link
Copy Markdown

Problem

  • A wizard run dies on a hard 404 when a flow exists in source but is not yet in a release. It has happened twice, and it will happen again on the next new flow.
  • An unversioned build has no release to point at, so defaultAgentsBaseUrl fell back to releases/latest/download. The locally built agent-menu.json then advertised prompts that the latest release does not carry.
  • The wizard fetches every prompt of a flow together and throws on the first miss, so one unpublished file takes the run down. The error names neither the flow nor the reason.
  • No user is hurt: the failing flows were unreleased, and each error tracking issue holds one occurrence from one developer. The cost is a confusing failure plus a new issue and inbox report each time.

Changes

  • A build without a version now says where the prompts really are: it points each menu entry at the file it just wrote in dist/agents/.
-        : `${REPO_URL}/releases/latest/download`;
+        : pathToFileURL(agentsDistDir).href;
Build downloadUrl base
BUILD_VERSION=1.50.0 .../releases/download/v1.50.0 (no change)
AGENTS_BASE_URL set (dev server) that URL (no change)
Neither (plain npm run build) file://<repo>/dist/agents (was releases/latest/download)
  • npm run build prints one line when the prompts are local, and names the two ways to serve them elsewhere.
  • Tests cover both the pinned URL and the local URL.

Note

This fixes the build side only. A wizard-side error that names the unpublished flow is still worth adding, and resolveBaseDownloadUrl in scripts/lib/build-phases.js has the same fallback for skill ZIPs. Neither is in this PR.

Agent context

  • I considered failing the build instead. It is rejected because npm run build is the documented local check in AGENTS.md, and a hard failure would block every contributor who builds without a version.
  • scripts/mirror-dist.js rewrites both release bases, but it runs only with a real version, so the local base never reaches the mirror.
  • Verified with npm test (175 pass) and a local npm run build: the menu holds file:// URLs that resolve to real files, and the warning prints.

Created with PostHog Desktop from this inbox report.

An unversioned build wrote agent-menu.json with download URLs under
releases/latest/download. The menu then listed prompts that the latest
release does not carry, so a flow that is still on a branch failed the
whole wizard run with a bare 404.

A build without a version now points each prompt at the file it just
wrote in dist/agents/, and the build log says the prompts are local.
AGENTS_BASE_URL still wins, which is how the dev server serves them
over HTTP.

Generated-By: PostHog Desktop
Task-Id: f6cb3801-fedd-410b-8955-ede0c97ce2a7
@posthog

posthog Bot commented Sep 2, 2026

Copy link
Copy Markdown
Author

🦔 PostHog Review reviewed this pull request

Nothing worth raising this time, so here's a calming picture instead:

A happy dog on a sunny path

@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 wizard branch:

  • /wizard-ci all wizard:my-branch

Add wizard:<branch> to any command above to pin the wizard branch. It defaults to main.

Results will be posted here when complete.

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.

0 participants