Skip to content

Feat/agent runner plugin#66

Closed
huanghuoguoguo wants to merge 54 commits into
split/langbot-llm-usage-apifrom
feat/agent-runner-plugin
Closed

Feat/agent runner plugin#66
huanghuoguoguo wants to merge 54 commits into
split/langbot-llm-usage-apifrom
feat/agent-runner-plugin

Conversation

@huanghuoguoguo

@huanghuoguoguo huanghuoguoguo commented May 17, 2026

Copy link
Copy Markdown
Collaborator

状态 / Status

测试中,请勿合并。

该 PR 当前用于验证 Agent Runner plugin SDK 支持,仍在联调 LangBot 侧和 Local Agent Runner。

关联测试仓库 / Related Testing Repositories

关联 PR / Related PR

当前测试重点 / Current Test Focus

  • Plugin SDK 能正确暴露和加载 AgentRunner component metadata。
  • Local Agent Runner 能在 LangBot WebUI 的 Pipeline AI 配置中显示、填写并保存参数。
  • Debug Chat、LangRAG 知识库、MCP tools 等主路径仍在联调测试中。

@huanghuoguoguo huanghuoguoguo requested review from RockChinQ and TyperBody and removed request for TyperBody May 17, 2026 02:30
@huanghuoguoguo huanghuoguoguo marked this pull request as draft May 22, 2026 10:04
@huanghuoguoguo huanghuoguoguo force-pushed the feat/agent-runner-plugin branch 2 times, most recently from a3bc19a to f80c986 Compare June 6, 2026 07:46
@RockChinQ

Copy link
Copy Markdown
Member

recheck

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

All contributors have signed the CLA. ✅ 所有贡献者均已签署 CLA。
Posted by the CLA Assistant Lite bot.

@huanghuoguoguo

Copy link
Copy Markdown
Collaborator Author

Split follow-up PRs created from the unrelated changes that were removed from this AgentRunner pluginization PR:

This PR should now stay focused on AgentRunner component entities, runtime dispatch, run-scoped API proxy, CLI scaffolding, and related tests.

@huanghuoguoguo huanghuoguoguo changed the base branch from main to split/langbot-llm-usage-api June 14, 2026 13:55
huanghuoguoguo and others added 18 commits June 15, 2026 09:21
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).
huanghuoguoguo and others added 25 commits June 15, 2026 09:36
Return structured run.failed events for plugin-side RUN_AGENT failures, enforce plugin readiness before listing or running AgentRunners, and make AgentRunner class declarations flow into manifests.
Carries allowed operations in agent run resources and rejects SDK model/tool/knowledge/file access when the declared manifest operation is not authorized. Adds proxy and MCP bridge regression coverage.
@huanghuoguoguo huanghuoguoguo force-pushed the feat/agent-runner-plugin branch from d16ef60 to 11672fb Compare June 15, 2026 01:50
@huanghuoguoguo huanghuoguoguo deleted the branch split/langbot-llm-usage-api June 16, 2026 01:18
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants