Skip to content

Fix Ably 503 auth error, add live trading page, localStorage draft persistence, owner profiles, CI/CD + Docker - #7

Merged
mesayanroy merged 3 commits into
mainfrom
copilot/fix-ably-auth-token-error
Mar 29, 2026
Merged

Fix Ably 503 auth error, add live trading page, localStorage draft persistence, owner profiles, CI/CD + Docker#7
mesayanroy merged 3 commits into
mainfrom
copilot/fix-ably-auth-token-error

Conversation

Copilot AI commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

Ably was unconditionally attempting a Realtime connection even when ABLY_API_KEY is absent, causing 503 token-request errors to flood the console. Several UX gaps existed (agent builder losing state on navigation, no owner attribution on agent cards). No containerisation or CI pipeline was present.

Ably 503 — graceful degradation

useMarketplaceFeed now probes /api/ably/token before instantiating Ably.Realtime. A non-2xx response sets connectionState: 'unavailable' and returns silently instead of triggering Ably's auth-error retry loop.

const probe = await fetch('/api/ably/token', { method: 'GET' });
if (!probe.ok) { setConnectionState('unavailable'); return; }

AgentBuilder — localStorage draft persistence

Form state + current step persisted to localStorage (agent_builder_draft / agent_builder_step) on every change. Draft is restored on mount with a dismissible banner; cleared on successful deploy.

/trading — live trading page

New page at /trading with:

  • Live price chart (recharts AreaChart, 1500 ms ticks) with breakout resistance/support ReferenceLines, and dynamic TP/SL + liquidation price overlays
  • Order panel — Market/Limit, collateral, leverage (1–10×), TP/SL inputs, agent SDK template selector (triggers 0x402 fee)
  • Open position panel with live unrealised PnL
  • Testnet / Mainnet toggle, TVL display
  • Agent SDK Templates tab — 4 pre-built strategy cards + 0x402 SDK code snippet

Agent owner profiles

AgentCard renders a coloured avatar + clickable truncated owner address linking to their dashboard profile instead of inert plain text.

CI/CD + Docker

  • .github/workflows/ci.ymllint-and-type-checkbuild (artefact upload) → docker-build (main only); all jobs scoped to permissions: contents: read
  • Multi-stage Dockerfile (standalone Next.js runner) + docker-compose.yml (web + optional consumers service)
  • output: 'standalone' added to next.config.mjs

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

@vercel

vercel Bot commented Mar 29, 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 29, 2026 10:26pm

Agent-Logs-Url: https://github.com/mesayanroy/0x402-pubsub/sessions/8e45e2e0-c696-4e98-9a09-ae8b27875079

Co-authored-by: mesayanroy <169074736+mesayanroy@users.noreply.github.com>
… profiles, CI/CD, Docker

Agent-Logs-Url: https://github.com/mesayanroy/0x402-pubsub/sessions/8e45e2e0-c696-4e98-9a09-ae8b27875079

Co-authored-by: mesayanroy <169074736+mesayanroy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Ably token request error and improve payment request protocol Fix Ably 503 auth error, add live trading page, localStorage draft persistence, owner profiles, CI/CD + Docker Mar 29, 2026
Copilot AI requested a review from mesayanroy March 29, 2026 22:27
@mesayanroy
mesayanroy marked this pull request as ready for review March 29, 2026 22:30
@mesayanroy
mesayanroy merged commit 7d8b9c7 into main Mar 29, 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