feat: planned events via wizard-proxy HTTP (BA-47) and signup dashboard_url#405
feat: planned events via wizard-proxy HTTP (BA-47) and signup dashboard_url#405
Conversation
🧙 Wizard CIRun 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:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
b920914 to
97064bc
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Zod schema rejects
nulldashboard_url breaking signup- Changed
z.string().min(1).optional()toz.string().min(1).nullish()so the schema accepts bothundefinedandnullvalues fordashboard_url, preventing valid API responses withnullfrom failing parse.
- Changed
Or push these changes by commenting:
@cursor push 23a085bc20
Preview (23a085bc20)
diff --git a/src/utils/direct-signup.ts b/src/utils/direct-signup.ts
--- a/src/utils/direct-signup.ts
+++ b/src/utils/direct-signup.ts
@@ -19,7 +19,7 @@
const OAuthProvisioningSchema = z.object({
type: z.literal('oauth'),
oauth: z.object({ code: z.string().min(1) }),
- dashboard_url: z.string().min(1).optional(),
+ dashboard_url: z.string().min(1).nullish(),
});
const RedirectSchema = z.object({You can send follow-ups to the cloud agent here.
Replace MCP create_events with POST {wizardProxy}/v1/planned-events using the same OAuth access token and zone-aware base URL as createAmplitudeApp.
- On HTTP 404 (route not deployed), fall back to MCP create_events.
- Event descriptions still use MCP update_event until a proxy endpoint exists.
- commitPlannedEvents now requires zone; agent-runner passes us/eu from cloudRegion.
Stacks on wizard PR #385. Coordinate release with amplitude/javascript#109119 (Thunder wizard-proxy).
Made-with: Cursor
- Parse optional dashboard_url from agentic signup response; forward as dashboardUrl through performSignupOrAuth without NDJSON exposure - Session + TUI store carry signupMagicLinkUrl; Outro prefers it over checklist open URL; diagnostics expose boolean only - Agent signup outro uses magic link for continueUrl; open browser in agent mode when non-CI - Tests for direct-signup, signup-or-auth, session defaults, OutroScreen Made-with: Cursor
97064bc to
5bb285c
Compare
z.string().min(1).optional() rejects explicit null. APIs commonly return null for absent optional string fields; the entire signup breaks even though the auth code was successfully obtained. Switch to .nullish() so null, undefined, and absent are all valid; downstream already coalesces with `?? null`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Strict
min(1)on optionaldashboard_urlbreaks signup- Removed
min(1)from thedashboard_urlschema field and changed?? nullto|| nullso empty strings are treated as null instead of causing parse failure.
- Removed
Or push these changes by commenting:
@cursor push 2de7b7e0ce
Preview (2de7b7e0ce)
diff --git a/src/utils/direct-signup.ts b/src/utils/direct-signup.ts
--- a/src/utils/direct-signup.ts
+++ b/src/utils/direct-signup.ts
@@ -19,7 +19,7 @@
const OAuthProvisioningSchema = z.object({
type: z.literal('oauth'),
oauth: z.object({ code: z.string().min(1) }),
- dashboard_url: z.string().min(1).nullish(),
+ dashboard_url: z.string().nullish(),
});
const RedirectSchema = z.object({
@@ -224,6 +224,6 @@
expiresAt,
zone: input.zone,
},
- dashboardUrl: parsedCode.data.dashboard_url ?? null,
+ dashboardUrl: parsedCode.data.dashboard_url || null,
};
}You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit f43111b. Configure here.
Bugbot follow-up: `.min(1).nullish()` still rejects empty strings. If the provisioning API ever returns `"dashboard_url": ""`, the entire schema fails and the valid OAuth code in the same response is discarded — signup breaks. An optional metadata field shouldn't gate the critical signup path. Drop `min(1)` and coerce empty to null at the read site. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Conflicts against current main. Could you rebase + force-push? I'll admin-merge once green. |


Summary
This branch combines two related improvements:
BA-47 — Planned events registration
create_eventstool.create_eventstool (see prior fix on this branch).Signup UX — Provisioning
dashboard_urldashboard_urlfrom the agentic signup response (amplitude/javascript provisioning API).signupMagicLinkUrlin session/TUI so the success outro prefers the magic link over the checklist dashboard open URL.continueUrl, opens the browser when non-CI; diagnostics only expose a boolean (signup_magic_link_available), not the URL (sensitive query params).runDirectSignupIfRequestedtreatsundefinedlikenullfromperformSignupOrAuthso tests and edge cases do not crash.Test plan
pnpm vitest run(pre-push)direct-signup,signup-or-auth,wizard-session,OutroScreen,planned-eventsMade with Cursor
Note
Medium Risk
Touches signup/auth flow and adds a new network path for planned-event creation; failures are handled defensively, but regressions could affect onboarding UX and event-plan persistence.
Overview
Adds a new primary path for committing agent-planned events by POSTing to the wizard-proxy
/v1/planned-eventsendpoint (zone-aware, bearer auth, typed success/error parsing, 404 fallback to MCPcreate_events), while keeping MCPupdate_eventfor descriptions.Extends direct signup to parse and propagate an optional provisioning
dashboard_urlassignupMagicLinkUrlacross session/state, making the outro (and agent continue URL) prefer the magic-link and opening it automatically in agent non-CI runs, with diagnostics only emitting availability (not the URL). Test coverage is updated/added for the new HTTP flow, error mapping, and the new signup URL plumbing.Reviewed by Cursor Bugbot for commit 879e615. Bugbot is set up for automated code reviews on this repo. Configure here.