Skip to content

feat(integrations): Adding Integrations button via OpenInt #6

Open
pellicceama wants to merge 6 commits into
freestyle-sh:mainfrom
openintegrations:openint
Open

feat(integrations): Adding Integrations button via OpenInt #6
pellicceama wants to merge 6 commits into
freestyle-sh:mainfrom
openintegrations:openint

Conversation

@pellicceama
Copy link
Copy Markdown

@pellicceama pellicceama commented Jun 3, 2025

This adds an integrations button powered by OpenInt. It's an example implementation meant for feedback.

How it works:

  • If there's an OPENINT_API_KEY a Manage Integrations button is rendered. Skipped if not.
  • The System message instructs the LLM to use the /integrations directory to get clients with managed auth for the integration
  • When an end user adds an integration via the button, the onEvent handler ads a system prompt to the history. It contains already tested code with securely managed auth for said integration.

Demo one-shotting a github integration with auth: https://www.loom.com/share/2486d9e2b8ab424b8a462e05ba7df200?sid=78bd2e1d-01cb-4f45-bbcc-80085e1bd6f6

Copy link
Copy Markdown

@mesa-dot-dev mesa-dot-dev Bot left a comment

Choose a reason for hiding this comment

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

What Changed

This PR introduces an "Integrations" button powered by OpenInt. Key changes include:

  • Adding the @openint/connect dependency.
  • Creating a new API endpoint src/app/api/integration/route.ts to generate OpenInt tokens for users, requiring an OPENINT_API_KEY.
  • Implementing a new src/components/IntegrationButton.tsx component that fetches this token and renders the OpenInt ConnectButton. This component also includes an onEvent handler that triggers an onPrompt callback when an integration is connected.
  • Integrating this IntegrationButton into the src/components/chat.tsx interface.
  • Updating src/lib/system.ts to modify the system message. It now instructs the LLM to check the /integrations directory for available clients and guides users to connect integrations if they aren't already set up. When an integration is added, a system prompt with pre-tested code and managed authentication is added to the chat history.

Risks / Concerns

The review identified a couple of minor risks in src/components/IntegrationButton.tsx:

  1. Lack of response status checking before parsing JSON on line 21, which could lead to errors if the API returns a non-2xx status.
  2. Potential for className to be undefined on line 63, which could result in an invalid class string "undefined mb-2".

Additionally, the new /api/integration endpoint and the integration button functionality depend on the OPENINT_API_KEY environment variable being set.

6 files reviewed | 2 comments | Review on Mesa | Edit Reviewer Settings

YarikSWT pushed a commit to YarikSWT/Adorable that referenced this pull request May 4, 2026
…rrorsCount=1

STATIC_MODE_REMAINING freestyle-sh#6 — vite v5.x prints "The CJS build of Vite's Node
API is deprecated..." to stderr on every successful build, npm/Browserslist
similarly leak warn/notice lines. The fallback "unknown" branch in
parseBuildErrors fired on these, producing audit log entries like:

  {"event":"build_finished","status":"succeeded","exitCode":0,
   "durationMs":8338,"errorsCount":1}

Fix: BENIGN_STDERR_LINE_PATTERNS — narrow line-level regexes for the
specific known noise. stripBenignStderr() helper applies them; the
fallback now decides on the post-strip stderr instead of the raw one.
Patterns kept narrow on purpose: too-loose hides real errors, and any
stderr that consists *entirely* of these is a genuinely-successful build.

5 new tests cover the regression: banner-only, full Vite v5.4.21 success
output, npm warn/notice/info, Browserslist nag, real error mixed with
banner. 565/22 stable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
YarikSWT pushed a commit to YarikSWT/Adorable that referenced this pull request May 4, 2026
…ging)

STATIC_MODE_REMAINING freestyle-sh#7 was downgraded after freestyle-sh#6 (commit ea00293)
filtered the deprecation banner from stderr — the visible symptom is
gone. The bump itself remains valid (removes CJS shim, may retire the
ADR-029 /tmp workaround) but cannot be safely applied without a live
docker build to verify:

- vite 6 builds the current boilerplate unchanged
- @vitejs/plugin-react 5.x and the rest of the peer deps line up
- the sibling timestamp file write that motivated ADR-029 is gone

ADR-033 records the rationale, the staging acceptance steps (build
new image, populate volume, run bench-static-build for 10 iter,
check stderr for residual banner), and the migration story for
existing projects pinned to 1.0.0. The actual `templates/vite-react`
bump will be its own commit when staging signs off.

STATIC_MODE_REMAINING.md §7 marked PLANNED; pointer to ADR-033.

Tests untouched (603/22 stable).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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