Commit Graph
65 Commits
Author SHA1 Message Date
ciregenz 1a06ce2063 [eric] small bug fixes 2026-03-24 11:15:07 -07:00
ciregenz 6381e32acd [eric] add back browser agent cancel_event from haik's branch 2026-03-23 18:48:05 -07:00
ciregenz ea8b159e98 [eric] merge haik/updates-v1 + bump to v1.0.12 2026-03-23 18:17:57 -07:00
ciregenz ab23e1f5f9 [eric] mark non-Claude subscriptions as coming soon, reorder providers
- Gemini, ChatGPT, GitHub Copilot marked as preview (dimmed, unclickable)
- Shows "Coming soon" instead of Connect button
- Reordered: Claude → Gemini → ChatGPT → GitHub Copilot
- Applied to both Settings subscription cards and onboarding modal
2026-03-23 17:53:13 -07:00
ciregenz 1fc58af88a [eric] fix subscription OAuth — direct exchange from callback page
Modified 9Router's callback page to call the exchange endpoint directly
instead of relying on postMessage/BroadcastChannel relay (which fails
in Electron where window.opener is null).

Flow: click Connect → sign in → callback page fetches pending state
from our backend → calls 9Router exchange → connection saved → done.

Backend:
- Added GET /api/subscriptions/pending/{state} with CORS for callback
- Added GET /api/subscriptions/callback as fallback
- Store pending OAuth state (codeVerifier, redirectUri) keyed by state
- redirect_uri stays on localhost:20128 (required by Anthropic)

Frontend:
- Popup window for auth URL + postMessage listener + status polling
- Works in both Electron and regular browser
2026-03-23 17:23:22 -07:00
ciregenzandClaude Opus 4.6 8d18ca18c7 [eric] fix MCP empty responses + diagnose Twitter payment issue
Root cause of "(empty response)" for Reddit MCP:
- Reddit MCP returns valid JSON (posts with titles, scores, etc.)
- agent_loop.py truncated display text to 2000 chars
- Truncated JSON breaks JSON.parse in frontend ToolCallBubble
- Frontend falls through to data: {} → renders "(empty response)"
- Increased display limit to 15000 chars (matches BrowserGetText)

Twitter/xbird MCP:
- Returns "402 Payment Required" — xbird needs paid credits
- Not an OpenSwarm bug, tool itself requires payment

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 15:36:00 -07:00
ciregenzandClaude Opus 4.6 a5d014e10f [eric] first-launch onboarding modal
Shows when no API keys configured AND no 9Router subscriptions connected:
- "Welcome to OpenSwarm — Connect an AI model to get started"
- Subscription buttons: Claude, ChatGPT, GitHub Copilot, Gemini
  (click → OAuth flow directly, no 9Router GUI)
