fix(mnemopi): keep env override out of proactive defaults

This commit is contained in:
Wolfgang Schoenberger
2026-06-18 13:28:45 -07:00
parent 70f9e604f0
commit 19ceca25b2
4 changed files with 30 additions and 16 deletions
+3 -3
View File
@@ -39,6 +39,9 @@
- Fixed `/model` in the TUI to open the model setup picker again, leaving `/switch` as the temporary session model switcher ([#2933](https://github.com/can1357/oh-my-pi/issues/2933)).
- Fixed OpenCode Go sessions recording per-request cost history so `/usage` can show local cap utilization. ([#2942](https://github.com/can1357/oh-my-pi/issues/2942))
### Fixed
- Fixed mnemopi proactive linking being configurable only through the `MNEMOPI_PROACTIVE_LINKING` environment variable, unlike the sibling `mnemopi.polyphonicRecall` / `mnemopi.enhancedRecall` settings: added a `mnemopi.proactiveLinking` config.yml setting (off by default, `/settings` → Memory → Mnemopi) that ingests new memories into the episodic graph as they are stored, linking them to related entities and memories; `MNEMOPI_PROACTIVE_LINKING` still overrides the configured value when set ([#2440](https://github.com/can1357/oh-my-pi/issues/2440)).
## [16.0.6] - 2026-06-18
@@ -92,9 +95,6 @@
### Security
- Secured PDF image reads by validating requested image members against the extracted member list before opening files and refusing traversal-style names
### Fixed
- Fixed mnemopi proactive linking being configurable only through the `MNEMOPI_PROACTIVE_LINKING` environment variable, unlike the sibling `mnemopi.polyphonicRecall` / `mnemopi.enhancedRecall` settings: added a `mnemopi.proactiveLinking` config.yml setting (off by default, `/settings` → Memory → Mnemopi) that ingests new memories into the episodic graph as they are stored, linking them to related entities and memories; `MNEMOPI_PROACTIVE_LINKING` still overrides the configured value when set ([#2440](https://github.com/can1357/oh-my-pi/issues/2440)).
## [16.0.5] - 2026-06-17
+4 -3
View File
@@ -2,6 +2,10 @@
## [Unreleased]
### Fixed
- Fixed the proactive-linking write path ignoring host configuration: `proactiveLinkIfEnabled` read `MNEMOPI_PROACTIVE_LINKING` directly, so a host that enabled proactive linking through `configureRecallFeatures()` had no effect unless the environment variable was also set. `proactiveLinking` is now a `RecallFeatureFlags` option resolved through a `proactiveLinkingEnabled()` fallback, matching the existing polyphonic and enhanced recall flags, with the `MNEMOPI_PROACTIVE_LINKING` environment variable still taking precedence whenever it is set. ([#2440](https://github.com/can1357/oh-my-pi/issues/2440))
## [16.0.6] - 2026-06-18
### Fixed
@@ -11,9 +15,6 @@
### Changed
- Updated OpenRouter request headers to use standard shared headers from the pi-ai package
### Fixed
- Fixed the proactive-linking write path ignoring host configuration: `proactiveLinkIfEnabled` read `MNEMOPI_PROACTIVE_LINKING` directly, so a host that enabled proactive linking through `configureRecallFeatures()` had no effect unless the environment variable was also set. `proactiveLinking` is now a `RecallFeatureFlags` option resolved through a `proactiveLinkingEnabled()` fallback, matching the existing polyphonic and enhanced recall flags, with the `MNEMOPI_PROACTIVE_LINKING` environment variable still taking precedence whenever it is set. ([#2440](https://github.com/can1357/oh-my-pi/issues/2440))
## [16.0.5] - 2026-06-17
+1 -10
View File
@@ -72,19 +72,10 @@ const DEFAULT_CONFIG: BeamConfig = {
proactiveLinking: false,
};
function envProactiveLinkingOverride(): boolean | undefined {
const value = process.env.MNEMOPI_PROACTIVE_LINKING;
return value === undefined ? undefined : value === "1";
}
function normalizeConfig(options: BeamMemoryOptions): BeamConfig {
const configured = options.config ?? {};
const useCloud = options.useCloud ?? configured.useCloud ?? DEFAULT_CONFIG.useCloud;
const proactiveLinking =
envProactiveLinkingOverride() ??
options.proactiveLinking ??
configured.proactiveLinking ??
proactiveLinkingEnabled();
const proactiveLinking = options.proactiveLinking ?? configured.proactiveLinking ?? proactiveLinkingEnabled({});
return {
workingMemoryLimit: configured.workingMemoryLimit ?? DEFAULT_CONFIG.workingMemoryLimit,
workingMemoryTtlHours: configured.workingMemoryTtlHours ?? DEFAULT_CONFIG.workingMemoryTtlHours,
@@ -184,6 +184,28 @@ describe("proactive memory linking", () => {
}
});
it("does not snapshot a construction-time environment override into instance defaults", () => {
process.env.MNEMOPI_PROACTIVE_LINKING = "1";
const beam = new BeamMemory({
sessionId: "proactive-env-snapshot",
dbPath: ":memory:",
proactiveLinking: false,
});
delete process.env.MNEMOPI_PROACTIVE_LINKING;
try {
const first = beam.remember("Alice set up the CI/CD pipeline for backend deployment", {
importance: 0.8,
});
const second = beam.remember("Alice configured the deployment pipeline for continuous integration", {
importance: 0.8,
});
expect(linkedIds(graphOf(beam).findRelatedMemories(second, 1)).has(first)).toBe(false);
} finally {
beam.close();
}
});
it("does not create recall-similarity edges for unrelated content", () => {
process.env.MNEMOPI_PROACTIVE_LINKING = "1";
const beam = new BeamMemory({ sessionId: "proactive-unrelated", dbPath: ":memory:" });