Skip to content

feat(voice): add managed OpenWork Models sessions#2325

Open
benjaminshafii wants to merge 2 commits into
devfrom
feat/managed-voice-models
Open

feat(voice): add managed OpenWork Models sessions#2325
benjaminshafii wants to merge 2 commits into
devfrom
feat/managed-voice-models

Conversation

@benjaminshafii

@benjaminshafii benjaminshafii commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Add an OpenWork Models voice broker endpoint to the inference service that authenticates inference keys, checks org buckets, and mints OpenAI Realtime client secrets server-side.
  • Make the local OpenWork server prefer the managed broker when an OpenWork Models key/base URL is configured, while keeping BYO OpenAI fallback.
  • Mirror imported OpenWork Models credentials into the local OpenWork env store so voice is included after provider import.
  • Add script-first managed voice e2e proof with committed redacted HTML frames.

Proof

  • HTML frame proof: evals/results/managed-voice-pr-proof/index.html
  • Frames: server health, owner token creation, managed voice session response, authenticated broker request.
  • Proof files were regenerated by node apps/app/scripts/managed-voice-e2e.mjs --out evals/results/managed-voice-pr-proof.
  • Proof HTML was checked for token/client-secret patterns with no matches for owt_|ow_inf_|Bearer|managed-e2e-client-secret.

Tests

  • pnpm --filter openwork-server test src/env-routes.e2e.test.ts passed: 18 pass, 0 fail.
  • pnpm --filter openwork-server typecheck passed.
  • pnpm --filter @openwork/app typecheck passed.
  • pnpm --filter @openwork-ee/inference build passed.
  • node apps/app/scripts/managed-voice-e2e.mjs --out evals/results/managed-voice-pr-proof passed.

@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
openwork-app Ready Ready Preview, Comment Jun 20, 2026 8:21pm
openwork-den Ready Ready Preview, Comment Jun 20, 2026 8:21pm
openwork-den-worker-proxy Ready Ready Preview, Comment Jun 20, 2026 8:21pm
openwork-landing Ready Ready Preview, Comment, Open in v0 Jun 20, 2026 8:21pm

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

2 issues found and verified against the latest diff

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="ee/apps/inference/src/voice.ts">

<violation number="1" location="ee/apps/inference/src/voice.ts:103">
P2: Unhandled OpenAI network failures can crash this route into generic 500 responses. Wrap the fetch call and return a controlled 502 api_error on connection failures.</violation>
</file>

<file name="evals/results/managed-voice-pr-proof/index.html">

<violation number="1" location="evals/results/managed-voice-pr-proof/index.html:19">
P2: Hardcoded absolute filesystem path in meta output leaks developer info and makes the proof non-portable. The path `/Users/benjaminshafii/...` will not resolve on other machines.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment on lines +103 to +132
const response = await fetch("https://api.openai.com/v1/realtime/client_secrets", {
method: "POST",
headers: {
Authorization: `Bearer ${env.openAiRealtimeApiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
session: {
type: "realtime",
model,
output_modalities: ["audio"],
audio: {
input: {
transcription: { model: OPENWORK_VOICE_TRANSCRIPTION_MODEL, language: "en" },
turn_detection: {
type: "server_vad",
threshold: 0.58,
silence_duration_ms: 320,
prefix_padding_ms: 300,
create_response: true,
interrupt_response: true,
},
},
},
instructions: openworkVoiceRealtimeInstructions(),
tool_choice: "auto",
tools: OPENWORK_VOICE_REALTIME_TOOLS,
},
}),
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Unhandled OpenAI network failures can crash this route into generic 500 responses. Wrap the fetch call and return a controlled 502 api_error on connection failures.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At ee/apps/inference/src/voice.ts, line 103:

<comment>Unhandled OpenAI network failures can crash this route into generic 500 responses. Wrap the fetch call and return a controlled 502 api_error on connection failures.</comment>

<file context>
@@ -0,0 +1,192 @@
+  }
+
+  const model = readStringField(input, "model") || OPENWORK_VOICE_REALTIME_MODEL
+  const response = await fetch("https://api.openai.com/v1/realtime/client_secrets", {
+    method: "POST",
+    headers: {
</file context>
Suggested change
const response = await fetch("https://api.openai.com/v1/realtime/client_secrets", {
method: "POST",
headers: {
Authorization: `Bearer ${env.openAiRealtimeApiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
session: {
type: "realtime",
model,
output_modalities: ["audio"],
audio: {
input: {
transcription: { model: OPENWORK_VOICE_TRANSCRIPTION_MODEL, language: "en" },
turn_detection: {
type: "server_vad",
threshold: 0.58,
silence_duration_ms: 320,
prefix_padding_ms: 300,
create_response: true,
interrupt_response: true,
},
},
},
instructions: openworkVoiceRealtimeInstructions(),
tool_choice: "auto",
tools: OPENWORK_VOICE_REALTIME_TOOLS,
},
}),
})
let response: Response
try {
response = await fetch("https://api.openai.com/v1/realtime/client_secrets", {
method: "POST",
headers: {
Authorization: `Bearer ${env.openAiRealtimeApiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
session: {
type: "realtime",
model,
output_modalities: ["audio"],
audio: {
input: {
transcription: { model: OPENWORK_VOICE_TRANSCRIPTION_MODEL, language: "en" },
turn_detection: {
type: "server_vad",
threshold: 0.58,
silence_duration_ms: 320,
prefix_padding_ms: 300,
create_response: true,
interrupt_response: true,
},
},
},
instructions: openworkVoiceRealtimeInstructions(),
tool_choice: "auto",
tools: OPENWORK_VOICE_REALTIME_TOOLS,
},
}),
})
} catch {
return Response.json({ error: { message: "Failed to reach OpenAI Realtime API.", type: "api_error", code: "openai_realtime_unreachable" } }, { status: 502 })
}

</head>
<body><main>
<h1>Managed Voice E2E Proof</h1>
<div class="meta">Result: <code>passed</code> · Output: <code>/Users/benjaminshafii/openwork-enterprise/_repos/openwork-managed-voice/evals/results/managed-voice-pr-proof</code></div>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Hardcoded absolute filesystem path in meta output leaks developer info and makes the proof non-portable. The path /Users/benjaminshafii/... will not resolve on other machines.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At evals/results/managed-voice-pr-proof/index.html, line 19:

<comment>Hardcoded absolute filesystem path in meta output leaks developer info and makes the proof non-portable. The path `/Users/benjaminshafii/...` will not resolve on other machines.</comment>

<file context>
@@ -0,0 +1,45 @@
+</head>
+<body><main>
+  <h1>Managed Voice E2E Proof</h1>
+  <div class="meta">Result: <code>passed</code> · Output: <code>/Users/benjaminshafii/openwork-enterprise/_repos/openwork-managed-voice/evals/results/managed-voice-pr-proof</code></div>
+
+    <section>
</file context>
Suggested change
<div class="meta">Result: <code>passed</code> · Output: <code>/Users/benjaminshafii/openwork-enterprise/_repos/openwork-managed-voice/evals/results/managed-voice-pr-proof</code></div>
<div class="meta">Result: <code>passed</code> · Output: <code>evals/results/managed-voice-pr-proof</code></div>

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