Repository navigation
fix(evaluation): construct LongTermMemory with the concrete declarative params - #1703
Merged
Merged
Conversation
…ve params Since #1395, `LongTermMemoryParams` is an `Annotated` discriminated union of `DeclarativeBackendParams | EventBackendParams`, not a class. The evaluation entry point still called it as a constructor, so `init_memmachine_params` raised `TypeError: 'types.UnionType' object is not callable` at startup. Build `DeclarativeBackendParams` directly, and refuse an `event` long-term memory configuration up front with a clear error: the evaluation setup reads `vector_graph_store` off the configuration, which only the declarative backend carries. Fixes #1476 Co-Authored-By: Claude Fable 5.1 <[email protected]>
edwinyyyu
approved these changes
Sep 21, 2026
edwinyyyu
left a comment
Contributor
There was a problem hiding this comment.
It's fine, but ideally it would support both.
malatewang
approved these changes
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of the change
The evaluation entry point crashes at startup:
evaluation/utils/agent_utils.pycallsLongTermMemoryParams(...)as a constructor, but since #1395 that name is anAnnotateddiscriminated union ofDeclarativeBackendParams | EventBackendParams, and calling it raisesTypeError: 'types.UnionType' object is not callableon Python 3.12. This picks the backend explicitly, as #1476 proposes.Description
init_memmachine_paramsbuildsDeclarativeBackendParamsdirectly instead of the union alias. The keyword arguments are unchanged; that class is what the alias resolved to for the declarative backend, and it is what the server's ownservice_locatorconstructs.eventlong-term memory configuration with aValueErrornaming the selected backend, next to the existing "not configured" check. It readsvector_graph_storeoff the configuration, which only the declarativeLongTermMemoryConfcarries, so without the check an event configuration would fail later with anAttributeError.No change to the server packages. The issue's alternative, making the alias callable via a dispatching factory, is not taken: the union is the intended shape after #1395 and the server never calls the alias.
Fixes/Closes
Fixes #1476
Type of change
How Has This Been Tested?
ruff checkandruff format --checkon the changed file: clean.LongTermMemoryParams(session_id="s")reproduces the reportedTypeError;evaluation.utils.agent_utilsimports andinit_memmachine_paramsconstructsDeclarativeBackendParams.evaluation/has no test suite and is outside the packages CI type-checks, so no unit test is added.Checklist
🤖 Generated with Claude Code