Reflect done tool schema emits unbounded maxItems for cited-id fields; local grammar engines reject it
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
Start in engine/reflect/agent.py and read _with_cited_handles, which sets maxItems on the done tool's cited ID fields. Check how the schema is built for large handle lists and how the existing tests cover those fields. Done means a retrieval with more than 256 handles no longer produces a schema rejected by the reported local grammar engine, while cited IDs remain constrained.
Written by the indexing model from the issue text.
Description
Since #6164 removed the llm_supports_max_items gate, _with_cited_handles in engine/reflect/agent.py always sets "maxItems": len(handles) on the done tool's cited-id fields (e.g. memory_ids). The comment says providers that reject the keyword strip it themselves. That holds for Anthropic, but not for OpenAI-compatible local servers that compile the schema into a constrained-decoding grammar and refuse it above a size limit.
With a large retrieval, the reflect request fails at the done step. Example from 1.2.1 against a local OpenAI-compatible server (Splash/oMLX):
HTTP 400: unsupported output schema: maxItems 983 at #/properties/memory_ids is above 256, the largest the output grammar enforces
The reflect then falls through to the fallback provider. In our case it also completed via split synthesis, but the primary local model never gets the final step once a bank is large enough. It happens on every run where retrieval yields more than 256 handles, so it grows with the bank.
Suggested fix (either):
- Clamp the bound:
"maxItems": min(len(handles), MAX_CITED_IDS)with a configurable cap (default 256). No realistic answer cites more than that, and theenumstill constrains values. - Or restore a per-provider switch to omit
maxItems.
We're running the clamp as a local one-line patch and it resolves the 400.
Environment: hindsight 1.2.1 (ghcr image), provider openai pointed at a local OpenAI-compatible endpoint with structured-output grammar enforcement.
- Dominant language
- Python
- Stars
- 45.2k
- Forks
- 5.9k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vectorize-io/hindsight
-
Control Plane shows different calendar dates for the same occurrence in Constellation and TimelineOpencore
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
vectorize-io/hindsight#7240 · 1 comment ·
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vectorize-io/hindsight#7233 ·
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
vectorize-io/hindsight#7231 ·
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
vectorize-io/hindsight#7228 · 1 comment ·
-
test-embed-windows: test_ui_that_never_answers_hits_the_cap_and_is_terminated fails on WindowsMay be free again A pull request for this issue was closed without being merged. Opencore
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
vectorize-io/hindsight#7196 ·
All issues in vectorize-io/hindsight
Similar issues
-
docs(contributing): the two things that silently block a PRPossibly taken A pull request linked to this issue is open or already merged. Openavailable documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Nixitov/Riptide-Native#944 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
JTHCode/secretguard#24 ·
Maintainers usually reply within 1 day
-
area: middleware documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainers usually reply within 1 day