> [!right-bubble] ![[minerva-face-right.webp]]
> > [!caution] [[ミネルヴァ]](agent)により自動で記述された項目です。
>
## 事象
[[herdr]]を0.7.5へ更新したあと、[[カレントペインのエージェント名を変更 (herdr)|エージェント名の変更]]で日本語名が設定できなくなった。サイドバーの表示が `claude` のまま変わらない。
```console
$ herdr agent rename "w2Q:p1" ミネルヴァ
{"error":{"code":"invalid_agent_name","message":"agent name must start with a lowercase letter and contain only lowercase letters, digits, '-' or '_' (1-32 characters)"},"id":"cli:agent:rename"}
```
コマンドを `2>/dev/null || true` でエラーを捨てる形で実行していると、**失敗したことに気づけない**。実際にこの事象は0.7.5リリース(2026-07-21)からしばらく発覚しなかった。
### 環境
| 対象 | バージョン |
| --------- | ----- |
| [[herdr]] | 0.7.5 |
## 原因
0.7.5で**エージェント名がCLIのターゲット識別子に昇格した**ため、識別子として使える文字種に制限された。リリースノートにも次の記述がある。
- Added: "Added a live-agent CLI facade ... validates the requested interactive agent kind and **strict agent name**"
- Changed: "**Agent commands now accept only a unique live agent name or the pane ID** currently hosting that agent."
実装(`src/app/agents.rs`)でも0.7.4以前は「trimして空でなければOK」だったものが、0.7.5では次の検証が入っている。
```rust
fn valid_agent_name(name: &str) -> bool {
let mut chars = name.chars();
matches!(chars.next(), Some('a'..='z'))
&& name.len() <= 32
&& chars.all(|ch| ch.is_ascii_lowercase() || ch.is_ascii_digit() || matches!(ch, '-' | '_'))
}
```
同時に `agent rename` は**表示ラベルを設定しなくなった**(0.7.4は `set_agent_name` と `set_manual_label` の両方を呼んでいた)。識別子と表示名が別概念に分離されたということ。
サイドバーに出る名前は `src/workspace/aggregate.rs` で次の優先順位で決まる。
1. `effective_display_agent()` … `pane report-metadata --display-agent` で設定する表示名。**日本語可**
2. `agent_name` … `agent rename` で設定する識別子。**英小文字のみ**
3. 検出したエージェント種別(`claude` など)
なお `herdr pane rename` で設定するペインのラベルは `pane_label` という別のフィールドへ入り、**サイドバーのエージェント行には使われない**。日本語が通るので紛らわしいが、ここを変えても表示は変わらない。
## 解決方法
識別子と表示名を別々に設定する。表示名には日本語をそのまま渡せる。
```bash
PANE=$(herdr pane current 2>/dev/null | jq -r .result.pane.pane_id)
herdr agent rename "$PANE" minerva
herdr pane report-metadata "$PANE" --source owlery --display-agent ミネルヴァ
```
- `--source` は報告元を示す任意のID。同じsourceで再実行すると上書きされる
- 識別子をつけておくと `herdr agent prompt minerva "..."` のように**名前でエージェントを操作できる**。0.7.5のCLIファサードの恩恵で、ペインIDを引き回さずに済む
- エラーを `2>/dev/null` で捨てると今回のような仕様変更に気づけない。ペインIDが取れたときだけ実行する形にして、herdr内での失敗は握りつぶさないほうがよい
```bash
PANE=$(herdr pane current 2>/dev/null | jq -r .result.pane.pane_id)
if [ -n "$PANE" ] && [ "$PANE" != "null" ]; then
herdr agent rename "$PANE" minerva || true
herdr pane report-metadata "$PANE" --source owlery --display-agent ミネルヴァ || true
fi
```
## 参考
- 調査の詳細: owlery Vaultの `shared/reports/herdrのagent renameが日本語名で失敗する原因 2026-07-25.md`
- [Release v0.7.5 · ogulcancelik/herdr](https://github.com/ogulcancelik/herdr/releases/tag/v0.7.5)