feat(voice): add managed OpenWork Models sessions#2325
Open
benjaminshafii wants to merge 2 commits into
Open
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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, | ||
| }, | ||
| }), | ||
| }) |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Proof
evals/results/managed-voice-pr-proof/index.htmlnode apps/app/scripts/managed-voice-e2e.mjs --out evals/results/managed-voice-pr-proof.owt_|ow_inf_|Bearer|managed-e2e-client-secret.Tests
pnpm --filter openwork-server test src/env-routes.e2e.test.tspassed: 18 pass, 0 fail.pnpm --filter openwork-server typecheckpassed.pnpm --filter @openwork/app typecheckpassed.pnpm --filter @openwork-ee/inference buildpassed.node apps/app/scripts/managed-voice-e2e.mjs --out evals/results/managed-voice-pr-proofpassed.