feat(agent): prepare 4.11.x EBA and AgentRunner integration#2277
feat(agent): prepare 4.11.x EBA and AgentRunner integration#2277huanghuoguoguo wants to merge 70 commits into
Conversation
- TelegramAdapter inherits AbstractPlatformAdapter with all capabilities - TelegramEventConverter handles all Update types: message, edited_message, chat_member, my_chat_member, callback_query, message_reaction - TelegramAPIMixin implements: edit_message, delete_message, forward_message, get_group_info, get_group_member_list/info, get_user_info, get_file_url, mute/unmute/kick_member, leave_group - PLATFORM_API_MAP for call_platform_api: pin/unpin message, set chat title/desc, get admins, send chat action, create invite link, answer callback query - Full backward compat: legacy FriendMessage/GroupMessage listeners still work - Preserves all existing functionality: stream output, markdown card, forum topics - Old sources/telegram.py untouched for gradual migration
# Conflicts: # pyproject.toml # uv.lock
Expose skill tools (activate/register_skill/native exec) like native tools instead of gating them behind the skill_authoring capability: - toolmgr.get_all_tools drops include_skill_authoring; SkillToolLoader self-gates on sandbox + skill_mgr - preproc drops the include_skill_authoring branch; pipeline-bound skills and the skills resource gate on skill_mgr presence Persist activated skills into host.activated_skills conversation state so they survive across runs (host writes at activate; last-write-wins); drop the dead restore_activated_skills helper. Prefill ToolResource.parameters host-side (tool_mgr.get_tool_schema) so runners build LLM tools without per-tool get_tool_detail round-trips. Align agent-runner-pluginization design docs to the all-tool model.
- references/skill-all-tool-acceptance.md: acceptance matrix for the skill all-tool model (runner x lifecycle x backend), case status, exit criteria, and the #2271 known issue (pre-existing box nested-mount, not this branch) - cases/skill-discovery-via-mcp-gateway.yaml: schema-valid case proving an external harness discovers skills via langbot_list_assets (the new 'skills' asset class); marked blocked-env until remote claude-code is responsive
|
这里建议把 EBA / Agent 编排相关文档口径再收敛一下,避免把目标形态和当前实现混在一起。 我理解当前更准确的分层是: 几个关键判断:
因此建议文档上做两个调整:
更宏观一点,这个设计的价值不只是 IM Bot。IM 是当前落点,因为 LangBot 既有资产在 platform adapter、bot、message pipeline 和投递能力上。但 |
- Replace legacy pipeline binding card + RoutingRulesEditor with unified EventBindingsEditor; remove use_pipeline_uuid/pipeline_routing_rules from bot form schema and API update handler - Add _augment_event_data() to botmgr for filter virtual fields (message_text, message_element_types, chat_type) - Add alembic migration 0009: migrate use_pipeline_uuid and pipeline_routing_rules into event_bindings on first run - Fix command.tsx: data-[disabled] -> data-[disabled=true] so cmdk 1.x items (data-disabled=false) are not pointer-events:none - EventBindingsEditor: onSelect on CommandItems, filter conditions panel, disabled bindings section, dnd reorder - i18n: add filter/condition keys for zh-Hans and en-US - Update tests to match new bot service behavior Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
groupByCategory pushed multi-category adapters (lark, wecom, discord, slack) into every matching bucket, so the adapter Select rendered duplicate SelectItem values — triggering React duplicate-key warnings and corrupting Radix item tracking. Assign each item to its highest -priority matching category only. Also de-dupes the wizard card grid. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Unorchestrated events are discarded by default, so an explicit discard target is redundant. Drop the discard CommandGroup (and the now-unused CommandSeparator import); the currentLabel() discard branch is kept so any pre-existing discard bindings still render correctly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The 12 old adapters that now have an EBA replacement are tagged `spec.legacy: true` in their source manifests. Principle: don't delete, de-emphasize. - sources/*.yaml (aiocqhttp, dingtalk, discord, kook, lark, officialaccount, qqofficial, slack, telegram, wecom, wecombot, wecomcs): add spec.legacy: true - Adapter / IChooseAdapterEntity types: add optional legacy flag - BotForm adapter Select: split legacy adapters into a collapsed, grayscale group at the bottom with an explanatory hint; auto-expand when the bot already uses a legacy adapter - Wizard platform picker: same collapsed legacy section - i18n: legacyAdapters / legacyAdaptersHint (zh-Hans, en-US) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Telegram (EBA) manifest was missing spec.categories, so it fell into the uncategorized/protocol bucket. Restore popular + global to match the legacy telegram adapter. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Move conditions toggle between event select and arrow; drop "IF" label - Remove "all events" (*) option from event select - Add i18n labels for concrete event names (zh/en/ja) via bots.eventNames - Narrow fallback event set to message.received for adapters without declared supported_events (legacy adapters only emit message.received) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Only surface `ns.*` wildcard when the namespace has 2+ concrete events, so single-event adapters (legacy) show just the one event - Show raw event code as a muted subtitle under each option's label Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a trailing badge (icon + label) to each entry in the sidebar Agent section so users can tell Agent orchestration apart from legacy Pipeline. Thread the agent `kind` field through SidebarEntityItem. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the text label; keep the icon with a title tooltip so names have more room in the narrow sidebar. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a toggle (left of the "+" button) that groups the Agent section by kind, showing "Agent" and "Pipeline" sub-headers. State persists in localStorage, mirroring the extensions group-by-type pattern. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Add group-by-type button to extensions category header (mirrors the agent group-by-kind pattern) — syncs with the extensions page Switch via shared SidebarDataContext state - Relocate both group and refresh controls to sit left-aligned immediately after the title for both Agent and Extensions sections - Add plugins.groupByTypeShort i18n key to all 8 locales Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts: # src/langbot/pkg/pipeline/preproc/preproc.py # src/langbot/pkg/pipeline/process/handlers/chat.py # src/langbot/pkg/provider/runners/localagent.py # src/langbot/pkg/provider/tools/toolmgr.py # src/langbot/templates/metadata/pipeline/ai.yaml # tests/unit_tests/test_preproc.py # web/src/app/home/components/dynamic-form/DynamicFormComponent.tsx # web/src/app/home/pipelines/components/pipeline-form/PipelineFormComponent.tsx
# Conflicts: # pyproject.toml # uv.lock # web/src/app/home/components/dynamic-form/DynamicFormItemComponent.tsx
Scope
This PR prepares the 4.11.x integration branch for LangBot. It brings together the EBA adapter foundation and the AgentRunner pluginization host work.
Included in this branch:
Linked branches and companion PRs
This PR is part of the 4.11.x AgentRunner integration set and should be reviewed/tested with the matching SDK branch:
langbot-app/LangBotdev/4.11.x->master, #2277langbot-app/langbot-plugin-sdkdev/4.11.x->main, langbot-app/langbot-plugin-sdk#88langbot-app/langbot-local-agentmain,README.mdlangbot-app/langbot-agent-runnermain,README.mdlangbot-app/langbot-agent-control-planemain,README.mdJoint test surface
Use this PR together with the SDK companion PR and the three AgentRunner plugin repositories above:
langbot-plugin-sdkfromdev/4.11.x/ PR [ENHANCE]使用限制,忽略某人私聊,忽略某群消息,忽略某群中某人消息 #88.langbot-local-agent/README.mddocuments the in-process local runner path that exercises host model, prompt, history, tool, knowledge-base, state, and storage pull APIs.langbot-agent-runner/README.mddocuments the external-service runner path, including run-scoped Host API/MCP access patterns and steering expectations.langbot-agent-control-plane/README.mddocuments the admin plugin path for listing runs, runtimes, descriptors, event pages, reconciliation, and cancellation.These repositories form the cross-repo validation set for AgentRunner Protocol v1 compatibility.
Current status
Done / unit covered:
activatepersistshost.activated_skillsbest-effort and later runs restore from pipeline-visible skills.Still intentionally out of scope for this PR:
Verification
LangBot was tested against the local editable
langbot-plugin-sdkfrom the matchingdev/4.11.xbranch.467 passed, 64 warningstests/unit_tests/agent,tests/unit_tests/plugin/test_handler_actions.py,tests/unit_tests/provider/test_skill_tools.py, pipeline chat/preproc/media fallback tests, and Telegram EBA adapter tests.agent_runnerentities from the local SDK branch.