fix(memory): scope memory endpoints to active profile and auto-reload on profile switch (#1035)
Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
1 parent
11dd1eff92
commit
21db9bfdab
4 files changed
+63
-2
No files matched your search
@@ -118,6 +118,19 @@ class ProfileScopeInterceptorTest {
|
||||
assertEquals("alpha", url.queryParameter("profile"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun memoryEndpoints_areScoped() {
|
||||
val client = clientFor("yasmin")
|
||||
for (path in listOf("api/memory", "api/memory/learning-graph", "api/memory/providers/mem0/config")) {
|
||||
server.enqueue(MockResponse().setResponseCode(200).setBody("{}"))
|
||||
val req = Request.Builder().url(server.url(path)).build()
|
||||
client.newCall(req).execute().close()
|
||||
val url = server.takeRequest().requestUrl!!
|
||||
assertEquals("yasmin", url.queryParameter("profile"))
|
||||
assertEquals("/$path", url.encodedPath)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun lookalikePath_notScoped() {
|
||||
// Sourcery review (PR #540): `startsWith` must not match non-segment
|
||||
|
||||
Reference in new issue
Block a user