Skip to content

Vercel Voice Agents PR#324

Open
CoderOMaster wants to merge 5 commits into
mainfrom
vercel-ai
Open

Vercel Voice Agents PR#324
CoderOMaster wants to merge 5 commits into
mainfrom
vercel-ai

Conversation

@CoderOMaster

Copy link
Copy Markdown
Contributor

Voice agents with vercel ai sdk package.

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codex review

The PR adds a Vercel voice-agent cookbook, but the new runtime route and CI/package metadata introduce regressions that can break the demo or future merges/releases.

Findings not on changed lines:

  • .github/workflows/ci.yml:133 BLOCKING ```yaml
    node-version: '20'
This PR deletes `.github/workflows/python-test.yml`, whose deleted comment says the branch ruleset still requires a `python-test` status check, but no replacement `python-test` job is added here. After merge, protected branches can wait forever for a check no workflow emits. Restore that workflow or add a job named exactly `python-test` before removing the shim.
- `packages/vercel-sdk/package.json:35` **BLOCKING** ```json
"ai": "^6.0.0"

The PR adds an AI SDK 7 cookbook (examples/cookbook/vercel-voice-agent uses ai@^7 and @moss-tools/vercel-sdk@^0.1.1) while rolling this package metadata back to 0.1.0 and dropping the AI7 peer/test matrix. A release from this state either tries to publish/tag an older version or produces a local package that cannot satisfy the new AI7 consumer. Keep the version monotonic, for example 0.1.2, and restore "ai": "^6.0.0 || ^7.0.0" plus the Node22/AI7 CI case, or move the cookbook to AI6-compatible dependencies.

Comment thread examples/cookbook/vercel-voice-agent/app/api/token/route.ts
Comment thread examples/cookbook/vercel-voice-agent/package.json
Comment thread examples/cookbook/vercel-voice-agent/app/page.tsx Outdated
// Storing the promise means search requests block until ready, or fail fast if it rejects.
const indexReady = client.loadIndex(process.env.MOSS_INDEX_NAME!)
.then(() => console.log('[MOSS] index loaded locally'))
.catch((err: unknown) => { console.error('[MOSS] loadIndex failed:', err); throw err; });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKING ```ts
.catch((err: unknown) => { console.error('[MOSS] loadIndex failed:', err); throw err; });

`indexReady` is created at module load, so if `loadIndex()` rejects before any search request awaits it, this rethrow leaves the stored promise rejected without a handler and can terminate the Node/Next process instead of returning the intended 503. Keep the startup promise fulfilled with status, then branch in the handler:
```ts
const indexReady = client.loadIndex(indexName)
  .then(() => true)
  .catch((err) => { console.error('[MOSS] loadIndex failed:', err); return false; });

if (!(await indexReady)) return new Response('Search index unavailable', { status: 503 });

headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ query, topK: topK ?? 5 }),
});
const text = await res.text();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONSIDER ```ts
const text = await res.text();

`/api/token` deliberately returns non-2xx responses for auth and index-load failures, but this handler treats every response body as a successful tool result and returns it to the model. Check `res.ok` before counting hits or returning text so the UI surfaces failures instead of letting the assistant answer from `Unauthorized`, `Search index unavailable`, or an HTML error page:
```ts
if (!res.ok) {
  const message = await res.text();
  setError(message || `Search failed (${res.status})`);
  throw new Error(message || `Search failed (${res.status})`);
}
const text = await res.text();

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.

1 participant