- "I have an API key" → dismisses modal, user goes to Settings
- "Skip for now" → dismisses modal
- Auto-checks 9Router status on mount
- Dismissed state persists for session (doesn't nag)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:35:52 -07:00
haikdc 99aa8afc6d [Haik]: Removed community links from readme v1.0.14 v1.0.17 v1.0.20 v1.0.13 v1.0.16 v1.0.21 v1.0.22 v1.0.15 v1.0.18 2026-03-22 11:13:46 -07:00
ciregenzandClaude Opus 4.6 24ad784cd0 [eric] seamless subscription connect — no 9Router GUI needed
OAuth flow now stays entirely within OpenSwarm:
1. Click "Connect Claude" → Anthropic sign-in opens as popup
2. User signs in → 9Router's /callback catches redirect
3. postMessage sends code back to OpenSwarm window
4. OpenSwarm exchanges code via /subscriptions/exchange proxy
5. Shows "Connected ✓" — done in 3 steps, 1 app

Changes:
- nine_router.py: return real authUrl for auth_code providers
  instead of redirecting to 9Router dashboard
- nine_router.py: add exchange_oauth() proxy function
- agents.py: add POST /subscriptions/exchange endpoint
- Settings.tsx: popup + window.addEventListener('message') for
  OAuth callback, with polling fallback

Before: 8 steps across 2 apps
After: 3 steps in 1 app (click → sign in → done)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 10:52:56 -07:00
ciregenzandClaude Opus 4.6 7430eae88a [eric] fix OAuth redirect URI for Claude subscription connect
Problem: Our code sent http://localhost:20128/api/oauth/claude/callback
as redirect_uri, but Anthropic only accepts http://localhost:PORT/callback.

Fix: For authorization_code providers (Claude, Codex, Gemini), open
9Router's own dashboard page instead of trying to proxy the OAuth flow.
9Router handles the full popup + callback internally.

Flow: Click Connect → opens 9Router dashboard → user clicks Connect there →
OAuth popup → callback handled → poll from OpenSwarm until connected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 10:24:43 -07:00
ciregenzandClaude Opus 4.6 a68f6cb750 [eric] fix MCP empty responses + update saved system prompt
MCP fix:
- Reverted to parallel eager MCP connection (not lazy)
- Lazy schemas had empty input_schema ({}) causing models to send
  wrong/empty arguments → MCP servers returned empty responses
- Now connects all MCP servers in parallel with 10s timeout each
- Gets real tool schemas from servers so models know exact parameters

System prompt:
- Updated saved settings.json to use new MCP-first default prompt
- Old prompt ("ask follow ups", "prioritize browser") was still saved
  from before the code change — only affected new installs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 10:03:33 -07:00
ciregenzandClaude Opus 4.6 9a8fed3862 [eric] fix credential resolution for all providers + 9Router fallback
Fixed:
- validate_credentials now handles display names (Anthropic, OpenAI, Google)
  not just lowercase — was causing "Provider not found" errors
- OpenRouter-backed providers (xAI, Meta, DeepSeek, Mistral, Qwen, Cohere)
  now fall back to 9Router when no OpenRouter API key is set
- OpenAICompatProvider no longer crashes on empty API key
- Clear error messages per provider type when nothing is configured

Credential resolution order (per provider):
1. Direct API key → use native provider
2. 9Router running → route through 9Router
3. Neither → clear error with instructions

All 9 providers tested: validate + create_provider pass with 9Router,
correctly blocked with descriptive errors when 9Router is down + no keys.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 09:52:37 -07:00
ciregenzandClaude Opus 4.6 6137b0b311 [eric] headless browser fallback + WebSearch fix
Headless browser (Playwright):
- New: headless_browser.py — full Playwright-based browser implementation
- Supports: navigate, screenshot, get_text, click, type, evaluate, get_elements
- Auto-fallback: execute_browser_tool tries Electron webview first, falls back to
  headless Playwright when "not found" error detected
- Works everywhere: web browser, Electron app, server, CI
- Pages managed per browser_id, cleaned up on session close

WebSearch fix:
- Changed User-Agent from bot identifier to Chrome UA
- DDG serves different HTML to bots vs browsers, causing parse failures
- Now returns proper results (tested: Eater SF, Infatuation, etc.)

Requirements:
- Added playwright to requirements.txt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 09:39:50 -07:00
ciregenzandClaude Opus 4.6 ed66c80f7d [eric] fix duplicate text — dedup WebSocket stream/message events
Root cause: two WebSocket connections open to the same session
(dashboard card + expanded chat). Every event delivered twice.

Fix: track seen stream IDs and message IDs in WebSocketManager.
- stream_start: skip if message_id already seen
- stream_delta: only accept for streams WE initiated
- stream_end: dedup + clean up tracking
- agent:message: skip if message id already processed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 00:36:10 -07:00
ciregenzandClaude Opus 4.6 82212920ae [eric] overhaul default system prompt — MCP-first, action-oriented
Old prompt: "ask as many follow ups as needed" + "prioritize browser"
New prompt:
- MCP tools first, WebSearch second, browser last
- Do not narrate routine tool calls — just call the tool
- Be direct — make reasonable assumptions, don't over-ask
- Modeled after OpenClaw's tool call style

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 22:38:21 -07:00
ciregenzandClaude Opus 4.6 baedeee47d [eric] fix WebSearch DDG parser, diagnose duplicate text + browser issues
WebSearch fix:
- DuckDuckGo changed HTML attribute order (class before href)
- Added fallback regex to handle both orderings
- WebSearch now returns results correctly

Diagnosed issues (not yet fixed):
- Duplicate text: caused by 2 WebSocket connections to same session
  (frontend React component mounts twice). Pre-existing Haik code issue.
- Browser agent "not found": browser cards require Electron webview,
  doesn't work in regular browser (localhost:3000). Expected behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 22:31:56 -07:00
ciregenzandClaude Opus 4.6 36d79fd1d3 [eric] lazy MCP connections + browser agent 9Router support
Performance fix:
- MCP servers no longer spawned upfront for every message
- Tool schemas loaded from cached metadata (instant, no subprocess)
- MCP servers only connected when their tools are first called (lazy)
- Browser agent MCP server still connects upfront (lightweight)
- Reduces startup from 30+ seconds to <1 second for simple messages

Browser agent 9Router support:
- Browser agent now works through 9Router when no API key set
- Uses OpenAI client format when base_url provided
- Model ID mapping for 9Router (cc/ prefix)
- Passes auth_token and base_url through run_browser_agents

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 21:57:26 -07:00
ciregenzandClaude Opus 4.6 0a907e4bac [eric] fix subscription provider IDs, handle both OAuth flows
- Fixed provider IDs to match 9Router: claude, codex, github, gemini-cli
- Handle authorization_code_pkce flow (Claude, Codex) — opens browser, polls status
- Handle device_code flow (GitHub, Qwen, Kiro) — shows code, polls for completion
- Pass code_verifier and extra_data through poll endpoint
- Fix isConnected check for 9Router's {connections: [...]} response format
- Auto-start 9Router in backend lifespan

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 21:03:07 -07:00
ciregenzandClaude Opus 4.6 50b28f7080 [eric] zero-friction subscription access via 9Router proxy
- 9Router auto-starts silently in background on app launch
- Subscription proxy endpoints: /subscriptions/status, connect, poll, models
- Per-provider subscription cards in Settings → Models (Claude, ChatGPT, Copilot, Gemini)
- Click "Connect" → browser opens for OAuth → poll until done → "Connected ✓"
- No terminal, no commands, no copy-paste — just click + browser sign-in
- 9Router manages OAuth tokens, auto-refresh, quota tracking
- Removed old NineRouterSetup terminal command UI
- Removed standalone CopilotAuthButton (merged into SubscriptionCards)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 20:49:43 -07:00
ciregenzandClaude Opus 4.6 b9b044a2e3 [eric] 9Router subscription proxy, GitHub Copilot auth, Settings restructure
Subscription access (WIP):
- 9Router integration: auto-detects if running, routes through user's subscriptions
- Fallback routing: no API key → check 9Router → use subscription
- Model ID mapping for 9Router (cc/ prefix for Claude Code models)
- GitHub Copilot OAuth device flow (copilot_auth.py, providers/copilot.py)
- Copilot auth endpoints: start-auth, poll-auth, models, disconnect

Settings restructure:
- 4 tabs: General, Models, Usage, Commands
- Models tab: Subscriptions section (9Router + Copilot) + API Keys section
- Per-provider "CONNECTED" badges
- Subscription token fields removed (Anthropic banned OAuth in third-party apps)
- 9Router auto-detection with "Check Connection" button

Provider routing:
- create_provider() checks subscription tokens → API keys → 9Router fallback
- validate_credentials() allows through if 9Router is running
- 9Router model ID mapping (sonnet → cc/claude-sonnet-4-6)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 20:46:26 -07:00
haikdc a284b9a24e [Haik]: updated package json 2026-03-21 14:02:46 -07:00
ciregenzandClaude Opus 4.6 b6f45e8412 [eric] multi-provider agent loop, PostHog analytics, settings overhaul
Multi-provider support (WIP - not fully tested):
- Owned agent loop replacing claude_agent_sdk (agent_loop.py, mcp_client.py)
- Provider adapters: Anthropic (native), OpenAI-compat (any endpoint), Gemini (native + schema cleaning)
- 19 models across 9 providers (Anthropic, OpenAI, Google, xAI, Meta, DeepSeek, Mistral, Qwen, Cohere)
- OpenRouter integration for 300+ models via single API key
- Builtin tool reimplementations (Read, Write, Edit, Glob, Grep, Bash, WebSearch, WebFetch, AskUserQuestion)
- Standalone MCP client manager (stdio/sse/http)
- Frontend: grouped model dropdown, provider selection, dynamic context windows

Analytics (tested):
- PostHog integration as single analytics source
- Tracks: app.opened, session.started/completed, tool.called, tool.approval_resolved, error.occurred
- Rich session data: user messages, assistant messages, session titles, tools used, MCP servers, task categories
- PostHog dashboard with 14 insights created via API
- Usage stats in Settings (Usage tab) with pixel-art bars

Settings (tested):
- 4 tabs: General, Models, Usage, Commands
- Model Providers tab with OpenRouter (recommended), Anthropic, OpenAI, Google key fields
- "Get key" links for each provider
- Usage tab with session/cost/tool stats + analytics opt-in toggle
- analytics_opt_in defaults to true, installation_id auto-generated

Merged haik/updates-v1 (tested):
- Sub-agent spawning, chat branching, browser control improvements
- Settings: auto_select_mode, expand_new_chats, auto_reveal_sub_agents, dev_mode

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 13:50:21 -07:00
haikdc f21d245be7 [Haik]: added in glow to collapsed floating island when approval is needed 2026-03-21 00:28:36 -07:00
haikdc e513bb0d1b [Haik]: round 3 of dynamic island redesign (better compact view) 2026-03-21 00:00:57 -07:00
haikdc 809eacc041 [Haik]: round 2 of dynamic island redesign (collapsible completed tab) (approve/deny from collapsed state) (height limited and scrollable expanded state) 2026-03-20 23:41:20 -07:00
haikdc 37e5d7b0d9 [Haik]: fixed dashboard lag on drag for both cards and linkages 2026-03-20 23:11:55 -07:00
haikdc 9f8526ffb2 [Haik]: linkages between agents/browser now start/end from the closest sides between the two 2026-03-20 22:57:52 -07:00
haikdc 9f1a322fed [Haik]: if an agent creates multiple browsers, now they stack vertically the same way spawned sub agents do 2026-03-20 22:51:28 -07:00
haikdc 99695253ea [Haik]: round 1 of browser use animations (glowing links) (auto spawn in position set) 2026-03-20 22:44:50 -07:00
haikdc c8b2726ec7 [Haik]: fixed dashboard z index ordering so most recently clicked card is always on top 2026-03-20 22:31:21 -07:00
haikdc 7df846af20 [Haik]: CreateBrowserAgent now spawns in the browser to the right of whatever agent created it (like subagents spawn in) 2026-03-20 22:18:38 -07:00
haikdc 3f37ad8847 [Haik]: browser agent issues fixed (e.g. stopping it via parent or sub agent acc stops it now) (the lil browser agent modal properly shows up when a browser is reinvoked) 2026-03-20 21:54:46 -07:00
haikdc c0afabb964 [Haik]: (moved logo out of island) (fixed notification derefrencing issues when u swap dashboards) (fixed chat header update issue where itd get stuck in the completed state) 2026-03-20 21:37:27 -07:00
haikdc a8aff60bca [Haik]: (fixed auto spawn glitch on reload) (also swapped notification ui to be a floating island) 2026-03-20 20:00:44 -07:00
ciregenzandClaude Opus 4.6 f6274d225f Merge haik/updates-v1 — resolve settings model conflict
Keep both telephony credentials and dashboard UI preferences.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 16:44:40 -07:00
haikdc 03c1cb1c91 [Haik]: ckpt, auto spawn sub agent feature done and toggleable via settings 2026-03-20 12:25:49 -07:00
ciregenz da6c2c305e [eric] cute is law, communication is law 2026-03-19 17:15:18 -07:00
haikdc 6dcfb19b17 [Haik]: ckpt, view builder saving issue fixed via templates, system prompts, and skills. Also added a reset to default for modes. 2026-03-19 01:58:20 -07:00
haikdc 9943ccafd5 [Haik]: (Agent browser render size matches that of user browser spawn) (queing messages) (chat loading bubble fix) (tethers to sub agents and branches are now permament and inputs are swapped to a continue chat button) (auto focus for everything) (history card position fix when redeployed) (dashboard persistance fixed) (non browser link clicks open in the in app browser now) (chat message tooltips for copy, branching, and editing / swapping between edited messages) 2026-03-18 23:45:54 -07:00
ciregenz 1b90adb58b [eric] very cute little dude 2026-03-18 19:14:20 -07:00
haikdc a1138a1782 [Haik]: (ability to resume chats if force end early) (agent selection actually works as advertised) (browser control/creation tool isolation) (in dev mode can see the action input schema) 2026-03-18 14:19:42 -07:00
haikdc a6a2c68115 [Haik]: ckpt, (view sidebar clicks fixed) (view back button removed) (backspace/delete to remove items from dash) (copy/paste items in dash) (Swapping between branches in chat) (Per message tool tips in chat) (chat branching support and some cool ahhh anims) (auto deselect items on toolbar collapse) (if exit selection mode, items get deselected) (item selections only populate focused chat input as context instead of all chat inputs) (swapped right and left mouse clicks to match that of other softwares) 2026-03-18 07:40:02 -07:00
haikdc 78552982d8 [Haik]: ckpt (input focus persistance in select mode) (can set default spawn in state of a card from expanded to collapsed in settings) (Settings update notification is more in ur face now - to be tested in prod) 2026-03-18 04:09:39 -07:00
haikdc f8c2fc38b8 [Haik]: ckpt (right click in dash triggers marquee drag) (if click enter while a single agent card is selected in dash -> triggers expand/collapse) (also btw that g workspace issue still exists in prod) 2026-03-18 02:55:21 -07:00
haikdc dfa87389ba [Haik]: (cmd+scroll zoom works over browsers) (single clicking a selected item deselects it) (All browser actions have user permissions that r functional blocks) 2026-03-18 02:25:31 -07:00
haikdc b937003a24 [Haik]: ckpt (builtin tool call permissions are now functional) (when card is selected in dash hover scroll still works) (notification ui now shows actively running agents too - with the ability to stop them too) (agent card with is persistent post auto layout) (gworkspace discovery func works in prod now - to be tested in prod) (stable release naming for files so most recent version has fixed release link - to be tested in prod) 2026-03-18 01:48:53 -07:00
haikdc 6e1fc1dee2 [Haik]: ckpt (Round 1 of fixing mcp server issues in prod - still has bugs) (Fixed some browser related issues like popup windows rendering out of app and weird js framework related errors when u open sites like spotify) (Added option in settings to toggle item selection to be on by default when selecting a new chat) (Browser agent actions now show up in chat output) (Browser agent actions each have their own custom icon) 2026-03-17 23:52:20 -07:00
haikdc 6f02daff2d [Haik]: (Browser actions shown in agent card output) (User can have item selection turned on by default in settings) (most browser related functionality works - altho spotify is tricky) (mcp discovery in prod shld worke now?) 2026-03-17 01:48:50 -07:00
haikdcandGitHub a6f1738adc Merge pull request #3 from openswarm-ai/haik/updates-v1
Haik/updates v1
v1.0.9 v1.0.8 v1.0.7 v1.0.6 v1.0.5 v1.0.4 v1.0.10 v1.0.11
2026-03-16 05:43:52 -07:00
haikdc 99f741c453 [Haik]: gn 2026-03-16 05:42:40 -07:00