Feat/agent runner plugin#2260
Closed
huanghuoguoguo wants to merge 8 commits into
Closed
Conversation
Comment on lines
+18
to
+36
| from langbot.pkg.entity.persistence import ( | ||
| agent_run, # noqa: F401 | ||
| agent_runner_state, # noqa: F401 | ||
| apikey, # noqa: F401 | ||
| bot, # noqa: F401 | ||
| bstorage, # noqa: F401 | ||
| event_log, # noqa: F401 | ||
| mcp, # noqa: F401 | ||
| metadata, # noqa: F401 | ||
| model, # noqa: F401 | ||
| monitoring, # noqa: F401 | ||
| pipeline, # noqa: F401 | ||
| plugin, # noqa: F401 | ||
| rag, # noqa: F401 | ||
| transcript, # noqa: F401 | ||
| user, # noqa: F401 | ||
| vector, # noqa: F401 | ||
| webhook, # noqa: F401 | ||
| ) |
2f9bfb1 to
2e5244f
Compare
2e5244f to
cede35b
Compare
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
Member
|
项目堆得怎摸样了 能跑了叫我一声 我堆几个agent runner |
…rt finding - claude-code-agent (new pipeline, remote-ssh->101): langbot_list_assets returns skills=1 tools=15 in 24s -> all-tool 'skills' asset class is discoverable end-to-end by an external harness on the unmodified branch - document the runner transport difference: claude-code uses a stdio bridge (works on remote-ssh out of the box), acp uses an HTTP proxy (needs langbot-assets-gateway-public-url on remote-ssh). This is a runner-plugin detail, not a host all-tool-branch issue
…blic-url Prior matrix recorded acp as blocked needing langbot-assets-gateway-public-url (PROBEDONE 0 0 / timeout). That was an environment artifact: a duplicate LangBot-master/ backend contending on box ws-control-port 5410 plus a wedged plugin runtime (host emit_event / list_agent_runners timing out). On a clean single-instance runtime acp discovers skills via the SDK SSH reverse tunnel with no public-url: PROBEDONE 1 17 (8-24s), parity with claude-code (1 15).
…2271 fixed) - nsjail: full create→exec→register→activate→exec-from-activated-path chain returns exit 0; activated mount runs scripts/use.py (reads data/input.json) and writes activated_writeback.txt through to the host skill store. - docker: same chain now passes after langbot-plugin-sdk#87 (recreate sandbox container when extra_mounts change). Corrected #2271 root cause from 'docker masks nested bind mount' to container-reuse: extra_mounts was not in the box session compatibility check, so docker reused a running container and could not append the activated skill's bind mount. - Exit criterion 3 (real end-to-end skill use) now DONE; all 5 criteria met. - Documents the nsjail stale-docker-artifact environment gotcha.
Collaborator
Author
可以了,你试试 |
Extract the AgentRunner Protocol v1 host-side surface from the giant RuntimeConnectionHandler.__init__ into sibling modules using a registration- function pattern (behavior-preserving; @h.action == @self.action): - agent_run_support.py: shared constants + authorization/scope/projection helpers - agent_pull_actions.py: register(h) for history/event pull APIs - agent_runner_actions.py: register(h) for run/runtime/stats/claim lifecycle - agent_state_actions.py: register(h) for steering/state APIs __init__ now calls the three register(self) functions. handler.py keeps the pre-existing plugin/llm/vector/knowledge handlers, get_prompt/call_tool/ get_tool_detail (coupled to retained helpers), shared helpers, and outbound methods; it re-imports _validate_agent_run_session so external imports keep working. handler.py: 4066 -> 1871 lines. test_state_api_auth.py: repoint get_session_registry patch targets to agent_run_support (the lookup moved modules). 385 agent unit tests pass; ruff clean.
Drop the PluginToolLoader.get_tool() override that returned a raw
ComponentManifest, so every loader's get_tool() now returns a uniform
resource_tool.LLMTool (PluginToolLoader.get_tools() already did this
conversion). This removes the only source of tool-shape heterogeneity.
- ToolManager.get_tool_schema(): drop the ComponentManifest-vs-LLMTool branch
- ToolManager.get_tool_detail(): new host-level shape {name, description,
human_desc, parameters}
- handler.py GET_TOOL_DETAIL: call tool_mgr.get_tool_detail(); delete the
handler-local _build_tool_detail + _i18n_to_dict/_i18n_to_text adapters and
the litellm TODO
- ToolLookupResult is now just LLMTool
The dropped label/spec fields were not consumed by any runner (local-agent
build_llm_tool and external harnesses use only name/description/parameters).
Member
|
Continue in #2277 |
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.
状态 / Status
QA 完成,验收标准 5/5 通过。 合并顺序 / merge order:先合 SDK PR #82 并发布新 SDK 版本 → bump 本仓库
pyproject.toml的langbot-pluginpin → 再合本 PR。关联 PR / Related PR
/workspace/.skills/<name>missing scripts/data subdirs on docker backend (nested bind mount) #2271 box 修复(已合入 SDKmain,并随 [BUG]TypeError: run() got an unexpected keyword argument 'debug'` #82 一起 rebase 进来): fix(box): recreate sandbox container when extra_mounts change langbot-plugin-sdk#87关联测试仓库 / Related Testing Repositories
概述 / Overview
把 LangBot 技能统一为授权工具(skill all-tool model)。技能不再藏在
skill_authoringcapability 之后;activate/register_skill/ 原生exec像普通工具一样暴露,仅受 sandbox + skill_mgr 控权。发现走工具化(langbot_list_assets新增skills资产类,供外部 harness 使用)。Host 持久化已激活技能(host.activated_skills,last-write-wins),并预填ToolResource.parameters让 runner 跳过逐工具get_tool_detail。Unifies LangBot skills as authorized tools: skills are no longer gated behind
skill_authoring;activate/register_skill/ nativeexecare exposed like native tools, gated only on sandbox + skill_mgr. Discovery is tool-driven (langbot_list_assetsgains askillsasset class). The host persists activated skills and prefillsToolResource.parameters.主要改动(host 侧)/ Key host-side changes:
toolmgr/SkillToolLoader:去掉include_skill_authoring,自闸于 sandbox+skill_mgrpreproc/resource_builder:技能 gate 改为skill_mgr,并预填ToolResource.parametershost.activated_skills(conversation scope)验收 / QA — 5/5 通过
skill_authoring)/ 激活持久化 / 参数预填 — 单元覆盖/workspace/.skills/<name>exec 链路全exit 0;激活技能的scripts/use.py读到data/input.json、写回文件穿透回 host 技能 storeskill-discovery-via-mcp-gateway— claude-code + acp 两个外部 harness 经 MCP gateway 均发现技能完整验收矩阵:
skills/skills/langbot-testing/references/skill-all-tool-acceptance.md。#2271
激活技能在 docker 上
scripts//data/缺失。根因更正:不是"docker 屏蔽嵌套挂载",而是容器复用 ——extra_mounts未纳入 box session 兼容性检查,技能中途激活时 docker 复用运行中容器、无法追加 bind mount。由 SDK #87(挂载集合变化时重建容器)修复,已 rebase 进 #82。修复后 docker 端到端通过。检查清单 / Checklist
PR 作者完成 / For PR author
项目维护者完成 / For project maintainer