Skip to content

feat: replace CLI harness toggle with dev/prod mode#104

Open
steve8708 wants to merge 2 commits intomainfrom
updates-47
Open

feat: replace CLI harness toggle with dev/prod mode#104
steve8708 wants to merge 2 commits intomainfrom
updates-47

Conversation

@steve8708
Copy link
Copy Markdown
Contributor

Summary

  • Replace confusing useCliHarness toggle with clear Dev/Prod segmented button per app in settings
  • Dev mode loads from localhost (dev URL or CLI harness), Prod mode loads the production URL
  • Migrates existing configs from useCliHarness boolean to mode: "dev" | "prod"
  • Also includes OAuth guard removal and Google auth fixes from other agents

Test plan

  • Open desktop app → Settings → each app shows Dev/Prod toggle instead of terminal icon
  • Toggle to Dev → app loads from localhost
  • Toggle to Prod → app loads from production URL
  • Existing configs with useCliHarness migrate correctly on first load

🤖 Generated with Claude Code

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
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 28, 2026

Deploy Preview for agent-native-fw ready!

Name Link
🔨 Latest commit 4c24e70
🔍 Latest deploy log https://app.netlify.com/projects/agent-native-fw/deploys/69c725f722846200080ccfc6
😎 Deploy Preview https://deploy-preview-104--agent-native-fw.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 28, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

Copy link
Copy Markdown

@builder-io-integration builder-io-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.


View in Builder.io

Code review by Builder.io

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.

1 participant