hermes - ✅(Solved) Fix Feishu adapter missing channel_prompt resolution (unlike Discord/Slack) [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#12805Fetched 2026-04-20 12:16:53
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
commented ×1cross-referenced ×1referenced ×1

Fix Action

Fix / Workaround

Current workaround

PR fix notes

PR #12811: fix: Anthropic max_tokens + Feishu channel_prompt + Discord free_response

Description (problem / solution / changelog)

Fixes #12790: Anthropic max_tokens fallback for all proxies

The max_tokens fallback in _build_api_kwargs() only fired when the base URL was OpenRouter or Nous Portal. Any other chat-completions proxy (AWS Bedrock, NVIDIA, LiteLLM, vLLM, corporate gateways) serving Claude models would silently bypass the fallback, shipping requests without max_tokens set. Proxies like AWS Bedrock default to 4096 output tokens, which easily exhausts on thinking tokens + large tool calls like write_file or patch.

Fix: Changed the condition from URL-gated to model-gated. If the model is in _ANTHROPIC_OUTPUT_LIMITS (Claude, MiniMax), max_tokens is always set regardless of which proxy serves it.

Fixes #12805: Feishu adapter missing channel_prompt resolution

The Feishu platform adapter did not implement per-channel prompt resolution (_resolve_channel_prompt), unlike Discord and Slack which both support this feature. This means channel_prompts config in config.yaml was silently ignored for Feishu.

Fix: Added _resolve_channel_prompt() method matching the Discord/Slack pattern. Passes channel_prompt to all three MessageEvent construction sites (main message, reaction routing, card action routing).

Fixes #12750: Discord free_response_channels not working

The on_message handler checked DISCORD_IGNORE_NO_MENTION (default: true) before _handle_message was called. When a message had no @mention (human or bot), it returned early — never reaching the free_response_channels logic inside _handle_message. This meant free response channels could never receive unmentioned messages.

Fix: In the DISCORD_IGNORE_NO_MENTION gate at on_message, check the channel against DISCORD_FREE_RESPONSE_CHANNELS before returning early. Configured channels are exempted from the ignore-no-mention filter.


Discussed in: #12790, #12805, #12750

Changed files

  • gateway/platforms/discord.py (modified, +8/-2)
  • gateway/platforms/feishu.py (modified, +8/-0)
  • run_agent.py (modified, +12/-11)
RAW_BUFFERClick to expand / collapse

Problem

The Feishu platform adapter does not implement per-channel prompt resolution, unlike the Discord and Slack adapters which both support this feature via resolve_channel_prompt.

Background

Other platforms (Discord, Slack) implement _resolve_channel_prompt() which calls the shared resolve_channel_prompt() utility from gateway/platforms/base.py. This allows users to configure per-chat-id ephemeral system prompts in config.yaml:

The Feishu adapter has no equivalent implementation. Searching the Feishu adapter source for resolve_channel_prompt or channel_prompt returns zero matches, while Discord and Slack both have it.

Expected behavior

The Feishu adapter should resolve per-chat-id prompts just like Discord and Slack do, enabling this config pattern to work:

Current workaround

Manually adding the following to the Feishu adapter and calling it at MessageEvent construction sites would resolve this:

Then pass channel_prompt=self._resolve_channel_prompt(chat_id) when constructing MessageEvent objects.

Environment

  • Hermes Agent version: current main
  • Platform: Feishu (WebSocket mode)
  • Config: ~/.hermes/config.yaml

Tags

feature-request, feishu, gateway

extent analysis

TL;DR

Implementing the _resolve_channel_prompt method in the Feishu adapter, similar to Discord and Slack adapters, is likely the fix to support per-channel prompt resolution.

Guidance

  • Review the gateway/platforms/base.py file to understand the shared resolve_channel_prompt utility and its usage in Discord and Slack adapters.
  • Add a _resolve_channel_prompt method to the Feishu adapter, calling the shared resolve_channel_prompt utility, to enable per-chat-id ephemeral system prompts.
  • Update the Feishu adapter to pass channel_prompt=self._resolve_channel_prompt(chat_id) when constructing MessageEvent objects.
  • Verify the fix by testing per-channel prompt resolution with the updated Feishu adapter.

Example

class FeishuAdapter:
    # ...

    def _resolve_channel_prompt(self, chat_id):
        return resolve_channel_prompt(chat_id)

    # ...

    def construct_message_event(self, chat_id, message):
        channel_prompt = self._resolve_channel_prompt(chat_id)
        return MessageEvent(channel_prompt=channel_prompt, message=message)

Notes

This solution assumes that the resolve_channel_prompt utility in gateway/platforms/base.py is compatible with the Feishu adapter and its requirements.

Recommendation

Apply workaround: Implement the _resolve_channel_prompt method in the Feishu adapter, as described in the guidance section, to enable per-channel prompt resolution. This is necessary because the Feishu adapter currently lacks this feature, unlike Discord and Slack adapters.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The Feishu adapter should resolve per-chat-id prompts just like Discord and Slack do, enabling this config pattern to work:

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix Feishu adapter missing channel_prompt resolution (unlike Discord/Slack) [1 pull requests, 1 comments, 2 participants]