mirror of
https://github.com/andrewyng/openworker.git
synced 2026-09-04 16:42:35 +00:00
Rename bot references from ocw to OpenWorker
Correlation token now emits [ow:id]; legacy [ocw:id] replies still parse. Invite hints and docstrings say @OpenWorker.
This commit is contained in:
@@ -44,7 +44,7 @@ class Gateway:
|
||||
)
|
||||
self._handler = handler
|
||||
# Tried before the handler: if an inbound message is an Inbox reply (carries an
|
||||
# [ocw:<id>] token), it resolves the item and is consumed — not routed as a new turn.
|
||||
# [ow:<id>] token), it resolves the item and is consumed — not routed as a new turn.
|
||||
self._reply_resolver = reply_resolver
|
||||
# A button click on an interactive prompt (resolves an Inbox item by id).
|
||||
self._interaction_handler = interaction_handler
|
||||
|
||||
@@ -329,7 +329,7 @@ class SlackRelayAdapter(BasePlatformAdapter):
|
||||
return
|
||||
channel = mapped.source.chat_id # bare channel id before qualification
|
||||
# Resolve friendly names with THIS workspace's bot token (cached per team),
|
||||
# mirroring the Socket-Mode adapter — so cards read "@ocw"/"Rohit"/"#ocw-test"
|
||||
# mirroring the Socket-Mode adapter — so cards read "@OpenWorker"/"Rohit"/"#ocw-test"
|
||||
# not raw U…/C… ids. Best-effort: ids fall through on failure.
|
||||
if not mapped.source.user_name:
|
||||
mapped.source.user_name = await self._display_name(
|
||||
|
||||
@@ -82,7 +82,7 @@ def _send_slack(
|
||||
return SendResult(True, message_id=data.get("ts"))
|
||||
err = data.get("error") or "slack send failed"
|
||||
if err == "not_in_channel":
|
||||
err = "not_in_channel — invite @ocw to the channel in Slack, then retry"
|
||||
err = "not_in_channel — invite @OpenWorker to the channel in Slack, then retry"
|
||||
return SendResult(False, error=err)
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ Slack API notes: `users.list` is Tier-2 (~20 req/min) and Slack's own guidance
|
||||
is to cache it — one paginated sweep per workspace per TTL, filtered locally.
|
||||
Private channels only appear where the bot is a MEMBER (API constraint — the
|
||||
GUI words it honestly); public channels carry `is_member` so the picker can
|
||||
hint "invite @ocw in Slack" instead of silently failing to listen.
|
||||
hint "invite @OpenWorker in Slack" instead of silently failing to listen.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -157,7 +157,7 @@ def list_channels(
|
||||
refresh: bool = False,
|
||||
) -> dict[str, Any]:
|
||||
"""Channels the token can see: all public ones, private only where the bot
|
||||
is a member. `is_member` lets the GUI hint "invite @ocw" for the rest."""
|
||||
is a member. `is_member` lets the GUI hint "invite @OpenWorker" for the rest."""
|
||||
token = _bot_token(secrets, team_id)
|
||||
if not token:
|
||||
return {"ok": False, "error": "workspace not connected"}
|
||||
|
||||
@@ -106,7 +106,7 @@ def _resolve_slack_channel(
|
||||
chat_id = str(c["id"]) if team == "default" else f"{team}/{c['id']}"
|
||||
if not c.get("is_member"):
|
||||
return None, (
|
||||
f"found #{query}, but the bot isn't a member — invite @ocw to #{query} "
|
||||
f"found #{query}, but the bot isn't a member — invite @OpenWorker to #{query} "
|
||||
"in Slack, then retry"
|
||||
)
|
||||
return chat_id, None
|
||||
|
||||
Reference in New Issue
Block a user