Default retrieval to 6 chunks instead of 2

chunks is a total per request, split across the attached sources, so an
agent with two sources and the default of 2 got a single chunk from each,
and its answers changed with whichever chunk won. 6 gives three per
source for about 4-5k more input tokens per retrieval turn.

Every literal default moves from 2 to 6: the request default, the
retrievers, the internal search tool, workflow agent nodes, scheduled and
headless runs, agent create/update/import, the source retrieval config and
the frontend forms. Existing agents and sources keep what they store; a
source saved with chunks=2 now counts as configured at 2, which is pinned
by a test.

Headless runs also read chunks=0 as unset (`or 2`), so an agent with
retrieval switched off retrieved anyway on scheduled runs; 0 now stays 0.
This commit is contained in:
arc53-machine committed 2026-09-28 14:34:50 +01:00
1 parent 1c19ed8ce2
commit ab3dbfa1be
33 files changed
+187 -46

No files matched your search

+14
View File
@@ -176,6 +176,20 @@ def test_import_by_slug_idempotent(pg_conn):
assert len(AgentsRepository(pg_conn).list_for_user(user)) == 1
def test_import_without_chunks_uses_the_default(pg_conn):
user = "u_default_chunks"
result = apply_import(pg_conn, user, _doc(name="Plain Bot", _slug="plain-bot"))
agent = AgentsRepository(pg_conn).get(result["agent_id"], user)
assert agent["chunks"] == 6
def test_import_keeps_explicit_chunks(pg_conn):
user = "u_explicit_chunks"
result = apply_import(pg_conn, user, _doc(name="Off Bot", _slug="off-bot", chunks=0))
agent = AgentsRepository(pg_conn).get(result["agent_id"], user)
assert agent["chunks"] == 0
def test_import_missing_source_drafts_and_warns(pg_conn):
user = "u_missing"
doc = _doc(