Skip to content

Conversation

@Paveltarno
Copy link
Collaborator

@Paveltarno Paveltarno commented Feb 9, 2026

Note

Description

This PR adds the ability to skip individual OAuth connector authorizations during the connectors push flow by pressing the Esc key. Previously, users had to wait for authorization to complete or timeout, or kill the entire process. Now when authorizing multiple connectors, users can skip specific connectors without interrupting the entire push operation. Skipped connectors are tracked and reported separately in the summary output.

Related Issue

Part of #184 (connectors feature implementation)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Added runOAuthFlowWithSkip() function to handle OAuth flows with Esc key skip capability
  • Introduced OAuthFlowStatus type extending ConnectorOAuthStatus with "SKIPPED" state
  • Implemented temporary process.exit override to intercept Esc/Ctrl+C key presses during OAuth flow
  • Updated printSummary() to track and display skipped connectors as warnings
  • Replaced runTask() with direct spinner() usage for more control over exit handling
  • Added polling constants (POLL_INTERVAL_MS, POLL_TIMEOUT_MS) for OAuth status checks
  • Enhanced spinner messages to indicate "Esc to skip" functionality
  • Added comprehensive JSDoc comment explaining the process.exit override mechanism

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated AGENTS.md if I made architectural changes

Additional Notes

Technical implementation: Clack's block() function (used by spinner()) puts stdin in raw mode where Esc/Ctrl+C triggers process.exit(0) directly instead of emitting SIGINT. To implement skip functionality, we temporarily override process.exit during the OAuth flow to set a skipped flag instead of killing the process. The override is restored in a finally block to ensure normal exit behavior is preserved after each connector's authorization attempt.

Review fixes: Added inline comment documenting the process.exit override, wrapped OAuth flow in try/catch/finally for better error handling.


🤖 Generated by Claude | 2026-02-12 22:15 UTC

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.31-pr.217.a8a828c

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.31-pr.217.a8a828c"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.31-pr.217.a8a828c"
  }
}

Preview published to npm registry — try new features instantly!

@dor-chaouat dor-chaouat moved this from Backlog to In progress in CLI Development Feb 9, 2026
@Paveltarno Paveltarno force-pushed the pavelta-connectors-skip-oauth branch from e304a12 to 3d50451 Compare February 10, 2026 15:18
@base44 base44 deleted a comment from claude bot Feb 10, 2026
Copy link
Collaborator

@kfirstri kfirstri left a comment

Choose a reason for hiding this comment

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

I commented this in the parent PR #189

the entire pWaitFor should not be in the core/ folder.. and in this PR there's now also spinners and more stuff which core/ packages should not be familiar with.

@github-project-automation github-project-automation bot moved this from In progress to Ready in CLI Development Feb 11, 2026
@Paveltarno Paveltarno force-pushed the pavelta-connectors-1 branch 2 times, most recently from 3fc2e0c to ec69f63 Compare February 12, 2026 12:04
Base automatically changed from pavelta-connectors-1 to main February 12, 2026 13:27
@Paveltarno Paveltarno force-pushed the pavelta-connectors-skip-oauth branch from 99b7274 to 21ed8d3 Compare February 12, 2026 13:46
@claude
Copy link

claude bot commented Feb 12, 2026

README check ran. 5 issue(s) found and applied: Added missing eject command, added missing connectors push command, updated deploy description to match code, updated logout description to match code, updated whoami description to match code. README.md has been updated in this branch (commit ready to push).

@Paveltarno Paveltarno force-pushed the pavelta-connectors-skip-oauth branch from c04ffd5 to bdb1198 Compare February 12, 2026 13:57
@base44 base44 deleted a comment from claude bot Feb 12, 2026
@claude
Copy link

claude bot commented Feb 12, 2026

README check ran. 10 issues found:

  1. Missing eject command (uncommented)
  2. Missing connectors push command
    3-10. Updated command descriptions to match code

README.md has been updated in this branch.

@claude
Copy link

claude bot commented Feb 12, 2026

README check ran. 3 issues found and applied: (1) Added missing eject command, (2) Added missing connectors push command, (3) Updated command descriptions to match source code exactly. README.md has been updated in this branch.

@Paveltarno Paveltarno force-pushed the pavelta-connectors-skip-oauth branch from bdb1198 to bd6d0a4 Compare February 12, 2026 14:02
@claude
Copy link

claude bot commented Feb 12, 2026

README check ran. 3 issue(s) found and applied: (1) Added missing eject command, (2) Updated logout description to match code, (3) Added missing connectors push command. README.md has been updated in this branch.

interval: POLL_INTERVAL_MS,
timeout: POLL_TIMEOUT_MS,
},
).catch((err) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not use try/catch/finally

Copy link
Collaborator

@kfirstri kfirstri left a comment

Choose a reason for hiding this comment

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

small changes

@kfirstri kfirstri moved this from Ready to In progress in CLI Development Feb 12, 2026
@Paveltarno Paveltarno requested a review from kfirstri February 12, 2026 16:19
Paveltarno and others added 5 commits February 12, 2026 18:20
Add connector resource module supporting 12 OAuth providers:
googlecalendar, googledrive, gmail, googlesheets, googledocs,
googleslides, slack, notion, salesforce, hubspot, linkedin, tiktok.

- Zod discriminated union schema with type discriminator per provider
- JSDoc links to official OAuth scope documentation for each provider
- JSONC file reading with validation (filename must match type field)
- API response schemas for upstream connector state
- Unit tests with fixtures for valid, invalid, and mismatched connectors

Part of: #184

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(connectors): implement push logic for syncing connectors

Add pushConnectors function that:
- Syncs all local connectors via /sync endpoint
- Removes upstream-only connectors not in local config
- Returns typed results (synced, removed, needs_oauth, error)

Includes unit tests covering all scenarios.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(connectors): add OAuth flow handling with browser redirect and polling (#192)

* feat(connectors): add OAuth flow handling with browser redirect and polling

Add runOAuthFlow function that:
- Opens OAuth redirect URL in browser
- Polls getOAuthStatus until ACTIVE or FAILED
- Returns PENDING on timeout (5 minutes)

Uses p-wait-for TimeoutError for robust timeout detection.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* connectors: base44 connectors push (#194)

* final connector work sofi 1

* scopes

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Change provider field from closed enum to flexible union that accepts both
known providers (googlecalendar, notion, slack, etc.) and any arbitrary
provider string. This enables users to configure custom OAuth providers
without waiting for first-class Base44 support.

Schema changes:
- Add GenericConnectorSchema for arbitrary provider types
- Update ConnectorResourceSchema to union of specific + generic schemas
- Update IntegrationTypeSchema to accept known enum OR any non-empty string
- Only reject empty strings

Test coverage:
- Verify known providers continue to work
- Verify arbitrary providers are accepted
- Verify empty strings are rejected
- All 137 tests passing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Override process.exit temporarily during the spinner to intercept
Ctrl+C/Escape (which clack's block() converts to process.exit(0)),
letting users skip individual connector authorizations instead of
killing the entire process. Adds SKIPPED status to the summary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Paveltarno and others added 3 commits February 12, 2026 18:20
@Paveltarno Paveltarno force-pushed the pavelta-connectors-skip-oauth branch from 066105c to 53c7c7d Compare February 12, 2026 16:20
@claude
Copy link

claude bot commented Feb 12, 2026

README check ran. 6 issue(s) found: 1) Missing eject command (currently commented out), 2) Missing connectors push command, 3) Outdated descriptions for create, deploy, link, logout, whoami, agents pull, agents push, and entities push. Manual update required - edit permission was not granted during automated check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants