File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,7 +72,11 @@ import { CopilotTransport } from '@/lib/mothership/generated/trace-attribute-val
7272import { TraceAttr } from '@/lib/mothership/generated/trace-attributes-v1'
7373import { TraceSpan } from '@/lib/mothership/generated/trace-spans-v1'
7474import { resolveMothershipModelSettings } from '@/lib/mothership/model-options'
75- import { createBadRequestResponse , createUnauthorizedResponse } from '@/lib/mothership/request/http'
75+ import {
76+ createBadRequestResponse ,
77+ createNotFoundResponse ,
78+ createUnauthorizedResponse ,
79+ } from '@/lib/mothership/request/http'
7680import { durableResourceAuthoringVersion } from '@/lib/mothership/request/lifecycle/recovery-config'
7781import { createSSEStream , SSE_RESPONSE_HEADERS } from '@/lib/mothership/request/lifecycle/start'
7882import { startCopilotOtelRoot , withCopilotSpan } from '@/lib/mothership/request/otel'
@@ -643,7 +647,7 @@ async function resolveBranch(params: {
643647 )
644648
645649 if ( workspacePermission === null ) {
646- return createBadRequestResponse ( 'Workspace not found or access denied' )
650+ return createNotFoundResponse ( 'Workspace not found or access denied' )
647651 }
648652
649653 return {
Original file line number Diff line number Diff line change @@ -2334,11 +2334,8 @@ try {
23342334 await composer . fill ( 'QA scoped follow-up' )
23352335 await composer . press ( 'Enter' )
23362336 const refusal = ( await followUp ) . status ( )
2337- // The chat route answers a workspace the sender cannot reach with 400, before any run.
2338- assert (
2339- refusal === 400 || refusal === 403 || refusal === 404 ,
2340- `The follow-up was answered ${ refusal } `
2341- )
2337+ // A workspace the sender cannot reach is not found to them, answered before any run.
2338+ assert . equal ( refusal , 404 , `The follow-up was answered ${ refusal } ` )
23422339 // Refused, not re-scoped: no run under the organization, and the chat keeps its workspace.
23432340 assert . deepEqual ( await runs ( ) , [ { workspaceId : scopedWorkspaceId , organizationId : null } ] )
23442341 const [ chat ] = await sql < { workspaceId : string | null ; organizationId : string | null } [ ] > `
You can’t perform that action at this time.
0 commit comments