Skip to content

fix(openviking): read recall settings from config.yaml first, env vars as fallback - #62541

Closed
justemu wants to merge 2 commits into
NousResearch:mainfrom
justemu:fix/openviking-recall-config-from-config-yaml
Closed

fix(openviking): read recall settings from config.yaml first, env vars as fallback#62541
justemu wants to merge 2 commits into
NousResearch:mainfrom
justemu:fix/openviking-recall-config-from-config-yaml

Conversation

@justemu

@justemu justemu commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

OpenVikingMemoryProvider._recall_config() previously read all recall settings (recall_limit, score_threshold, recall_resources, etc.) exclusively from environment variables. This forced users to store behavioural configuration in .env, violating the Hermes convention that .env is for secrets only.

Root Cause

The infrastructure to load config.yaml → memory.openviking was already in place via _load_hermes_openviking_config(), and was used by _resolve_connection_settings() for connection parameters. But _recall_config() never called it — it only read env vars.

Fix

_recall_config() now calls _load_hermes_openviking_config() and passes config.yaml values as the default parameter to the existing _env_int/_env_float/_env_bool helpers. Env vars still override config.yaml values, preserving backward compatibility.

Priority

config.yaml → env var → built-in default. This matches how _resolve_connection_settings() already uses config.yaml for connection parameters.

Closes

Closes #62540

…s as fallback

_recall_config() previously read all settings (recall_limit, score_threshold,
recall_resources, etc.) exclusively from environment variables. This forced
users to store behavioural configuration in .env, violating the Hermes
convention that .env is for secrets only.

The infrastructure to load config.yaml -> memory.openviking was already in
place via _load_hermes_openviking_config(), but _recall_config() never
called it.

Fix: call _load_hermes_openviking_config() and pass its values as the
default parameter to _env_int/_env_float/_env_bool. Env vars still override
config.yaml values, preserving backward compatibility.

Closes NousResearch#62540
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers labels Jul 11, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing a confirmed configuration gap. Current main's plugins/memory/openviking/__init__.py:2587 reads recall policy exclusively through OPENVIKING_RECALL_*; the existing config loader at :855 is not used there.

Problems

  • The changed config-resolution behavior is untested. tests/openviking_plugin/test_openviking.py:343 checks only defaults and schema entries, not memory.openviking values or the intended legacy env-var override.

Suggested changes

  • Add a temp-HERMES_HOME test that writes memory.openviking recall settings in config.yaml, verifies _recall_config() consumes them, and verifies an OPENVIKING_RECALL_* value overrides config when present.

Automated hermes-sweeper review.

@@ -2585,45 +2585,46 @@ def _env_float(name: str, default: float, *, minimum: float, maximum: float) ->
return max(minimum, min(maximum, value))

def _recall_config(self) -> Dict[str, Any]:
# Read from config.yaml → memory.openviking as primary source, env vars

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add coverage for this new loader path using a temporary HERMES_HOME config.yaml, including the intended legacy environment-variable override. The existing recall-policy test only verifies built-in defaults.

…HOME tests

Add three tests to TestOpenVikingConfigSchema:

1. test_recall_config_reads_from_config_yaml — writes memory.openviking
   settings in config.yaml and verifies _recall_config() consumes them.

2. test_recall_config_env_overrides_config_yaml — writes both config.yaml
   and OPENVIKING_RECALL_* env vars, verifies env takes precedence.

3. test_recall_config_partial_config_yaml — partially populated config.yaml
   falls back to defaults for omitted keys.

All 46 openviking_plugin tests pass (43 existing + 3 new).
@justemu

justemu commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the sweeper's review:

  • 3 new tests added to TestOpenVikingConfigSchema:
    • test_recall_config_reads_from_config_yaml: writes memory.openviking settings in config.yaml, verifies _recall_config() consumes them.
    • test_recall_config_env_overrides_config_yaml: verifies OPENVIKING_RECALL_* env var overrides config.yaml value.
    • test_recall_config_partial_config_yaml: partial config.yaml falls back to defaults for omitted keys.
  • All 46 openviking_plugin tests pass (43 existing + 3 new).
  • Zero regressions.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 11, 2026
@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Merged via #77747 — your commits cherry-picked with authorship preserved (rebase merge).

This PR consolidated your recall settings from config.yaml fix together with 5 other OpenViking fixes into one coherent integration so the complete runtime behavior could be validated as a unit.

Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plugin(openviking): recall settings ignore config.yaml, require env vars only

4 participants