Summary
With PIPELINE_MODE=accurate, every ingest_data Celery task raises before observations are saved and the task is marked FAILURE. The ingestion task calls observe() with only text and observate_for, but the method signature requires a third positional argument context.
Environment
- Image:
ghcr.io/lumen-labs/brainapi:v2.14.2-dev
- Also present on
main (af5c778)
- Backends:
GRAPH_DB=networkx, DATA_DB=postgresql, VECTOR_DB=postgresql (backend-independent - the crash is in the task body before any graph work)
MODELS_MODE=remote (OpenAI), AGENTIC_ARCHITECTURE=custom
Reproduction
- Deploy with
PIPELINE_MODE=accurate.
POST /ingest/ with any text payload:
{"data": {"data_type": "text", "text_data": "Some document text."}}
- Watch the worker log.
Actual result
[ERROR/MainProcess] Task src.workers.tasks.ingestion.ingest_data[...] raised unexpected:
TypeError("ObservationsAgent.observe() missing 1 required positional argument: 'context'")
Traceback (most recent call last):
File "/app/src/workers/tasks/ingestion.py", line 346, in ingest_data
observations = observations_agent.observe(
TypeError: ObservationsAgent.observe() missing 1 required positional argument: 'context'
Task meta ends FAILURE; text chunks and data vectors written before the call remain, so the brain is left partially ingested.
Cause
Call site passes two args:
|
observations = observations_agent.observe( |
|
text=( |
|
payload.data.text_data |
|
if payload.data.data_type == IngestionTaskDataType.TEXT.value |
|
else json.dumps(payload.data.json_data) |
|
), |
|
observate_for=payload.observate_for, |
|
) |
Signature requires three:
|
def observe( |
|
self, text: str, observate_for: Optional[List[str]], context: Optional[str] |
|
) -> list[str]: |
def observe(
self, text: str, observate_for: Optional[List[str]], context: Optional[str]
) -> list[str]:
Expected
Either the call site passes context (or context=None), or the signature defaults it: context: Optional[str] = None.
Workaround
PIPELINE_MODE=lightweight (skips the observations stage entirely).
Summary
With
PIPELINE_MODE=accurate, everyingest_dataCelery task raises before observations are saved and the task is marked FAILURE. The ingestion task callsobserve()with onlytextandobservate_for, but the method signature requires a third positional argumentcontext.Environment
ghcr.io/lumen-labs/brainapi:v2.14.2-devmain(af5c778)GRAPH_DB=networkx,DATA_DB=postgresql,VECTOR_DB=postgresql(backend-independent - the crash is in the task body before any graph work)MODELS_MODE=remote(OpenAI),AGENTIC_ARCHITECTURE=customReproduction
PIPELINE_MODE=accurate.POST /ingest/with any text payload:{"data": {"data_type": "text", "text_data": "Some document text."}}Actual result
Task meta ends FAILURE; text chunks and data vectors written before the call remain, so the brain is left partially ingested.
Cause
Call site passes two args:
brainapi2/src/workers/tasks/ingestion.py
Lines 346 to 353 in af5c778
Signature requires three:
brainapi2/src/core/agents/observations_agent.py
Lines 26 to 28 in af5c778
Expected
Either the call site passes
context(orcontext=None), or the signature defaults it:context: Optional[str] = None.Workaround
PIPELINE_MODE=lightweight(skips the observations stage entirely).