Skip to content

Commit 4e43f67

Browse files
committed
Updates
1 parent b6f3cce commit 4e43f67

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

apps/sim/app/api/mothership/execute/route.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,24 @@ describe('mothership private trace provenance transport', () => {
194194
)
195195
})
196196

197+
it('omits an absent response format from the headless lifecycle payload', async () => {
198+
mockRunHeadlessCopilotLifecycle.mockImplementation(async (payload: Record<string, unknown>) => {
199+
expect(payload).not.toHaveProperty('responseFormat')
200+
return successResult()
201+
})
202+
203+
const response = await POST(
204+
createMockRequest(
205+
'POST',
206+
requestBody,
207+
{ Authorization: 'Bearer internal', 'x-sim-billing-attribution': 'billing' },
208+
'http://localhost:3000/api/mothership/execute'
209+
)
210+
)
211+
212+
expect(response.status).toBe(200)
213+
})
214+
197215
it('keeps preprocessing inputs raw and delegates model projection to the lifecycle boundary', async () => {
198216
mockRunHeadlessCopilotLifecycle.mockImplementation(async (payload: Record<string, unknown>) => {
199217
expect(JSON.stringify(payload)).toContain('secret-value __var_FOREIGN')

apps/sim/app/api/mothership/execute/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export const POST = withRouteHandler(async (req: NextRequest) => {
277277
])
278278
const requestPayload: Record<string, unknown> = {
279279
messages,
280-
responseFormat,
280+
...(responseFormat !== undefined ? { responseFormat } : {}),
281281
userId,
282282
// Go's auth middleware reads workspaceId off the request body to forward
283283
// to /api/copilot/api-keys/validate (per-member org usage gate). Omitting

bun.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)