feat(agent-runner): prepare 4.11.x SDK protocol support - #88
Merged
Merged
Conversation
This was referenced Jun 23, 2026
Closed
- Add EBAEvent hierarchy with all unified events (message.*, group.*, friend.*, bot.*, platform.specific) - Add User, UserGroup, UserGroupMember, ChatType, MemberRole entities - Add AbstractPlatformAdapter with optional APIs and capability declaration - Add NotSupportedError for unimplemented optional APIs - All additions are backward-compatible; existing classes unchanged
Phase 0 integration complete - LangBot + SDK + runner repo minimal loop verified. Key changes: - Add RUN_AGENT action forwarding from runtime to plugin process - Add AgentRunner to preinitialize_component_classes for initialization - Implement Protocol v1 entities: AgentRunContext, AgentRunResult, capabilities, permissions - Add resp_message_id field to Message class for LangBot integration - Fix AgentInput.message_chain to accept list type (matches LangBot data) - Add comprehensive tests for AgentRunner protocol Integration verified: plugin:langbot/local-agent/default returns [stub] Echo response. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…support - Refactor AgentRunAPIProxy to inherit from LangBotAPIProxy, reducing code duplication - Pre-compute allowed resource IDs (frozenset) in __init__ for O(1) permission validation - Add STATE_SCOPE_LITERAL type annotation in AgentRunResult.state_updated() - Add AgentRunState TypedDict with 4 scopes (conversation, actor, subject, runner) - Remove unused base64 import from agent_run_api.py - Update documentation for params and state protocol Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Improve AgentRunAPIProxy with state scope support (conversation/session/run) - Enhance plugin handler for agent run operations - Add better error handling and logging
Add record of all 7 runner plugins migration completed on 2026-05-13
- Add INVOKE_RERANK to PluginToRuntimeAction enum - Add invoke_rerank() method to AgentRunAPIProxy - Support reranking documents with relevance scores
Reduces code duplication by composing LangBotAPIProxy instead of directly calling plugin_runtime_handler. Adds get_tool_detail() for LLM function calling support. Changes: - Compose LangBotAPIProxy for delegated API calls - Add permission validation before each delegation - Add get_tool_detail() method for tool schema fetching - Reduce from ~460 lines to ~350 lines
Define Protocol v1 AgentRunContext with required fields: event, delivery, context (ContextAccess), bootstrap, compatibility, metadata. Add history and event pull APIs to AgentRunAPIProxy with run_id authorization. Key changes: - AgentRunContext: Protocol v1 structure with required event/delivery fields - AgentEventContext: event_id, event_type, source required - DeliveryContext: surface, streaming/edit/reaction capabilities - ContextAccess: inline_policy, available_apis for pull APIs - BootstrapContext: optional bootstrap messages (NOT core history) - CompatibilityContext: legacy Query/Pipeline fields for migration - AgentRunResult factories: all require run_id parameter - AgentRunAPIProxy: history_page, history_search, event_get, event_page - PluginToRuntimeAction: HISTORY_PAGE, HISTORY_SEARCH, EVENT_GET, EVENT_PAGE - Legacy helpers: to_v1_result(run_id), create_legacy_context with event/delivery Runner docs updated: use ctx.run_id in factories, ctx.bootstrap.messages instead of ctx.messages (demoted to bootstrap for Protocol v1).
# Conflicts: # pyproject.toml # src/langbot_plugin/api/entities/builtin/platform/events.py # src/langbot_plugin/box/client.py # src/langbot_plugin/box/nsjail_backend.py # src/langbot_plugin/runtime/helper/pkgmgr.py # src/langbot_plugin/runtime/io/handler.py # src/langbot_plugin/runtime/io/handlers/plugin.py # src/langbot_plugin/runtime/plugin/mgr.py # src/langbot_plugin/version.py # tests/runtime/plugin/test_manager.py
# Conflicts: # src/langbot_plugin/runtime/io/handler.py # src/langbot_plugin/runtime/plugin/worker_launcher.py # tests/runtime/io/test_handler.py # tests/runtime/plugin/test_worker_launcher.py
# Conflicts: # src/langbot_plugin/cli/commands/initplugin.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
This PR prepares the SDK side of the 4.11.x AgentRunner / EBA integration branch.
Included in this branch:
RUN_AGENTforwarding for AgentRunner components.Current status
Done / unit covered:
Still intentionally out of scope for this PR:
Verification
311 passed, 10 warningsuv run python scripts/check_action_consistency.pypassed.CommonAction.HEARTBEATwarning, which is host-handled / not SDK-registered.