Skip to content

Fix agent Supabase persistence, streamline nav, add sidebar + workflow page + traders portfolio - #11

Merged
mesayanroy merged 2 commits into
mainfrom
copilot/fix-agent-storage-issue
Mar 30, 2026
Merged

Fix agent Supabase persistence, streamline nav, add sidebar + workflow page + traders portfolio#11
mesayanroy merged 2 commits into
mainfrom
copilot/fix-agent-storage-issue

Conversation

Copilot AI commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Agents were silently falling back to in-memory/file demo storage on every cold start (serverless = ephemeral), causing "Agent Not Found" on any subsequent lookup. OpenAI responses returned demo-mode strings because .env.local didn't exist in the repo clone.

Supabase schema (supabase-schema.sql)

  • All DDL changed to CREATE TABLE IF NOT EXISTS / CREATE INDEX IF NOT EXISTS — idempotent, safe to re-run
  • Dropped FK agents.owner_wallet → users(wallet_address) — this was the root cause; FK violations on serverless (user-upsert races a fresh instance) silently triggered demo fallback
  • Added explicit ALTER TABLE … DISABLE ROW LEVEL SECURITY for all tables so the service-role key works without manual policy setup
  • Action required: apply this SQL in the Supabase SQL editor

Agent create route (app/api/agents/create/route.ts)

  • Removed multi-step user-upsert-before-agent pattern; user upsert is now best-effort with debug logging
  • Single direct agents.insert path; distinguishes permission-denied vs missing-table vs other errors with clear messages

Navigation

  • Navbar reduced to Home / Docs / Devs / About only
  • New Sidebar component with SVG icons: Dashboard, Marketplace, Trading, Own Agents, Build Agent, Workflow
  • New AppShell client wrapper renders sidebar only on app pages (/dashboard, /marketplace, /trading, /agents, /build, /workflow); root layout updated accordingly

Workflow page (app/workflow/page.tsx) — new

  • HTML5 canvas drawing studio: pen, eraser, text, rect/circle/triangle shapes, color palette, stroke-width slider, undo/redo
  • File upload for diagram attachments passed to agents
  • Task queue planner with sequential Run; 0x402 payment-gate banner fires every 2 completed tasks requiring wallet signature approval
  • Wallet-gated: shows connect prompt when no Freighter wallet present

Dashboard traders portfolio (app/dashboard/page.tsx)

  • New Traders Portfolio section: summary cards (total profit XLM/USD, paid trades, avg per trade), per-transaction table (agent/strategy, model badge, P&L, Stellar explorer link), live Ably feed strip for incoming trades

@vercel

vercel Bot commented Mar 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
0x402-pubsub Ready Ready Preview, Comment Mar 30, 2026 9:27pm

…page, traders portfolio

Agent-Logs-Url: https://github.com/mesayanroy/0x402-pubsub/sessions/0728ad74-e099-44a9-9134-39bab6e05f8c

Co-authored-by: mesayanroy <169074736+mesayanroy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix agent storage issue in database and update dashboard Fix agent Supabase persistence, streamline nav, add sidebar + workflow page + traders portfolio Mar 30, 2026
Copilot AI requested a review from mesayanroy March 30, 2026 21:28
@mesayanroy
mesayanroy marked this pull request as ready for review March 30, 2026 23:12
@mesayanroy
mesayanroy merged commit edfbd9e into main Mar 30, 2026
8 checks passed
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.

2 participants