fix(sessions): use entities query for list — hybridSearch requires project arg
CI / CI (pull_request) Successful in 2m10s
CI / CI (pull_request) Successful in 2m10s
hybridSearch mandates a project scope, but sessions scatter across per-session projects (session-<uuid>). The entities query accepts optional project — omit it to list SESSION entities across all projects. Also adds projectId to the list response so callers can scope follow-up queries to the right session project. Fixes: GET X-Service:sessions X-Resource:sessions returning 502
This commit is contained in:
@@ -180,9 +180,12 @@ func (h *Handler) handleList(w http.ResponseWriter, r *http.Request) {
|
||||
searchQuery = fmt.Sprintf("%s cwd:%s", searchQuery, cwd)
|
||||
}
|
||||
|
||||
// entities query (not hybridSearch) — project arg is optional, so it queries
|
||||
// across ALL projects. Required because each session lives in its own
|
||||
// session-<uuid> project; there is no single project to hybridSearch against.
|
||||
gqlQuery := `query($q:String!,$limit:Int!){
|
||||
hybridSearch(query:$q,limit:$limit,entityType:SESSION){
|
||||
entities{id name summary tCreated}
|
||||
entities(query:$q,limit:$limit,entityType:SESSION){
|
||||
entities{id name summary projectId tCreated}
|
||||
searchMode
|
||||
}
|
||||
}`
|
||||
|
||||
Reference in New Issue
Block a user