mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
feat(gateway): make the working-state status text configurable
Adds PlatformConfig.typing_status_text for the two platforms that render text for the working-state line: Slack's assistant.threads.setStatus status (hardcoded 'is thinking...') and Google Chat's visible marker message (hardcoded 'Hermes is thinking…'). None keeps each platform's built-in default; to_dict omits the field when unset so existing configs serialize unchanged. Plumbing mirrors typing_indicator exactly (typed field, from_dict extra fallback, shared-key bridge). Also documents that Slack's status line requires the assistant:write scope — without it setStatus fails silently and Slack shows its own generic placeholder, which previously made the behaviour undiagnosable from config alone.
This commit is contained in:
parent
5b44b65887
commit
dc0c778b22
7 changed files with 120 additions and 3 deletions
|
|
@ -2678,7 +2678,10 @@ class GoogleChatAdapter(BasePlatformAdapter):
|
|||
thread_id = self._resolve_thread_id(
|
||||
reply_to=None, metadata=metadata, chat_id=chat_id,
|
||||
)
|
||||
body: Dict[str, Any] = {"text": "Hermes is thinking…"}
|
||||
body: Dict[str, Any] = {
|
||||
"text": getattr(self.config, "typing_status_text", None)
|
||||
or "Hermes is thinking…"
|
||||
}
|
||||
if thread_id:
|
||||
body["thread"] = {"name": thread_id}
|
||||
|
||||
|
|
|
|||
|
|
@ -1574,7 +1574,8 @@ class SlackAdapter(BasePlatformAdapter):
|
|||
async def send_typing(self, chat_id: str, metadata=None) -> None:
|
||||
"""Show a typing/status indicator using assistant.threads.setStatus.
|
||||
|
||||
Displays "is thinking..." next to the bot name in a thread.
|
||||
Displays "is thinking..." next to the bot name in a thread, or the
|
||||
platform's ``typing_status_text`` config value when set.
|
||||
Requires the assistant:write or chat:write scope.
|
||||
Auto-clears when the bot sends a reply to the thread.
|
||||
"""
|
||||
|
|
@ -1602,7 +1603,8 @@ class SlackAdapter(BasePlatformAdapter):
|
|||
await self._get_client(chat_id, team_id=team_id).assistant_threads_setStatus(
|
||||
channel_id=chat_id,
|
||||
thread_ts=thread_ts,
|
||||
status="is thinking...",
|
||||
status=getattr(self.config, "typing_status_text", None)
|
||||
or "is thinking...",
|
||||
)
|
||||
except Exception as e:
|
||||
# Silently ignore — may lack assistant:write scope or not be
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue