Skip to content

fix: create facts.db parent dir before connecting (Hermes catalog validate) - #9

Open
teknium1 wants to merge 1 commit into
8bit64k:masterfrom
teknium1:catalog-validate-fix
Open

teknium1 wants to merge 1 commit into
8bit64k:masterfrom
teknium1:catalog-validate-fix

Conversation

@teknium1

Copy link
Copy Markdown

hermes plugins validate fails at HEAD with capability probe: register() raised: unable to open database file. register() calls facts.ensure_schema(config.FACT_DB), and FACT_DB lives under $HERMES_HOME/plugins/cronalytics/, which does not exist in a fresh HERMES_HOME (validate probes against a temp home; the same happens on a first-time install before anything else creates that directory).

This adds a Path(db_path).parent.mkdir(parents=True, exist_ok=True) in ensure_schema() before sqlite3.connect, which is the single choke point every fact-DB connection goes through (get_conn() also routes through it). No other behaviour changes.

Before: capability probe: register() raised: unable to open database file → ok: false
After: capability probe: register() ran in isolation → ok: true (checked on both the main checkout venv and a bare Python 3.11 install).

With this merged, hermes plugins validate passes and Hermes maintainers can list the plugin in the plugin catalog at the merged commit (see NousResearch/hermes-agent#112292 for the sweep).

…passes

`hermes plugins validate` fails at HEAD with `capability probe: register() raised: unable to open database file`. `register()` calls `facts.ensure_schema(config.FACT_DB)`, and `FACT_DB` lives under `$HERMES_HOME/plugins/cronalytics/`, which does not exist in a fresh `HERMES_HOME` (validate probes against a temp home; the same happens on a first-time install before anything else creates that directory).

This adds a `Path(db_path).parent.mkdir(parents=True, exist_ok=True)` in `ensure_schema()` before `sqlite3.connect`, which is the single choke point every fact-DB connection goes through (`get_conn()` also routes through it). No other behaviour changes.

Before: `capability probe: register() raised: unable to open database file` → `ok: false`
After: `capability probe: register() ran in isolation` → `ok: true` (checked on both the main checkout venv and a bare Python 3.11 install).

With this merged, `hermes plugins validate` passes and Hermes maintainers can list the plugin in the plugin catalog at the merged commit (see NousResearch/hermes-agent#112292 for the sweep).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant