feat(agent): auto-migrate Honcho to memory provider plugin#12743
feat(agent): auto-migrate Honcho to memory provider plugin#12743Tranquil-Flow wants to merge 2 commits into
Conversation
6ce4179 to
db1491f
Compare
|
Re-ported onto current What changed in the re-port:
New head: |
db1491f to
8828b51
Compare
CI Alert: Test FailureThe Tests workflow failed on the Failing test
Root causeThe test expects Log confirms: Fix neededThe auto-migration code in AIAgent init should skip activation when
|
8828b51 to
0b70af0
Compare
…ut no provider set
When memory.provider is not set in the user's main config but the
Honcho plugin's own honcho.json shows the integration is enabled with
at least one credential (api_key OR base_url), auto-activate Honcho
as the memory provider for this session.
- agent/honcho_auto_migrate.py — new standalone detection helper
(detect_honcho_auto_migrate). Read-only; returns "honcho" or "" so
callers can chain after the explicit-provider check via:
if not _mem_provider_name:
_mem_provider_name = detect_honcho_auto_migrate()
- agent/agent_init.py::init_agent() — wired in immediately after
reading memory.provider from config, with an _auto_migrated_to_honcho
flag to gate persistence. Persistence to memory.provider only fires
AFTER the provider passes is_available() — broken Honcho setups
never write a stale memory.provider: honcho entry to disk.
- One-time "✓ Auto-migrated" message respects quiet_mode.
Re-port of NousResearch#12743 onto current main — AIAgent.__init__ was extracted
into agent/agent_init.py::init_agent() upstream, so the original PR's
hunk no longer applied. The detection helper was moved into its own
module rather than placed at run_agent module-level so unit tests can
import it without pulling in the full agent init stack.
0b70af0 to
27759ef
Compare
What does this PR do?
When
memory.provideris not set in config but Honcho is actively configured (enabled + credentials inhoncho.json), auto-detect and activate it.detect_honcho_auto_migrate()for testability — returns"honcho"when bothenabled=Trueand at least one credential is present.is_available()confirms the provider works, so broken setups never write stale config entries."✓ Auto-migrated"message shown to user (suppressed in quiet mode).Related Issue
N/A — no linked issue; surfaced during memory-provider plugin migration work.
Type of Change
Changes Made
detect_honcho_auto_migrate()helper returning"honcho"when Honcho isenabled=Trueand at least one credential is present.is_available()confirms the provider works."✓ Auto-migrated"message (suppressed in quiet mode).How to Test
pytestthe eight covering tests:test_detects_active_honcho_with_api_key— enabled + api_key → detected.test_detects_active_honcho_with_base_url_only— enabled + base_url only → detected.test_no_detection_when_honcho_disabled— disabled → not detected.test_no_detection_when_honcho_no_credentials— enabled but no creds → not detected.test_no_detection_when_import_fails— plugin not installed → graceful skip.test_persists_after_available_confirms— persistence guard: only afteris_available().test_no_persist_when_provider_not_available— broken setup → no config write.test_no_persist_when_provider_was_explicitly_set— already in config → no duplicate write.Tests import and call the real
detect_honcho_auto_migrate()function with mockedHonchoClientConfig.Tested on: macOS (Darwin 24.6.0, Python 3.14).
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
N/A — see commit description and PR diff.