Skip to content

test(agents): serve the fake herdr from a POSIX sh script - #279

Merged
furedea merged 1 commit into
mainfrom
test/fast-fake-herdr
Oct 21, 2026
Merged

furedea merged 1 commit into
mainfrom
test/fast-fake-herdr

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

概要

  • tests/agents/hooks の fake herdr を Python スクリプトから POSIX sh スクリプトに置き換え,負荷時の flaky 失敗を防ぐ.
  • 本番コード,timeout,assertion,lock は変更していない.
  • 判断事項: テスト基盤のみの変更のため,レビューとマージの可否.

変更前後

変更前 変更後
fake herdr テストごとに Python スクリプトを生成し,呼び出しごとに Python を起動 fake_herdr.sh を symlink し,用意済み JSON を cat で返す
agent 一覧 呼び出し時に live_agents.txt から Python で組み立て set_agents が live agents の変更時に agents.json を書く

原因: 負荷時に Python の fake が 5 秒の一覧取得 timeout を使い切り,許可されるはずの呼び出しが ask になっていた.フルラン 1 回で 1 件,別の 1 回で 13 件失敗し,再実行では再現しなかった.

検証

  • uv run --frozen pytest tests/agents: 1958 passed
  • lefthook run pre-commit: 全フック成功 (ty の contextmanager deprecation 警告は既存コードで,今回の差分とは無関係)
  • 差分はテスト 4 ファイルと fake_herdr.sh のみ (本番コード,timeout,assertion,lock の変更なし)
スコープと補足
  • 変更ファイル: tests/agents/hooks/{conftest.py,herdr_runtime.py,fake_herdr.sh,test_herdr_ownership.py,test_herdr_ownership_workspaces.py}
  • herdr.write_text(...) を set_agents(...) に置き換えた.live_agents.txt は従来どおり更新する.
  • 対応する Issue と plan コメントはなし.計画からの逸脱もなし.

🤖 Generated with Claude Code

The Python fake herdr took over the 5 second listing timeout under
load, so calls that should be allowed asked instead. Serve prepared
JSON from a sh script and write the agent listing when live agents
change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea
furedea merged commit a0b108b into main Oct 21, 2026
11 checks passed
@furedea
furedea deleted the test/fast-fake-herdr branch October 21, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant