Skip to content

Commit 44db471

Browse files
authored
fix(graphstore): raise memory provider MaxLimit 100 -> 10000 (#56)
The in-memory GraphStore advertised MaxLimit 100 while the default local.ladybug provider advertises 1000, so a `limit 1000` query that is valid in production was rejected with "query limit exceeds provider capability" whenever the memory provider backs the server (--quickstart, MCP, the demos). Memory has no storage backend, so give it a generous 10000 row ceiling — kept >= the default provider's 1000 so any production-valid limit is also valid here. Row prealloc is already bounded at 1024, so large limits just grow the slice. Adds a regression test. Verified end-to-end: `.entity ... | limit 1000` returns Success on a memory-backed server; limit > 10000 is still rejected.
1 parent 34aca35 commit 44db471

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

internal/graphstore/memory.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,11 @@ func (s *MemoryStore) Capabilities(ctx context.Context) (model.GraphStoreCapabil
256256
TimeVisibility: true,
257257
ServerSideFilter: false,
258258
MaxDepth: 2,
259-
MaxLimit: 100,
260-
Timeout: "10s",
259+
// Memory backs --quickstart / MCP / demos and has no storage backend, so
260+
// it serves a generous row ceiling. Kept >= the default local.ladybug
261+
// provider's 1000 so any production-valid `limit` is also valid here.
262+
MaxLimit: 10000,
263+
Timeout: "10s",
261264
}, nil
262265
}
263266

internal/graphstore/memory_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,18 @@ func relationPayload(src, dest, method string, first, last int64, fields map[str
234234
}
235235
return payload
236236
}
237+
238+
// TestMemoryStoreMaxLimitNotBelowDefaultProvider guards query portability: the
239+
// memory store backs --quickstart / MCP / the demos, so a `limit` valid on the
240+
// default local.ladybug provider (MaxLimit 1000) must not be rejected here.
241+
// Memory itself caps higher (10000, in-memory headroom). Regression for
242+
// "query limit exceeds provider capability" when memory advertised MaxLimit 100.
243+
func TestMemoryStoreMaxLimitNotBelowDefaultProvider(t *testing.T) {
244+
caps, err := NewMemoryStore().Capabilities(context.Background())
245+
if err != nil {
246+
t.Fatalf("capabilities: %v", err)
247+
}
248+
if caps.MaxLimit < 1000 {
249+
t.Fatalf("memory MaxLimit = %d, want >= 1000 so production-valid limits stay portable", caps.MaxLimit)
250+
}
251+
}

0 commit comments

Comments
 (0)