feat(core): add Pipeline.attach_runtime() (v0.24.0)#30
Merged
Conversation
Manifest-first hosts can now wire session-scoped runtime objects (memory retriever, memory strategy, conversation persistence) into a pipeline built from an EnvironmentManifest without reaching into stage internals. attach_runtime walks registered stages and replaces the relevant slot strategies: - memory_retriever → Stage 2 (Context), slot 'retriever' - memory_strategy → Stage 15 (Memory), slot 'strategy' - memory_persistence → Stage 15 (Memory), slot 'persistence' Kwargs are keyword-only; omitted kwargs leave the corresponding slot untouched. Missing target stages are silently skipped. A new _has_started flag (flipped by _init_state) causes attach_runtime to raise RuntimeError after the first run() invocation — prior stage state has already captured slot references. No breaking changes. Pipelines that never call attach_runtime behave identically to 0.23.0. Tests: tests/unit/test_pipeline_attach_runtime.py (8 new tests). Full suite: 1023 passed, 18 skipped. Ruff + format clean. Refs: Geny/dev_docs/20260420_3/plan/02_default_env_per_role.md Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CocoRoF
added a commit
to CocoRoF/Geny
that referenced
this pull request
Apr 20, 2026
v0.24.0 adds Pipeline.attach_runtime() — the runtime-object injection helper we'll use in PR16 when AgentSession._build_pipeline is reduced to one attach_runtime call. No consumer code changes in this PR — the pin bump lands separately so the executor upgrade is isolated from downstream refactors. Refs: dev_docs/20260420_3/plan/02_default_env_per_role.md (Prereq B) Executor PR: CocoRoF/geny-executor#30 Executor release: https://github.com/CocoRoF/geny-executor/releases/tag/v0.24.0 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 tasks
CocoRoF
added a commit
to CocoRoF/Geny
that referenced
this pull request
Apr 20, 2026
v0.24.0 adds Pipeline.attach_runtime() — the runtime-object injection helper we'll use in PR16 when AgentSession._build_pipeline is reduced to one attach_runtime call. No consumer code changes in this PR — the pin bump lands separately so the executor upgrade is isolated from downstream refactors. Refs: dev_docs/20260420_3/plan/02_default_env_per_role.md (Prereq B) Executor PR: CocoRoF/geny-executor#30 Executor release: https://github.com/CocoRoF/geny-executor/releases/tag/v0.24.0 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.
Summary
Pipeline.attach_runtime(*, memory_retriever=None, memory_strategy=None, memory_persistence=None)— a single explicit injection point for session-scoped runtime objects that anEnvironmentManifestcannot express (host-specific retriever, update strategy, and conversation persistence).Pipeline._has_startedflag, flipped by_init_stateon the firstrun()/run_stream()invocation.attach_runtimeraisesRuntimeErrorafter this flip to prevent mixed-runtime pipelines where earlier stage state has captured pre-attach slot values.tests/unit/test_pipeline_attach_runtime.py).Why
The Geny cutover (
Geny/dev_docs/20260420_3/plan/02_default_env_per_role.md) moves session creation from hardcodedGenyPresets.*branches toPipeline.from_manifest_async(...). Manifests are declarative, so they cannot carry runtime objects (SessionMemoryManager,CuratedKnowledgeManager, persistence callbacks). Before this release hosts reached into_slots[...].strategydirectly — now they call one helper.Contract
memory_retrieverretrievermemory_strategystrategymemory_persistencepersistencerun()/run_stream(). RaisesRuntimeErrorafterwards.Backwards compatibility
No breaking changes. Pipelines that never call
attach_runtimebehave identically to 0.23.0. TheGenyPresets.worker_adaptive(...)/GenyPresets.vtuber(...)builders remain available and unchanged.Test plan
pytest tests/unit/test_pipeline_attach_runtime.py— 8 passedruff check+ruff format --checkclean[0.24.0]entrypyproject.toml+__init__.pyversion bumped to 0.24.0🤖 Generated with Claude Code