shareAI-lab / shareAI-lab/learn-claude-code

[bug]网页版s16:lead拿不到active_teammates,派生teammate的名字纯靠lead上下文

Open Beginner friendly
#528 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
77.2k
Forks
12.4k
Avg merge
2d 5h
Merged PRs (30d)
6

Description

此issue是基于网页版Learn Claude Code源码提出

Description:

目前 active_teammates 字典在内部维护了所有活跃 teammate 的名称,但 Lead 侧没有任何工具可以查询该列表。Lead 只能依赖模型自己的上下文记忆来记住之前 spawn_teammate 时使用的名称,然后再通过 request_shutdownsend_messagerequest_plan 等工具显式传入名称。

这会导致以下问题:

  • 在长对话或多 teammate 场景下,模型可能遗忘准确的 teammate 名称,导致消息发送到不存在的邮箱,形成消息黑洞。
  • MessageBus.send 不会校验目标是否存在,错误的消息会静默丢失。
  • Lead 无法程序化地确定当前有哪些 teammate 在运行,降低了多 agent 协作的可靠性。

Suggested fix:

添加一个 list_teammates 工具,返回所有活跃 teammate 的名称:

def run_list_teammates() -> str:
    if not active_teammates:
        return "(no active teammates)"
    return "\n".join(f"  - {name}" for name in active_teammates)

同时在 TOOLSexecute_tool 中注册该工具。

Additional consideration:

  • MessageBus.send 可增加目标存在性校验,避免消息发往不存在的 agent。
  • request_shutdown 可支持不传 teammate 参数时对所有活跃 teammate 广播。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the code that owns active_teammates, then inspect the TOOLS and execute_tool registrations. Add the proposed list_teammates entry so it returns active teammate names or the no-active-teammates message, and verify it can be invoked through the tool dispatcher.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai-infra-agents
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.