Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 286514d8a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for key in resolved: | ||
| if key not in exposed: | ||
| exposed.append(key) |
There was a problem hiding this comment.
Refresh the model prompt after exposing skills
When expose_skills() is called after a ReactAgent has already been built, these newly appended keys never reach the model: FunctionCall eagerly evaluates skill_manager.build_prompt() when constructing its ChatPrompter (functionCall.py:90-94), and the once-wrapped agent build is not repeated. The manager's tools will accept the exposed skill, but the model-facing skill list remains unchanged, so the model cannot discover it; the prompter should resolve the skill prompt dynamically or be refreshed after exposure.
Useful? React with 👍 / 👎.
| workspace = lazyllm_locals['_lazyllm_agent'].setdefault('workspace', {}) | ||
| exposed_by_manager = workspace.setdefault('_exposed_skills', {}) | ||
| exposed = exposed_by_manager.setdefault(self._module_id, []) |
There was a problem hiding this comment.
Preserve exposed skills for the entire agent session
When an agent invocation produces its final string, FunctionCall.forward() pops the entire workspace (functionCall.py:235-240), including _exposed_skills stored here. Thus exposing a skill once and invoking the same agent again within the same new_session silently revokes that skill, contrary to this API's documented session scope; store exposure outside the transient invocation workspace or explicitly preserve it during cleanup.
Useful? React with 👍 / 👎.
286514d to
c513b7e
Compare
|
感谢这个 PR 对 Skill progressive disclosure 的支持。 架构上建议后续重点考虑以下几点:
|
What
把 SkillManager 构造时的 Skill 列表拆成两个概念:
allowed_skills:权限/启用边界,运行中不可越过skills:初始可见集合新增:
expose_skills(ids):在当前 session 内动态把 allowed skill 加入可见list_skill_metadata(scope='allowed'|'visible'):对外暴露 descriptor catalog(不含 SKILL.md 正文)ReactAgent/LazyLLMAgentBase支持传入预构建skill_managerWhy
LazyMind 需要在 AgentLoop 前做候选筛选、Loop 内二次发现,但原 SkillManager 把「允许范围」和「当前可见范围」混为一谈,无法动态扩大可见范围。
Tests
test_skills.py+test_agent_base.py:allowed/visible 分离、aliases/tags 归一化、disable-model-invocation 不进 allowed、动态 expose 边界、Agent 接受预构建 manager(25 passed)test_react_agent_with_skills需下载 Qwen2.5-32B + ModelScope,与本次无关,本地 deselect