Conversation
s02 Context gets an LLMSummaryCompactor that calls state.llm_client
with the resolved ModelConfig when the stage carries a model override
and a client is attached — otherwise it falls back to the placeholder
summary, preserving existing behavior. Failures of the LLM path fall
back to the same placeholder and emit memory.compaction.llm_failed.
s15 Memory grows a ReflectionResolver that lets GenyMemoryStrategy
run a native JSON-reflection pass against state.llm_client when no
custom callback was provided. The three-mode resolution order is:
user callback → native resolver+client → deferred needs_reflection
flag (unchanged pre-cycle behavior when resolver is absent).
Both stages flip model_override_supported=True in introspection so
UIs can surface a model selector without the capability flag lying.
- src/geny_executor/stages/s02_context/artifact/default/compactors.py:
add LLMSummaryCompactor(SummaryCompactor) — closures for resolve_cfg
/ has_override / client_getter keep the compactor decoupled from the
stage class.
- src/geny_executor/memory/strategy.py:
ReflectionResolver dataclass + native _reflect path with JSON-fence
stripping, should_save gating, memory.reflection.native event.
- src/geny_executor/core/introspection.py:
_STAGE_CAPABILITIES extended with s02_context / s15_memory.
- tests/unit/test_llm_summary_compactor.py (6 tests) +
tests/unit/test_strategy_native_reflect.py (7 tests): cover every
gate — no override, override+no client, override+client, callback
wins, should_save=False, JSON parse error, no-resolver back-compat.
- tests/unit/test_introspection.py:
extend _MODEL_OVERRIDE_STAGES to {s02_context, s06_api, s15_memory}
and add positive assertions for s02/s15.
Suite: 1111 passed, 18 skipped.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Replaces #41 (auto-closed when its base branch was deleted on merge). Rebased onto main.
Summary
LLMSummaryCompactor(SummaryCompactor)that routes throughstate.llm_clientwith the resolvedModelConfigwhen an override and client are both set. Otherwise falls back to the placeholder summary (no regression).ReflectionResolverdataclass.GenyMemoryStrategy._reflectresolves in priority: user callback → native resolver+client → deferredneeds_reflectionflag.model_override_supported=Trueso UIs can honestly surface a model-selector.memory.compaction.llm_failed/memory.reflection.llm_failed.Test plan
test_llm_summary_compactor.py(6) andtest_strategy_native_reflect.py(7).test_introspection.pyextended:_MODEL_OVERRIDE_STAGES = {"s02_context", "s06_api", "s15_memory"}.Original PR: #41. Part of cycle 20260421_4 (plan 05).
🤖 Generated with Claude Code