Skip to content

feat(hermes): add Hermes memory provider setup and diagnostics of powercontext cli - #1287

Open
Alanxtl wants to merge 2 commits into
oceanbase:masterfrom
Alanxtl:add_hermes_cli
Open

feat(hermes): add Hermes memory provider setup and diagnostics of powercontext cli#1287
Alanxtl wants to merge 2 commits into
oceanbase:masterfrom
Alanxtl:add_hermes_cli

Conversation

@Alanxtl

@Alanxtl Alanxtl commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Rationale for this change

add support for Hermes CLI:

powercontext setup hermes --source oceanbase/powercontext --ref v0.0.2
powercontext doctor hermes

including

install plugin of powercontext hermes
cp to $HERMES_HOME/plugins/powercontext
check Hermes CLI installed or not
check PowerContext Hermes pligin exists or not
suppport --json

Are there any user-facing changes?

yes, powercontext cli support for hermes

AI usage statement

coworked with codex

@Alanxtl

Alanxtl commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

the ci fails due to timeout, maybe it is github's problem

}

plugin = hermes_home() / "plugins" / HERMES_PLUGIN_NAME
installed = _is_hermes_plugin(plugin)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This can report a broken install as healthy. I reproduced it with a provider missing client.py: powercontext doctor hermes returned exit 0 and ok: true, while hermes plugins doctor --ci failed to import the provider. Could we validate the installed directory through the real Hermes plugin doctor, and verify the supported Hermes version, before reporting success?


def _materialize_remote_checkout(source: str, ref: str) -> Path:
target = checkout_target(ref)
if _usable_checkout(target):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This cache is keyed only by ref, so any usable checkout wins regardless of source, and mutable refs such as the default master are never refreshed. After one setup, a later run against an updated master—or a different repository with the same ref—silently installs the cached provider. Please include the normalized source/resolved commit in the cache identity or refresh mutable refs before returning.

target = home / "plugins" / HERMES_PLUGIN_NAME
try:
target.parent.mkdir(parents=True, exist_ok=True)
shutil.copytree(plugin_dir, target, dirs_exist_ok=True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

dirs_exist_ok=True overlays the new release but never removes files that disappeared from it. I reproduced this by installing a provider with an extra module, then a new source without it; the removed module remained under $HERMES_HOME/plugins/powercontext and could still be discovered. Please stage the new directory and replace the old one atomically, or remove the old target before copying.

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.

2 participants