One function

init_openai in verygoodplugins/automem

The author described this change as fix(runtime): support OPENAI_BASE_URL for classification client (#135). It counts as a record because the check below fails on the code as it stood at 9ac2fb29e and passes on 95a58c99d, with nothing else changed between the two runs.

Fix saved2026-03-25
Sharing licenceMIT · LICENSE
Change size+5 1

What the code was meant to do, written into the code itself as a docstring

Initialize OpenAI client for memory type classification (not embeddings).

The change

1919 return
2020
2121 try:
22- state.openai_client = openai_cls(api_key=api_key)
22+ openai_base_url = (get_env_fn("OPENAI_BASE_URL") or "").strip() or None
23+ client_kwargs = {"api_key": api_key}
24+ if openai_base_url:
25+ client_kwargs["base_url"] = openai_base_url
26+ state.openai_client = openai_cls(**client_kwargs)
2327 logger.info("OpenAI client initialized for memory type classification")
2428 except Exception:
2529 logger.exception("Failed to initialize OpenAI client")

The check that tells the two apart

failpass·tests/test_service_runtime.py::test_init_openai_passes_base_url_when_configured

Check file tests/test_service_runtime.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it9ac2fb29ea081c617b748c0cf0d733627770b689
Broken version dated2026-03-25
Moduleautomem.service_runtime
Units changedinit_openai
Fingerprintf21b3c5335a39981
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.