Skip to content

Commit d55e4ff

Browse files
authored
Merge pull request #564 from Merit-Systems/master
[Release] Hotfix - OpenRouter auto negative pricing
2 parents 2fbe8c1 + ca3ea92 commit d55e4ff

89 files changed

Lines changed: 2953 additions & 1232 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Provider Smoke Tests
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- 'packages/tests/provider-smoke/**'
8+
- 'packages/sdk/ts/**'
9+
- 'packages/app/server/**'
10+
- 'packages/app/control/**'
11+
- '.github/workflows/provider-smoke-tests.yml'
12+
13+
jobs:
14+
provider-smoke-tests:
15+
name: Run Provider Smoke Tests
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 40
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Install pnpm
24+
run: npm install -g pnpm
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '20'
30+
cache: 'pnpm'
31+
32+
- name: Install workspace dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Wait for Railway Deployment
36+
env:
37+
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
38+
run: |
39+
echo "Installing Railway CLI..."
40+
npm install -g @railway/cli
41+
42+
echo "Waiting for Railway deployment to complete..."
43+
railway status --service echo --environment staging || echo "Service status check failed, continuing..."
44+
45+
echo "Waiting for deployment to be ready..."
46+
max_attempts=90
47+
attempt=0
48+
while [ $attempt -lt $max_attempts ]; do
49+
if curl -f -s -o /dev/null https://echo-staging.up.railway.app/health 2>/dev/null; then
50+
echo "Deployment is ready!"
51+
break
52+
fi
53+
attempt=$((attempt + 1))
54+
echo "Attempt $attempt/$max_attempts: Deployment not ready yet, waiting 10 seconds..."
55+
sleep 10
56+
done
57+
58+
if [ $attempt -eq $max_attempts ]; then
59+
echo "Deployment did not become ready in time (waited 15 minutes)"
60+
exit 1
61+
fi
62+
63+
- name: Run Provider Smoke Tests
64+
working-directory: ./packages/tests/provider-smoke
65+
env:
66+
ECHO_DATA_SERVER_URL: https://echo-staging.up.railway.app/
67+
ECHO_API_KEY: ${{ secrets.ECHO_API_KEY }}
68+
ECHO_APP_ID: a4e9b928-cac0-4952-9b4e-3be01aaff45b
69+
run: pnpm run test

Dockerfile.railway

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ COPY packages/sdk/component-registry/ ./packages/sdk/component-registry/
9191
WORKDIR /app
9292
RUN pnpm install
9393

94+
# Build SDK first to ensure latest version is used
95+
WORKDIR /app
96+
RUN pnpm exec turbo run build --filter=@merit-systems/echo-typescript-sdk
97+
9498
# Build only what's needed for the server
9599
WORKDIR /app
96100
RUN SKIP_ENV_VALIDATION=true pnpm exec turbo run build --filter=echo-server
@@ -103,7 +107,7 @@ WORKDIR /app/packages/app/server
103107
RUN pnpm run copy-prisma
104108

105109
# Step 4: Install production dependencies only
106-
RUN pnpm install
110+
RUN pnpm install --prod
107111

108112
# Expose the port that echo-server runs on
109113
EXPOSE 3069

packages/app/control/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"predev": "docker-compose -f docker-local-db.yml up -d && sleep 3 && prisma generate && prisma migrate deploy",
6+
"predev": "docker compose -f docker-local-db.yml up -d && sleep 3 && prisma generate && prisma migrate deploy",
77
"dev": "next dev --turbopack",
88
"prebuild": "prisma generate",
99
"build": "next build",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
-- CreateTable
2+
CREATE TABLE "video_generation_x402" (
3+
"videoId" TEXT NOT NULL,
4+
"wallet" TEXT,
5+
"userId" UUID,
6+
"echoAppId" UUID,
7+
"cost" DECIMAL(65,30) NOT NULL,
8+
"createdAt" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
9+
"expiresAt" TIMESTAMPTZ(6) NOT NULL,
10+
"isFinal" BOOLEAN NOT NULL DEFAULT false,
11+
12+
CONSTRAINT "video_generation_x402_pkey" PRIMARY KEY ("videoId")
13+
);
14+
15+
-- AddForeignKey
16+
ALTER TABLE "video_generation_x402" ADD CONSTRAINT "video_generation_x402_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
17+
18+
-- AddForeignKey
19+
ALTER TABLE "video_generation_x402" ADD CONSTRAINT "video_generation_x402_echoAppId_fkey" FOREIGN KEY ("echoAppId") REFERENCES "echo_apps"("id") ON DELETE CASCADE ON UPDATE CASCADE;

packages/app/control/prisma/schema.prisma

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ model User {
4040
latestFreeCreditsVersion Decimal?
4141
OutboundEmailSent OutboundEmailSent[]
4242
creditGrantCodeUsages CreditGrantCodeUsage[]
43+
VideoGenerationX402 VideoGenerationX402[]
4344
4445
@@map("users")
4546
}
@@ -107,6 +108,7 @@ model EchoApp {
107108
appSessions AppSession[]
108109
payouts Payout[]
109110
OutboundEmailSent OutboundEmailSent[]
111+
VideoGenerationX402 VideoGenerationX402[]
110112
111113
@@map("echo_apps")
112114
}
@@ -489,3 +491,18 @@ model OutboundEmailSent {
489491
@@index([emailCampaignId])
490492
@@map("outbound_emails_sent")
491493
}
494+
495+
model VideoGenerationX402 {
496+
videoId String @id
497+
wallet String?
498+
userId String? @db.Uuid
499+
echoAppId String? @db.Uuid
500+
cost Decimal
501+
createdAt DateTime @default(now()) @db.Timestamptz(6)
502+
expiresAt DateTime @db.Timestamptz(6)
503+
isFinal Boolean @default(false)
504+
505+
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
506+
echoApp EchoApp? @relation(fields: [echoAppId], references: [id], onDelete: Cascade)
507+
@@map("video_generation_x402")
508+
}

packages/app/server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"dependencies": {
4444
"@coinbase/cdp-sdk": "^1.34.0",
4545
"@coinbase/x402": "^0.6.5",
46+
"@e2b/code-interpreter": "^2.0.1",
4647
"@google-cloud/storage": "^7.17.1",
4748
"@google/genai": "^1.20.0",
4849
"@merit-systems/echo-typescript-sdk": "workspace:*",

0 commit comments

Comments
 (0)