feat: replace CLI harness toggle with dev/prod mode#104
feat: replace CLI harness toggle with dev/prod mode#104
Conversation
Replace the confusing CLI harness toggle with a clear Dev/Prod segmented button per app in settings. Dev mode loads from localhost, Prod mode loads the production URL. - Rename useCliHarness to mode: "dev" | "prod" in AppConfig - Add migration for existing configs - Update resolveUrl, AppSettings UI, and CSS - Remove cross-user OAuth guard for single-user apps
✅ Deploy Preview for agent-native-fw ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
agent-native-content | 4c24e70 | Commit Preview URL Branch Preview URL |
Mar 28 2026, 12:53 AM |
There was a problem hiding this comment.
Builder has reviewed your changes and found 1 potential issue.
Review Details
PR #104 Review — Replace CLI Harness Toggle with Dev/Prod Mode
This PR replaces the opaque terminal-icon toggle (useCliHarness) with an explicit Dev/Prod segmented button per app in the desktop settings UI. It includes a backward-compatible migration from the old boolean field to the new mode: "dev" | "prod" enum, plus an OAuth token owner-preservation fix and Google auth mobile callback improvements.
Risk: Standard — Schema migration, URL resolution logic change, and OAuth token ownership logic are all touched.
Review Summary
Ran 2 parallel code-review passes with randomized file ordering.
Migration correctness ✅ — The useCliHarness → mode migration in app-store.ts handles all edge cases correctly (true→dev, false→prod, undefined→prod). The if (migrated) saveApps() guard avoids unnecessary disk writes.
OAuth token owner preservation ✅ — The SELECT-before-upsert pattern in oauth-tokens/store.ts is correct. Concurrent refreshes for the same (provider, accountId) would both read the same pre-existing owner and write identically — no race condition.
URL resolution (desktop) ✅ — The new resolveUrl() in AppWebview.tsx actually fixes a pre-existing bug where devUrl was used even in production mode. Now correctly gated behind mode === "dev".
Google OAuth callback ✅ — Replacing window.close() with window.location.href="/" after 1.5s is a valid improvement; window.close() is unreliable in mobile WebViews not opened via window.open().
Key Finding
🟡 MEDIUM: Mobile app (packages/mobile-app/app/app/[id].tsx) ignores the new mode flag and switches unconditionally on __DEV__, bypassing the user's dev/prod setting. See inline comment.
Code review by Builder.io
Summary
useCliHarnesstoggle with clear Dev/Prod segmented button per app in settingsuseCliHarnessboolean tomode: "dev" | "prod"Test plan
useCliHarnessmigrate correctly on first load🤖 Generated with Claude Code