Skip to content

feat(send): [[plain]] directive + --plain flag for unformatted sends - #50048

Draft
arminanton wants to merge 3 commits into
NousResearch:mainfrom
arminanton:feat/send-plain-text-directive
Draft

feat(send): [[plain]] directive + --plain flag for unformatted sends#50048
arminanton wants to merge 3 commits into
NousResearch:mainfrom
arminanton:feat/send-plain-text-directive

Conversation

@arminanton

Copy link
Copy Markdown
Contributor

Adds a [[plain]] message directive and a --plain/-p CLI flag that send with no parse_mode (no HTML/MarkdownV2), for status notifiers whose dynamic content legitimately contains <placeholder> tokens, commit messages, and markdown that would otherwise break formatting. tools/send_message_tool.py + hermes_cli/send_cmd.py.

Adds a `[[plain]]` message directive and a `--plain`/`-p` CLI flag that send with no parse_mode (no HTML/MarkdownV2), for status notifiers whose dynamic content legitimately contains `<placeholder>` tokens, commit messages, and markdown that would otherwise break formatting. tools/send_message_tool.py + hermes_cli/send_cmd.py.
@alt-glitch alt-glitch added type/feature New feature or request comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have labels Jun 21, 2026
…ll assertion

The [[plain]]/--plain feature adds `plain`: getattr(args,'plain',False) to the
send-message call dict, but test_positional_message_success still asserted the dict
WITHOUT 'plain', so it failed on the PR branch. Add the expected 'plain': False.
arminanton added a commit to arminanton/hermes-agent that referenced this pull request Jun 21, 2026
full_matrix_all_41_prs.sh + matrix.jsonl + per-PR logs/ + matrix-classified.json.
Every open PR: rebase onto fresh v0.17.0 (38 clean + 2 documented-drift + 1 tracker),
build OK (40/40), test = own/relevant-existing/justified-no-test. 5 test failures all
classified; CAUGHT + FIXED a real NousResearch#50048 regression (send 'plain' field broke
test_send_cmd not in its own diff). 3 justified no-test rationales.
The [[plain]]/--plain feature adds a force_plain kwarg to _send_to_platform
and _send_telegram. Update test_send_message_tool.py's await assertions and
the _send_telegram fake stub to include force_plain=False so the test file
matches the new call signature (7 tests were asserting the old signature).
arminanton added a commit to arminanton/hermes-agent that referenced this pull request Jun 22, 2026
…aught+fixed 2 real defects (NousResearch#50047 root-guard order, NousResearch#50048 force_plain test sig); xhigh test is overlay-only; clean-only failures are upstream bugs our PRs fix

@teknium1 teknium1 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.

Thanks for adding an explicit escape hatch for Telegram text that must not be interpreted as HTML or MarkdownV2.

Problems

  • tools/send_message_tool.py:387 adds the control path, but the PR has no test that exercises it. Its test changes only assert default force_plain=False / plain=False values (tests/tools/test_send_message_tool.py:267, tests/hermes_cli/test_send_cmd.py:73); they do not verify --plain, [[plain]], literal <placeholder> text, or parse_mode=None.

Suggested changes

  • Add focused CLI and Telegram-send tests for both entry points and the raw parse mode.
  • Salvage against current main without restoring the PR branch's old Telegram pre-format chunk loop: current main passes the full message to _send_telegram at tools/send_message_tool.py:843-859 so it can format and chunk safely.

Automated hermes-sweeper review.

# (cron heartbeats, escalation alerts) whose dynamic content legitimately
# contains <placeholder> tokens, commit messages, and markdown metacharacters
# that the HTML/MarkdownV2 parsers misread and mangle. Stripped before send.
force_plain = args.get("plain", False) or "[[plain]]" in message

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.

Please add a focused test for [[plain]] with literal <placeholder> text that asserts the directive is stripped and Telegram receives the raw text with parse_mode=None; the current test changes cover only the default force_plain=False path.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants