YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
Fix Studio GPT-Live voice through the existing backend gateway (#7036)
Louis Beaumont10797b946432
diff --git a/.github/workflows/deploy-ai-gateway.yml b/.github/workflows/deploy-ai-gateway.ymlindex e6c336c88..b8dfea4b2 100644--- a/.github/workflows/deploy-ai-gateway.yml+++ b/.github/workflows/deploy-ai-gateway.yml@@ -32,6 +32,8 @@ on:required: truetype: choiceoptions:+ - inspect+ - probe- upload- promotecandidate_version:@@ -162,3 +164,36 @@ jobs:--yes \--message "manual hosted-AI rollout ${CANDIDATE_VERSION} at ${ROLLOUT_PERCENTAGE}%"fi++ inspect:+ if: ${{ inputs.operation == 'inspect' }}+ runs-on: ubuntu-latest+ timeout-minutes: 5+ steps:+ - uses: actions/checkout@v4+ - name: Inspect voice provider access and gateway bindings+ env:+ CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}+ CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}+ run: python3 packages/ai-gateway/scripts/inspect-studio-voice.py++ probe:+ if: ${{ inputs.operation == 'probe' }}+ runs-on: ubuntu-latest+ timeout-minutes: 8+ defaults:+ run:+ working-directory: packages/ai-gateway+ steps:+ - uses: actions/checkout@v4+ - uses: oven-sh/setup-bun@v2+ with:+ bun-version: "1.3.10"+ - run: bun install --frozen-lockfile+ - run: python3 -m pip install aiortc==1.14.0 aiohttp==3.13.3+ - name: Probe synthetic voice in isolated remote dev session+ env:+ CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}+ CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}+ run: python3 scripts/probe-studio-voice.pydiff --git a/packages/ai-gateway/scripts/inspect-studio-voice.py b/packages/ai-gateway/scripts/inspect-studio-voice.pynew file mode 100644index 000000000..169aa6ec6--- /dev/null+++ b/packages/ai-gateway/scripts/inspect-studio-voice.py@@ -0,0 +1,63 @@+# screenpipe — AI that knows everything you've seen, said, or heard+# https://screenpipe.com+"""Read-only provider/binding inspection. Credentials and response bodies never leave memory."""+import json, os, urllib.request, urllib.error, re++def request(url, token, body=None, headers=None):+ request = urllib.request.Request(url, headers={"Authorization": "Bearer " + token, "Content-Type": "application/json", **(headers or {})}, data=json.dumps(body).encode() if body is not None else None)+ try:+ with urllib.request.urlopen(request, timeout=20) as response:+ return response.status, json.load(response)+ except urllib.error.HTTPError as error:+ try: payload = json.loads(error.read(65536))+ except Exception: payload = {}+ return error.code, payload++def summary(status, payload):+ error = payload.get('error', {}) if isinstance(payload, dict) else {}+ if not isinstance(error, dict): error = {}+ code = error.get('code')+ message = str(error.get('message', '')).lower()+ category = next((label for needle, label in [('sdp','sdp_validation'),('endpoint','endpoint'),('api key','credential'),('not supported','unsupported'),('permission','permission')] if needle in message), None)+ return {'status': status, 'code': code if isinstance(code,str) and re.fullmatch('[a-zA-Z0-9_]{1,80}',code) else None, 'category':category}++account = os.environ['CLOUDFLARE_ACCOUNT_ID']+cf_token = os.environ['CLOUDFLARE_API_TOKEN']+base = f'https://api.cloudflare.com/client/v4/accounts/{account}/workers/scripts/ai-proxy'+status, settings = request(base+'/settings', cf_token)+print('worker_settings',status)+bindings = settings.get('result',{}).get('bindings',[]) if status==200 else []+print('credential_bindings', json.dumps([b['name'] for b in bindings if b.get('name') in ['OPENAI_API_KEY','ADMIN_SECRET','AI_GATEWAY_SERVICE_TOKEN','CLOUDFLARE_AI_GATEWAY_TOKEN']]))+values={b.get('name'):b.get('text') for b in bindings if b.get('type')=='plain_text'}+gateway = values.get('CLOUDFLARE_AI_GATEWAY_ID')+release=values.get('SENTRY_RELEASE','')+print('deployed_source_release',release if re.fullmatch(r'[a-zA-Z0-9_.@/-]{1,100}',release) else 'unavailable')+print('gateway_binding_types',json.dumps([{k:b.get(k) for k in ('name','type')} for b in bindings if 'GATEWAY' in b.get('name','')]))+if not gateway:+ status, listed = request(f'https://api.cloudflare.com/client/v4/accounts/{account}/ai-gateway/gateways', cf_token)+ print('gateway_list_status',status)+ candidates = listed.get('result',[]) if status==200 else []+ print('gateway_count',len(candidates))+ if len(candidates)==1: gateway=candidates[0].get('id')+print('cloudflare_gateway_configured',bool(gateway))+status, deployments=request(base+'/deployments',cf_token)+if status==200:+ for deployment in deployments.get('result',{}).get('deployments',[])[:1]:+ print('current_versions',json.dumps(deployment.get('versions',[])))+ for version in deployment.get('versions',[]):+ vs, details = request(base+'/versions/'+version['version_id'],cf_token)+ print('version_annotations',json.dumps(details.get('result',{}).get('annotations',{})))+key = os.environ.get('OPENAI_API_KEY','')+if key:+ status, result=request('https://api.openai.com/v1/models/gpt-live-1',key)+ print('openai_live_model',json.dumps(summary(status,result)))+else: print('openai_repository_key_present',False)+# A malformed SDP is a bounded endpoint probe, never a conversation or recording.+if gateway:+ url=f'https://gateway.ai.cloudflare.com/v1/{account}/{gateway}/openai/live/sessions'+ status,result=request(url,cf_token,{'session':{'model':'gpt-live-1','store':False,'delegation':{'type':'client'}},'transport':{'type':'webrtc','sdp':'invalid-synthetic-sdp'}}, {'cf-aig-authorization':'Bearer '+cf_token,'cf-aig-byok-alias':'default','cf-aig-collect-log-payload':'false','cf-aig-max-attempts':'1'})+ print('cloudflare_live_endpoint',json.dumps(summary(status,result)))+ session_id=result.get('session',{}).get('id') if isinstance(result,dict) else None+ if status in (200,201) and isinstance(session_id,str) and re.fullmatch('[a-zA-Z0-9_-]{1,200}',session_id):+ cleanup,_=request(url+'/'+session_id+'/hangup',cf_token,{}, {'cf-aig-authorization':'Bearer '+cf_token,'cf-aig-byok-alias':'default','cf-aig-collect-log-payload':'false'})+ print('unexpected_session_cleanup_status',cleanup)diff --git a/packages/ai-gateway/scripts/probe-studio-voice.py b/packages/ai-gateway/scripts/probe-studio-voice.pynew file mode 100644index 000000000..3b36a0158--- /dev/null+++ b/packages/ai-gateway/scripts/probe-studio-voice.py@@ -0,0 +1,81 @@+# screenpipe — AI that knows everything you've seen, said, or heard+# https://screenpipe.com+"""Bounded synthetic WebRTC probe against an isolated remote development session."""+import asyncio, json, os, secrets, subprocess, signal, urllib.request, urllib.error, time, tempfile+from aiortc import RTCPeerConnection, RTCSessionDescription, AudioStreamTrack+import aiohttp++async def main():+ token = secrets.token_urlsafe(32)+ print('::add-mask::'+token, flush=True)+ # Override only this temporary dev session; production secrets and traffic are unchanged.+ with tempfile.TemporaryFile(mode='w+') as logs:+ process = subprocess.Popen(['bunx','wrangler','dev','--remote','--ip','127.0.0.1','--port','8791','--var','ADMIN_SECRET:'+token,'--log-level','error','--show-interactive-dev-session','false'], stdout=logs, stderr=logs, start_new_session=True)+ pc = RTCPeerConnection()+ call_id = None+ try:+ async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=25)) as http:+ for _ in range(60):+ try:+ async with http.get('http://127.0.0.1:8791/test') as response:+ if response.status == 200: break+ except Exception: pass+ if process.poll() is not None: raise RuntimeError('remote_dev_exited')+ await asyncio.sleep(1)+ else: raise RuntimeError('remote_dev_timeout')+ pc.addTrack(AudioStreamTrack()) # Synthetic silence; no device capture.+ channel = pc.createDataChannel('oai-events')+ started = asyncio.Event()+ spoken = asyncio.Event()+ captioned = asyncio.Event()+ receivers = []+ @pc.on('track')+ def track(track):+ async def receive():+ while True:+ frame = await track.recv()+ if started.is_set() and any(any(bytes(plane)[:frame.samples * frame.format.bytes * (1 if frame.format.is_planar else len(frame.layout.channels))]) for plane in frame.planes): spoken.set()+ receivers.append(asyncio.create_task(receive()))+ @channel.on('message')+ def message(data):+ try:+ event=json.loads(data)+ if event.get('type') == 'session.started': started.set()+ if event.get('type') == 'session.output_transcript.delta' and event.get('delta'): captioned.set()+ except Exception: pass+ await pc.setLocalDescription(await pc.createOffer())+ headers={'Authorization':'Bearer '+token,'OpenAI-Safety-Identifier':'a'*64}+ payload={'session':{'model':'gpt-live-1','store':False,'delegation':{'type':'client'},'instructions':'Synthetic connectivity check. Speak the status received from client commentary briefly, then wait.'},'transport':{'type':'webrtc','sdp':pc.localDescription.sdp}}+ async with http.post('http://127.0.0.1:8791/v1/admin/studio-voice',headers=headers,json=payload) as response:+ result=await response.json()+ print('live_create_status',response.status,flush=True)+ if response.status != 201:+ print('safe_error',json.dumps(result.get('error',{})),flush=True)+ raise RuntimeError('live_create_failed')+ call_id=result['session']['id']+ await pc.setRemoteDescription(RTCSessionDescription(sdp=result['transport']['sdp'],type='answer'))+ await asyncio.wait_for(started.wait(),30)+ print('live_session_started',True,flush=True)+ channel.send(json.dumps({'type':'session.commentary.append','event_id':'synthetic-connectivity-check','delegation_id':None,'content':'Voice connection check complete.'}))+ await asyncio.wait_for(asyncio.gather(spoken.wait(),captioned.wait()),20)+ print('live_spoken_audio_received',True,flush=True)+ for receiver in receivers: receiver.cancel()+ finally:+ await pc.close()+ try:+ if call_id:+ async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=12)) as http:+ async with http.delete('http://127.0.0.1:8791/v1/admin/studio-voice',headers={'Authorization':'Bearer '+token},json={'call_id':call_id}) as response:+ print('live_cleanup_status',response.status,flush=True)+ except Exception:+ print('live_cleanup_failed',True,flush=True)+ if process.poll() is None: os.killpg(process.pid,signal.SIGTERM)+ try: process.wait(timeout=10)+ except subprocess.TimeoutExpired: os.killpg(process.pid,signal.SIGKILL); process.wait()+ logs.seek(0)+ import re+ text=logs.read()+ for status in re.findall(r'\[studio-voice\] Provider rejected connection (\d{3})',text): print('provider_status',status,flush=True)+ print('remote_dev_stopped',process.poll() is not None,flush=True)++asyncio.run(main())diff --git a/packages/ai-gateway/src/handlers/studio-voice.test.ts b/packages/ai-gateway/src/handlers/studio-voice.test.tsnew file mode 100644index 000000000..ab45daef8--- /dev/null+++ b/packages/ai-gateway/src/handlers/studio-voice.test.ts@@ -0,0 +1,51 @@+// screenpipe — AI that knows everything you've seen, said, or heard+// https://screenpipe.com+import { afterEach, describe, expect, test } from 'bun:test';+import { handleStudioVoice } from './studio-voice';+import type { Env } from '../types';+const originalFetch = globalThis.fetch;+const env = { OPENAI_API_KEY: 'synthetic-provider', ADMIN_SECRET: 'synthetic-admin', CLOUDFLARE_AI_GATEWAY_ID: 'synthetic', CLOUDFLARE_AI_GATEWAY_TOKEN: 'synthetic-cf', AI: { gateway: () => ({ getUrl: async () => 'https://gateway.ai.cloudflare.com/v1/account/synthetic/openai' }) } } as unknown as Env;+const body = { session: { model: 'gpt-live-1', store: false, delegation: { type: 'client' }, instructions: 'Synthetic test', tools: [{ type: 'unsafe-tool' }] }, transport: { type: 'webrtc', sdp: 'v=0\r\n' } };+function request(value: unknown = body, auth = 'synthetic-admin', method = 'POST') { return new Request('https://api.screenpi.pe/v1/admin/studio-voice', { method, headers: { Authorization: `Bearer ${auth}`, 'OpenAI-Safety-Identifier': 'a'.repeat(64) }, body: JSON.stringify(value) }); }+afterEach(() => { globalThis.fetch = originalFetch; });+describe('Studio voice gateway', () => {+ test('rejects missing/wrong backend credentials before reaching a provider', async () => {+ let calls = 0; globalThis.fetch = (async () => { calls++; throw new Error(); }) as typeof fetch;+ expect((await handleStudioVoice(request(body, 'wrong'), env)).status).toBe(401);+ expect((await handleStudioVoice(request(), { ...env, ADMIN_SECRET: '' })).status).toBe(401);+ expect(calls).toBe(0);+ });+ test('keeps the provider key in Screenpipe gateway and only forwards reviewed Live fields', async () => {+ globalThis.fetch = (async (url, options) => {+ expect(String(url)).toBe('https://api.openai.com/v1/live/sessions');+ const headers = new Headers(options?.headers);+ expect(headers.get('Authorization')).toBe('Bearer synthetic-provider');+ const outgoing = JSON.parse(String(options?.body));+ expect(outgoing.session.tools).toBeUndefined();+ expect(outgoing.session.model).toBe('gpt-live-1');+ return Response.json({ session: { id: 'live_synthetic', private: 'hidden' }, transport: { type: 'webrtc', sdp: 'v=0\r\n' }, secret: 'hidden' });+ }) as typeof fetch;+ const result = await handleStudioVoice(request(), env);+ expect(result.status).toBe(201); expect(await result.text()).not.toContain('hidden');+ });+ test('rejects unbounded payloads and invalid model, storage, SDP and actor', async () => {+ globalThis.fetch = (async () => { throw new Error('must not fetch'); }) as typeof fetch;+ for (const value of [{ ...body, session: { ...body.session, model: 'other' } }, { ...body, session: { ...body.session, store: true } }, { ...body, session: { ...body.session, instructions: 'x'.repeat(70000) } }, { ...body, transport: { type: 'webrtc', sdp: 'invalid' } }]) expect((await handleStudioVoice(request(value), env)).status).toBe(400);+ const invalid = request(); invalid.headers.delete('OpenAI-Safety-Identifier');+ expect((await handleStudioVoice(invalid, env)).status).toBe(400);+ });+ test('does not retry or expose private provider errors', async () => {+ let calls = 0; globalThis.fetch = (async () => { calls++; return new Response('private error', { status: 429 }); }) as typeof fetch;+ const result = await handleStudioVoice(request(), env);+ expect(result.status).toBe(429); expect(await result.text()).not.toContain('private'); expect(calls).toBe(1);+ });+ test('cleans up a created session when its SDP is malformed', async () => {+ let calls = 0; globalThis.fetch = (async (url) => { calls++; if (calls === 1) return Response.json({ session: { id: 'live_synthetic' }, transport: { type: 'webrtc', sdp: 'invalid' } }); expect(String(url)).toEndWith('/live_synthetic/hangup'); return new Response(null, { status: 200 }); }) as typeof fetch;+ expect((await handleStudioVoice(request(), env)).status).toBe(502); expect(calls).toBe(2);+ });+ test('hangup is restricted to an opaque ID and accepts an already closed session', async () => {+ globalThis.fetch = (async (url, options) => { expect(String(url)).toEndWith('/live/sessions/live_synthetic/hangup'); expect(options?.method).toBe('POST'); return new Response(null, { status: 404 }); }) as typeof fetch;+ expect((await handleStudioVoice(request({ call_id: '../other' }, undefined, 'DELETE'), env)).status).toBe(400);+ expect((await handleStudioVoice(request({ call_id: 'live_synthetic' }, undefined, 'DELETE'), env)).status).toBe(204);+ });+});diff --git a/packages/ai-gateway/src/handlers/studio-voice.ts b/packages/ai-gateway/src/handlers/studio-voice.tsnew file mode 100644index 000000000..3b0557e12--- /dev/null+++ b/packages/ai-gateway/src/handlers/studio-voice.ts@@ -0,0 +1,73 @@+// screenpipe — AI that knows everything you've seen, said, or heard+// https://screenpipe.com++import { timingSafeEqual } from 'node:crypto';+import type { Env } from '../types';++const MAX_BYTES = 65536;+const CALL_ID = /^[a-zA-Z0-9_-]{1,200}$/;+const ACTOR_ID = /^[a-f0-9]{64}$/;+const failure = (status: number, code: string) => Response.json({ error: { code } }, { status, headers: { 'Cache-Control': 'no-store' } });++async function boundedJson(body: ReadableStream<Uint8Array> | null): Promise<any> {+ if (!body) throw new Error('missing body');+ const reader = body.getReader();+ const chunks: Uint8Array[] = [];+ let bytes = 0;+ try {+ while (true) {+ const { value, done } = await reader.read();+ if (done) break;+ bytes += value.length;+ if (bytes > MAX_BYTES) throw new Error('body too large');+ chunks.push(value);+ }+ } finally { await reader.cancel().catch(() => {}); }+ return JSON.parse(Buffer.concat(chunks).toString('utf8'));+}++/** Website-only control plane. Studio checks actor, organization policy, quota and call tickets. */+export async function handleStudioVoice(request: Request, env: Env): Promise<Response> {+ const secret = env.ADMIN_SECRET?.trim();+ const actual = Buffer.from(request.headers.get('Authorization') || '');+ const expected = Buffer.from(`Bearer ${secret || ''}`);+ if (!secret || actual.length !== expected.length || !timingSafeEqual(actual, expected)) return failure(401, 'unauthorized');+ if (request.method !== 'POST' && request.method !== 'DELETE') return failure(405, 'method_not_allowed');+ let body: any;+ try { body = await boundedJson(request.body); } catch { return failure(400, 'invalid_voice_request'); }+ const closing = request.method === 'DELETE';+ const actor = request.headers.get('OpenAI-Safety-Identifier') || '';+ if (closing ? (typeof body?.call_id !== 'string' || !CALL_ID.test(body.call_id)) : (!ACTOR_ID.test(actor) || body?.session?.model !== 'gpt-live-1' || body?.session?.store !== false || body?.session?.delegation?.type !== 'client' || body?.transport?.type !== 'webrtc' || typeof body?.transport?.sdp !== 'string' || !body.transport.sdp.startsWith('v=0') || typeof body?.session?.instructions !== 'string' || body.session.instructions.length > 16000)) return failure(400, 'invalid_voice_request');+ try {+ // Cloudflare's provider-native proxy returns 404 for /live/sessions.+ // Keep Live inside Screenpipe's authenticated gateway, using its existing backend key.+ // Studio enforces six starts/hour and a 120-second call lifetime; never fall back/retry creation.+ if (!env.OPENAI_API_KEY?.trim()) return failure(503, 'voice_provider_not_configured');+ const connection = { baseURL: 'https://api.openai.com/v1' };+ const headers = new Headers({ 'Content-Type': 'application/json', Authorization: `Bearer ${env.OPENAI_API_KEY.trim()}` });+ if (!closing) headers.set('OpenAI-Safety-Identifier', actor);+ // Only reviewed Live fields may reach the provider; never proxy arbitrary tools or URLs.+ const session = closing ? undefined : { model: 'gpt-live-1', store: false, delegation: { type: 'client' }, client: { data_channel: { allowed_client_events: ['session.commentary.append', 'session.thinking.append', 'session.close'] } }, audio: { output: { voice: 'marin' } }, instructions: body.session.instructions };+ const response = await fetch(`${connection.baseURL.replace(/\/$/, '')}/live/sessions${closing ? `/${body.call_id}/hangup` : ''}`, { method: 'POST', headers, body: closing ? undefined : JSON.stringify({ session, transport: { type: 'webrtc', sdp: body.transport.sdp } }), signal: AbortSignal.timeout(closing ? 7000 : 18000) });+ if (closing) {+ await response.body?.cancel().catch(() => {});+ return response.ok || response.status === 404 || response.status === 410 ? new Response(null, { status: 204 }) : failure(502, 'voice_cleanup_failed');+ }+ if (!response.ok) {+ let upstream: any = {};+ try { upstream = await boundedJson(response.body); } catch {}+ const code = upstream?.error?.code;+ return Response.json({ error: { code: 'voice_provider_unavailable', upstream_status: response.status, provider_code: typeof code === 'string' && /^[a-zA-Z0-9_]{1,80}$/.test(code) ? code : undefined } }, { status: response.status === 429 ? 429 : 503, headers: { 'Cache-Control': 'no-store' } });+ }+ const result = await boundedJson(response.body);+ if (typeof result?.session?.id !== 'string' || !CALL_ID.test(result.session.id)) return failure(502, 'voice_invalid_response');+ if (result?.transport?.type !== 'webrtc' || typeof result?.transport?.sdp !== 'string' || !result.transport.sdp.startsWith('v=0')) {+ const cleanup = await fetch(`${connection.baseURL.replace(/\/$/, '')}/live/sessions/${result.session.id}/hangup`, { method: 'POST', headers, signal: AbortSignal.timeout(7000) });+ await cleanup.body?.cancel().catch(() => {});+ return failure(502, 'voice_invalid_response');+ }+ return Response.json({ session: { id: result.session.id }, transport: { type: 'webrtc', sdp: result.transport.sdp } }, { status: 201, headers: { 'Cache-Control': 'no-store' } });+ } catch {+ return failure(503, 'voice_gateway_unavailable');+ }+}diff --git a/packages/ai-gateway/src/index.ts b/packages/ai-gateway/src/index.tsindex 869e6c644..84b979068 100644--- a/packages/ai-gateway/src/index.ts+++ b/packages/ai-gateway/src/index.ts@@ -16,6 +16,7 @@ import {resolveModelGate,} from './services/usage-tracker';import { handleChatCompletions } from './handlers/chat';+import { handleStudioVoice } from './handlers/studio-voice';import { handleModelListing } from './handlers/models';import { handleFileTranscription, handleABTestAdmin } from './handlers/transcription';import { handleRealtimeTranscriptionUpgrade } from './handlers/realtime-transcription';@@ -323,6 +324,9 @@ export async function handleRequest(request: Request, env: Env, ctx: ExecutionCoreturn handleOptions(request);}+ // Dedicated backend credential; never send it to Clerk JWT verification.+ if (path === '/v1/admin/studio-voice') return handleStudioVoice(request, env);+console.log('path', path);// Authenticate and get tier info for all other endpointsdiff --git a/packages/ai-gateway/src/test/astra.unit.test.ts b/packages/ai-gateway/src/test/astra.unit.test.tsindex ba831949c..906120963 100644--- a/packages/ai-gateway/src/test/astra.unit.test.ts+++ b/packages/ai-gateway/src/test/astra.unit.test.ts@@ -196,7 +196,7 @@ describe('Astra access and allowance', () => {const env: any = { OPENAI_API_KEY: 'test', DB: { prepare: () => statement } };const response: any = await (await handleModelListing(env, 'subscribed', false, 'business')).json();const astra = response.data.find((m: any) => m.id === 'gpt-6-astra');- expect(astra).toMatchObject({ name: 'GPT-6 Astra (Low)', query_weight: 10, cost_tier: 'very_high', warning: 'Uses more of your included allowance.' });+ expect(astra).toMatchObject({ name: 'GPT-6 Astra (Low)', query_weight: 0, cost_tier: 'very_high', warning: 'Uses more of your included allowance.' });expect(astra.locked).not.toBe(true);expect(response.data[0].id).toBe('auto');const basic: any = await (await handleModelListing(env, 'logged_in', false, 'basic')).json();