Skip to content

fix(memos-local-plugin): detect Hermes chat with global flags#1951

Open
dashitongzhi wants to merge 1 commit into
MemTensor:mainfrom
dashitongzhi:fix/memos-bridge-status-20260621090430
Open

fix(memos-local-plugin): detect Hermes chat with global flags#1951
dashitongzhi wants to merge 1 commit into
MemTensor:mainfrom
dashitongzhi:fix/memos-bridge-status-20260621090430

Conversation

@dashitongzhi

Copy link
Copy Markdown

Summary

  • update bridge status detection to match Hermes chat processes when global flags appear before the chat subcommand
  • add a focused unit test covering standard chat, global flags before chat, and non-chat commands

Fixes #1915.

Verification

  • npm test -- --run tests/unit/bridge-status.test.ts
  • npm run lint

Copilot AI review requested due to automatic review settings June 21, 2026 01:06

Copilot AI 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.

Pull request overview

This PR updates the memos-local-plugin bridge’s daemon-mode “Hermes chat running” detection to handle Hermes global CLI flags appearing before the chat subcommand, and adds a unit test to cover the expected matching cases.

Changes:

  • Replaced the pgrep -f "hermes chat" fixed-string match with a configurable pattern constant used by isHermesChatRunning().
  • Added a unit test covering: standard hermes chat, global flags before chat, and non-chat Hermes commands.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
apps/memos-local-plugin/bridge.cts Introduces a reusable process-match pattern and uses it for pgrep-based Hermes chat detection.
apps/memos-local-plugin/tests/unit/bridge-status.test.ts Adds a focused unit test validating Hermes chat process detection behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

};
}

const HERMES_CHAT_PROCESS_PATTERN = "hermes(?:\\s+\\S+)*\\s+chat\\b";
Comment on lines +12 to +14
const escapedPattern = match!.groups!.pattern;
const pattern = escapedPattern.replaceAll("\\\\", "\\");
return new RegExp(pattern).test(command);
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.

fix(memos-local-plugin): bridge status detection misses hermes chat with global flags

2 participants