Files
LangBot/.github/workflows/plugins-misc-tests.yml
T
4ddb350a9f feat(plugins): generalize OASlackBridge into HandoffBridge (any platform → any platform) (#2917)
* feat(plugins): generalize OASlackBridge into HandoffBridge

Rename langbot-team/OASlackBridge to langbot-team/HandoffBridge (人工客服
转接 / Human Handoff Bridge) 0.1.0 and make it platform-neutral:

- customer side: any bot (source_bot); staff side: any bot whose
  send_message returns message_id and whose inbound replies carry a Quote
  (Slack, Lark, QQ OneBot v11), posting to a group/channel or a private chat
- staff can reply to (quote) the request or any forwarded message; every
  forwarded message is mapped and all mappings are removed on close
- Slack escaping/decoding only when the staff bot is Slack (bot.read)
- the WeChat 48-hour rule becomes reply_window_hours (0 = no limit)
- components renamed to handoff (EventListener) and staff_reply (Runner)

READMEs rewritten for users, including how to find group IDs on each
platform and how to migrate from OASlackBridge. Misc plugin CI now uses
any plugin's own requirements-dev.txt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-authored-by: multica-agent <[email protected]>

* feat(HandoffBridge): platform-neutral handoff between any customer and staff bots

Content changes for the rename in the previous commit: generic config
(source_bot, staff_bot, staff_target_type/id, reply_window_hours),
per-message reply references, Slack formatting only for Slack staff bots,
user-facing READMEs, catalog/index/CI updates and tests for non-Slack and
private-chat staff targets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-authored-by: multica-agent <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: multica-agent <[email protected]>
2026-11-06 18:00:23 +08:00

74 lines
2.6 KiB
YAML

name: Plugins / Misc plugin tests
on:
push:
paths:
- "plugins/pytest.ini"
- "plugins/misc/**"
- ".github/workflows/plugins-misc-tests.yml"
pull_request:
paths:
- "plugins/pytest.ini"
- "plugins/misc/**"
- ".github/workflows/plugins-misc-tests.yml"
workflow_dispatch:
permissions:
contents: read
jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: plugins
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: astral-sh/setup-uv@v5
# Each misc plugin imports its own modules through sys.path tricks, so every
# suite runs in its own interpreter and its own environment; requirements.txt
# is the per-plugin dependency declaration (manifests do not carry them).
- name: Run every misc plugin suite in isolation
run: |
set -uo pipefail
status=0
ran=0
for plugin in misc/*/; do
plugin="${plugin%/}"
name="$(basename "$plugin")"
if [ ! -d "$plugin/tests" ]; then
echo "::notice::$name has no tests/ directory; skipped"
continue
fi
ran=$((ran + 1))
env_dir="$RUNNER_TEMP/venv-$name"
echo "=== $name ==="
uv venv "$env_dir" --python 3.11 >/dev/null
python_bin="$env_dir/bin/python"
install_args=(--python "$python_bin"
'https://files.pythonhosted.org/packages/f2/c7/c870377771cbe27e047b19778b5f249b15efef52409358901af94d13e6c0/langbot_plugin-0.7.4-py3-none-any.whl#sha256=596ecd776c13efa6f6cfe178463dc4a967653238548c9569195cdbb5aa47506e'
pytest pytest-asyncio)
if [ -s "$plugin/requirements.txt" ]; then
install_args+=(-r "$plugin/requirements.txt")
fi
# Plugins that need a newer SDK pin it in their own requirements-dev.txt.
if [ -s "$plugin/requirements-dev.txt" ]; then
install_args=(--python "$python_bin" -r "$plugin/requirements-dev.txt")
fi
uv pip install "${install_args[@]}" >/dev/null
if [ ! -s "$plugin/requirements-dev.txt" ]; then
"$python_bin" -c 'from importlib.metadata import version; assert version("langbot-plugin") == "0.7.4"'
fi
if ! (cd "$plugin" && "$python_bin" -m pytest tests -q -p no:cacheprovider); then
echo "::error::$name test suite failed"
status=1
fi
done
echo "Ran $ran misc suites"
exit $status