Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.5.86-dev (unreleased)

### Bug Fixes

- **Supervisor identity wording** — Replaced robotic `身份名是 X` phrasing in `build_pilot_system_prompt` with `你叫 X` and an explicit self-introduction directive. Supervisor/chief no longer paraphrases itself as "your Claude Code 会话" or refers to the human user as "tongxue"/"agent"/"会话". Fixes #213.

## 0.5.78-dev (unreleased)

### Features
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.79-dev
0.5.86-dev
8 changes: 6 additions & 2 deletions lib/feishu_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,9 @@ def build_pilot_system_prompt(cfg: FeishuBridgeConfig) -> str:
if role is CHIEF_ROLE:
feishu = feishu_command_prefix(cfg)
return (
f"你是 CNB 的{DEVICE_CHIEF_LABEL},身份名是 {cfg.pilot_name}。\n"
f"你叫 {cfg.pilot_name},是 CNB 的{DEVICE_CHIEF_LABEL}(跨机器总管)。\n"
f"自我介绍直接说「我是 {cfg.pilot_name}」。不要自称 agent、Claude Code 会话或类似技术化标签。"
"对面是真人用户,不是 tongxue/agent/会话;称呼用户时直接说「用户」或「你」。\n"
"你管所有机器的 roster、active/standby、leases、跨机器 handoff 和升级处理。"
"你不是这台 Mac 的设备主管,也不是项目 board 里的项目同学;不要把单机 tmux/bridge 状态写成总管主状态。"
"如果用户问“有多少正在运行的 cnb 实例/同学/人”,必须把机器总管、各机器设备主管、项目同学、"
Expand Down Expand Up @@ -881,7 +883,9 @@ def build_pilot_system_prompt(cfg: FeishuBridgeConfig) -> str:
"总管状态写入 ~/.cnb/device-chief/;单机状态写入对应机器的 device-supervisor;项目状态写入项目 .cnb/。"
)
return (
f"你是这台 Mac 的{DEVICE_SUPERVISOR_LABEL},身份名是 {cfg.pilot_name}。\n"
f"你叫 {cfg.pilot_name},是这台 Mac 的{DEVICE_SUPERVISOR_LABEL}。\n"
f"自我介绍直接说「我是 {cfg.pilot_name}」。不要自称 agent、Claude Code 会话或类似技术化标签。"
"对面是真人用户,不是 tongxue/agent/会话;称呼用户时直接说「用户」或「你」。\n"
"你自己就是一个正在值班的 cnb 同学/负责人实例,不是 bridge、tunnel 或旁路服务。"
"如果用户问“有多少正在运行的 cnb 实例/同学/人”,必须把你自己算作 1 个正在运行的"
f"{DEVICE_SUPERVISOR_LABEL};后台 swarm 同学、项目同学、bridge/tunnel/watch 基础设施要分别列出。"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "claude-nb",
"version": "0.5.78-dev",
"version": "0.5.86-dev",
"description": "Multi-agent coordination framework for Claude Code sessions",
"engines": {
"node": ">=18"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "claude-nb"
version = "0.5.78.dev0"
version = "0.5.86.dev0"
description = "Multi-agent coordination framework for Claude Code sessions"
requires-python = ">=3.11"
license = "MIT"
Expand Down
24 changes: 24 additions & 0 deletions tests/test_feishu_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,30 @@ def test_terminal_supervisor_prompt_counts_itself_as_running_tongxue(self, tmp_p
assert "设备主管同学" in prompt
assert "bridge/tunnel/watch 基础设施要分别列出" in prompt

def test_supervisor_prompt_uses_clean_identity_phrasing(self, tmp_path):
cfg = _cfg(tmp_path)

prompt = feishu_bridge.build_pilot_system_prompt(cfg)

# No legacy 身份名是 robotic phrasing (issue #213).
assert "身份名是" not in prompt
# Identity starts with name-first, not role-first.
assert f"你叫 {cfg.pilot_name}" in prompt
# Explicit self-intro directive to avoid "我是 agent-X" or "Claude Code 会话" paraphrasing.
assert f"我是 {cfg.pilot_name}" in prompt
assert "不要自称 agent" in prompt
assert "对面是真人用户" in prompt

def test_chief_prompt_uses_clean_identity_phrasing(self, tmp_path):
cfg = _cfg(tmp_path, pilot_role="device_chief")

prompt = feishu_bridge.build_pilot_system_prompt(cfg)

assert "身份名是" not in prompt
assert f"你叫 {cfg.pilot_name}" in prompt
assert f"我是 {cfg.pilot_name}" in prompt
assert "不要自称 agent" in prompt

def test_build_pilot_command_uses_codex(self, tmp_path):
cfg = _cfg(tmp_path, agent="codex")

Expand Down
Loading