Skip to content

実装: gemini-cli-headless-delegation SKILL.md の timeout_sec 推奨追記と gh_commands 記述整合 #249

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "gemini-cli-headless-delegation の github_research + gh_commands リクエストで 120s タイムアウトが発生した実績を受け、SKILL.md のリクエスト JSON 早見表の (1) timeout_sec 行に github_research / local_asset_research / proposal_only + gh_commands 使用時の timeout_sec: 300+ 推奨と wall-clock 区別を追記し、(2) gh_commands 行を usage-contract.md と整合させて実装済み/非対応 profile を正しく記載し、呼び出し元が適切な timeout を設定できるようにする"
change_kind: docs
allowed_paths:
  - .claude/skills/gemini-cli-headless-delegation/SKILL.md
acceptance_criteria_count: 4
verification_kind: deterministic

Parent Issue

なし(単独改善)

Parent Goal Ref

  • Goal: なし(単独改善)
  • Desired Destination: なし

Current Validated Scope

  • .claude/skills/gemini-cli-headless-delegation/SKILL.md リクエスト JSON 早見表の timeout_sec 行に github_research / local_asset_research / proposal_only + gh_commands 使用時の timeout_sec: 300+ 推奨を追記する

Remaining Parent Gaps

なし

Outcome

.claude/skills/gemini-cli-headless-delegation/SKILL.md のリクエスト JSON 早見表で
(1) timeout_sec 行に github_research / local_asset_research / proposal_only + gh_commands 使用時の timeout_sec: 300+ 推奨と、timeout_sec が Gemini CLI 実行フェーズ中心の timeout でありwrapper 全体の wall-clock 予算ではない点が明記され、
(2) gh_commands 行が usage-contract.md と整合し、実装済み profile (github_research / local_asset_research / proposal_only) と非対応 profile (no_tools / grounded_research) が正しく記載されている。
かつ AC grep VC が全件 PASS している。

In Scope

  • .claude/skills/gemini-cli-headless-delegation/SKILL.md の timeout_sec 行(リクエスト JSON 早見表)への github_research / local_asset_research / proposal_only + gh_commands 時の timeout_sec: 300+ 推奨追記
  • 必要に応じて Core Rules の github_research ルール行への同旨の記述追加
  • gh_commands 行を usage-contract.md と整合させ、実装済み profile (github_research / local_asset_research / proposal_only) と非対応 profile (no_tools / grounded_research) を正しく記載する

Out of Scope

  • run_gemini_headless.py へのタイムアウト強制ロジックの実装
  • run_gemini_headless.py への runtime warning ロジック実装(別 Issue として追跡)
  • github_research プロファイル自体のリファクタ
  • grounded_research の timeout 推奨変更(既に 300s 推奨記載済み)
  • references/usage-contract.md 等の参照ファイル変更 (既存)

Acceptance Criteria

  • AC1: SKILL.md のリクエスト JSON 早見表 timeout_sec 行に、github_research / local_asset_research / proposal_only + gh_commands 使用時は timeout_sec: 300+ 推奨であることが明記されている
  • AC2: 同じ記述に、gh_commands 事前実行・inline_context prepend・GitHub API レイテンシ・prompt 増加が timeout 不足の理由として明記されている
  • AC3: timeout_sec は wrapper 全体の wall-clock 予算ではなく、Gemini CLI 実行フェーズ中心の timeout であり、gh_commands 実行時間は別途 wall-clock 余裕に含める必要があることが明記されている
  • AC4: SKILL.md の gh_commands 行が usage-contract.md と整合し、実装済み profile が github_research / local_asset_research / proposal_only、非対応 profile が no_tools / grounded_research と記載されている

Verification Commands

# AC1: timeout_sec 行に github_research/local_asset_research/proposal_only + gh_commands 時の 300+ 推奨が明記
# AC2: gh_commands 事前実行・inline_context prepend・GitHub API レイテンシ・prompt 増加が理由として明記
# AC3: timeout_sec が Gemini CLI 実行フェーズ中心であり wrapper 全体 wall-clock 予算とは別である旨が明記
python3 - <<'PY'
from pathlib import Path
p = Path(".claude/skills/gemini-cli-headless-delegation/SKILL.md")
text = p.read_text(encoding="utf-8")
row = next(line for line in text.splitlines() if line.startswith("| `timeout_sec` "))
required = [
    "github_research",
    "local_asset_research",
    "proposal_only",
    "gh_commands",
    "300",
    "inline_context",
    "prepend",
    "wall-clock",
]
missing = [s for s in required if s not in row]
assert not missing, f"timeout_sec row missing: {missing}"
print("PASS: timeout_sec row is explicit enough")
PY

# AC4: gh_commands 行の実装済み/非対応 profile 整合
python3 - <<'PY'
from pathlib import Path
p = Path(".claude/skills/gemini-cli-headless-delegation/SKILL.md")
text = p.read_text(encoding="utf-8")
row = next(line for line in text.splitlines() if line.startswith("| `gh_commands` "))
required = ["github_research", "local_asset_research", "proposal_only", "no_tools", "grounded_research", "usage-contract.md"]
missing = [s for s in required if s not in row]
assert not missing, f"gh_commands row missing: {missing}"
print("PASS: gh_commands row aligns with usage-contract")
PY

- pnpm typecheck
- pnpm lint
- pnpm test
- pnpm build
- uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/

Allowed Paths

  • .claude/skills/gemini-cli-headless-delegation/SKILL.md

Runtime Verification Applicability

decision: not_applicable
reason: "docs-only change。追加する記述は rg grep で決定論的に検証可能であり、ランタイム動作の実装を含まない。"

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Required Skills

なし

Scope Delta(任意)

N/A

Delivery Rule

Background

出典: Issue #87 refinement-loop(2026-05-23)中の gemini-cli-headless-delegation 実行ログ。

github_research + gh_commands を含むリクエストを timeout_sec: 120 で実行したところ、120s でタイムアウトした(gh_commands を 2 件含む request)。grounded_research には「300 秒以上を推奨」の記述が SKILL.md:40 に存在するが、github_research + gh_commands への同様の推奨が欠落していた。

gh_commands は wrapper が事前実行し結果を inline_context に prepend するため、gh issue list の API レイテンシ + prepend 処理で総実行時間が増加する。特に複数 gh_commands を含む場合や大きな結果を返すコマンドでは 120s 以上かかる可能性がある。

Refs #87(発見 Issue), #14(関連 Allowed Path)

Source

dedupe_key: gemini-github-research-gh-commands-timeout-recommendation
source_issue: 87
source_url: https://github.com/squne121/loop-protocol/issues/87#issuecomment-4523880408
materialized_by: issue-refinement-loop (2026-05-23)

Activity

  1. added
    enhancement
    phase/implementation
    agent/implementer
    on May 23, 2026
  2. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    結論

    #249 は単独の docs-only PR としては狭すぎます。類似Issueをまとめるなら、推奨単位は次です。

    推奨PR単位:
    docs(gemini-cli-headless-delegation): align timeout guidance and gh_commands contract

    Close: #249
    Refs: #14, #87, #104, #81
    基本方針: #14 全体は閉じない。#14 のうち、同一 SKILL.md に関係する「gh_commands / timeout / 429・fallback 記述整合」の小片だけを先に吸収する。

    #249 は github_research + gh_commands で timeout_sec: 120 が実績上不足したため、SKILL.md に timeout_sec: 300+ 推奨を追記する Issue です。Allowed Path は SKILL.md のみで、実装ロジック変更は Out of Scope です。 ただし #14 も同じ gemini-cli-headless-delegation/SKILL.md を含む open Issue で、429/quota/fallback、transport、preflight、post_to_issue_url 境界など同じ配布物の契約整備を扱っています。

    敵対的レビュー

    Blocker 1: timeout_sec: 300+ 文言だけでは実際の wall-clock timeout を説明できていない

    現行 run_gemini_headless.py は gh_commands を Gemini 実行前に subprocess.run(... timeout=30) で順次実行し、その後に timeout_sec を Gemini CLI の subprocess timeout として使っています。つまり timeout_sec は「wrapper 全体の総予算」ではなく、少なくとも実装上は「Gemini CLI 実行フェーズの timeout」として作用します。 Python の subprocess.run(timeout=...) も、指定した child process 単位で timeout を扱い、期限超過時にその child process を kill します。(Python documentation)

    したがって #249 の本文にある「gh_commands 事前実行・inline_context prepend で追加遅延があるから timeout_sec: 300+」という説明は半分だけ正しいです。より正確には、timeout_sec とは別に、gh_commands 件数 × 30 秒 + retry/backoff + model chain の wall-clock 余裕が必要です。

    Blocker 2: SKILL.md と usage-contract.md の gh_commands 実装状況が矛盾している

    現行 SKILL.md の gh_commands 行は、github_research のみ完全実装済みで、local_asset_research / proposal_only は設計済み・別Issue実装と読める記述になっています。 しかし usage-contract.md では、github_research、local_asset_research、proposal_only の gh_commands は完全実装済みとされ、no_tools / grounded_research は非対応と整理されています。

    #249 で timeout_sec 行だけを直すと、この隣接する契約ズレが残ります。SKILL.md は呼び出し側が最初に見る早見表なので、ここを放置すると AI エージェントが古い前提で request を作ります。

    High 1: #249 の VC は false pass しやすい

    #249 の VC は github_research.*gh_commands.*300 系の grep で、表の timeout_sec 行に正しく入ったか、Core Rules のどこに入ったか、timeout_sec の意味が正確に説明されたかを検証できません。

    最低でも section-anchored VC にして、リクエスト JSON 早見表 の timeout_sec 行、および Core Rules の gh_commands 近傍を個別に検証するべきです。

    High 2: #104 の Antigravity 移行と衝突しない表現にする必要がある

    #104 では、Gemini CLI から Antigravity CLI への段階移行が parent tracker 化され、初期 agy provider 対応は no_tools / proposal_only に限定し、github_research などは後続扱いとされています。 公式 Gemini CLI docs でも、unpaid tier / Google One ユーザー向け Gemini CLI は Antigravity CLI に置換される旨が案内されています。(Gemini CLI)

    そのため #249 の修正は「Gemini CLI 固有の新機能追加」ではなく、現行 wrapper contract の運用注意・バグフィックスとして書くべきです。これは #104 の「Gemini CLI 新機能 freeze」と矛盾しません。

    Medium: gh api GET-only 契約は正しいが、docs 側で理由を短く補強するとよい

    現行実装は gh api の -f / -F / --input を read-only 経路から弾いています。これは GitHub CLI 公式仕様上、field parameter を追加すると既定 method が POST に切り替わり、GET query にするには --method GET が必要だから妥当です。(GitHub CLI)

    timeout_sec とは別件ですが、gh_commands 近傍を触るなら「gh api は GET-only、-f/-F は POST 化し得るため禁止/制御」という理由を 1 行だけ明記すると、将来の回帰を減らせます。

    まとめて実装するなら、この範囲が妥当

    扱い | Issue / PR | 判断 -- | -- | -- Close | #249 | 主対象。timeout guidance を修正する Refs | #14 | 同一 SKILL.md の契約整合。全部は閉じない Refs | #87 | #249 の発見元。timeout 事象の背景として参照 Refs | #104 | Antigravity 移行と Gemini CLI freeze 方針に抵触しないことを確認 Refs | PR #81 | 外部 CLI transport の過大安全主張・契約境界の教訓として参照。PR #81 は ACP transport で境界設計と runtime evidence を #112/#113 に分けた経緯があります。 Do not close | #104 | parent tracker。#249 の修正で閉じる対象ではない Do not bundle | #112 / #113 | ACP safety / runtime evidence。timeout docs と別スコープ

    推奨パッチ方針

    最小修正、docs-only

    SKILL.md の timeout_sec 行を次の意味にする。

    | `timeout_sec` | 任意 | 省略時は wrapper の既定値。`grounded_research` 使用時は 300 秒以上を推奨。`github_research` / `local_asset_research` / `proposal_only` で `gh_commands` を指定する場合も 300 秒以上を推奨する。`gh_commands` は Gemini 実行前に wrapper が read-only `gh` コマンドを事前実行し、その結果を `inline_context` に prepend するため、外部 API レイテンシと prompt 増加により 120 秒では不足しやすい。なお `timeout_sec` は主に Gemini CLI 実行フェーズの timeout であり、wrapper 全体の wall-clock 予算は `gh_commands` 件数・各 `gh` 実行 timeout・retry/backoff を含めて別途余裕を取る。 |
    

    さらに gh_commands 行を usage-contract.md と揃える。

    | `gh_commands` | 任意 | `[{ "argv": [...] }]` 形式の argv ベースコマンドリスト。wrapper が事前実行し結果を `inline_context` に prepend する general field。`github_research` / `local_asset_research` / `proposal_only` で実装済み。`no_tools` / `grounded_research` では非対応。profile ごとの deny/fail/warn 挙動は `references/usage-contract.md` を正本とする。 |
    

    品質優先なら、runtime warning まで入れる

    #249 の現契約は docs-only ですが、実効性を上げるなら Allowed Paths を広げて run_gemini_headless.py と tests も触るべきです。

    追加ロジックの趣旨:

    gh_commands = request.get("gh_commands")
    if (
        tool_profile in {GITHUB_RESEARCH_PROFILE, LOCAL_ASSET_RESEARCH_PROFILE, PROPOSAL_ONLY_PROFILE}
        and isinstance(gh_commands, list)
        and gh_commands
        and isinstance(_timeout_raw, (int, float))
        and _timeout_raw < 300
    ):
        request_warnings.append(
            f"{tool_profile} with gh_commands recommends timeout_sec >= 300 "
            f"(got {_timeout_raw}); gh_commands are pre-executed and prepended to inline_context"
        )
    

    これは #249 の Out of Scope を超えるため、やるなら #249 本文を更新して Allowed Paths に以下を追加します。

    allowed_paths:
      - .claude/skills/gemini-cli-headless-delegation/SKILL.md
      - .claude/skills/gemini-cli-headless-delegation/scripts/run_gemini_headless.py
      - .claude/skills/gemini-cli-headless-delegation/tests/
    

    修正版 AC / VC 案

    ## Acceptance Criteria
    
    • AC1: SKILL.md のリクエスト JSON 早見表 timeout_sec 行に、github_research / local_asset_research / proposal_only + gh_commands 使用時は timeout_sec: 300+ 推奨であることが明記されている
    • AC2: 同じ記述に、gh_commands 事前実行・inline_context prepend・GitHub API レイテンシ・prompt 増加が timeout 不足の理由として明記されている
    • AC3: timeout_sec は wrapper 全体の wall-clock 予算ではなく、Gemini CLI 実行フェーズ中心の timeout であり、gh_commands 実行時間は別途 wall-clock 余裕に含める必要があることが明記されている
    • [ ] AC4: SKILL.md の gh_commands 行が usage-contract.md と整合し、実装済み profile が github_research / local_asset_research / proposal_only、非対応 profile が no_tools / grounded_research と記載されている
    # AC1-AC3: timeout_sec 行に github_research/local_asset/proposal + gh_commands + 300 + 根拠がある
    python3 - <<'PY'
    from pathlib import Path
    p = Path(".claude/skills/gemini-cli-headless-delegation/SKILL.md")
    text = p.read_text(encoding="utf-8")
    row = next(line for line in text.splitlines() if line.startswith("| timeout_sec "))
    required = [
    "github_research",
    "local_asset_research",
    "proposal_only",
    "gh_commands",
    "300",
    "inline_context",
    "prepend",
    "wall-clock",
    ]
    missing = [s for s in required if s not in row]
    assert not missing, f"timeout_sec row missing: {missing}"
    print("PASS: timeout_sec row is explicit enough")
    PY

    AC4: gh_commands 行の実装済み/非対応 profile 整合

    python3 - <<'PY'
    from pathlib import Path
    p = Path(".claude/skills/gemini-cli-headless-delegation/SKILL.md")
    text = p.read_text(encoding="utf-8")
    row = next(line for line in text.splitlines() if line.startswith("| gh_commands "))
    required = ["github_research", "local_asset_research", "proposal_only", "no_tools", "grounded_research", "usage-contract.md"]
    missing = [s for s in required if s not in row]
    assert not missing, f"gh_commands row missing: {missing}"
    print("PASS: gh_commands row aligns with usage-contract")
    PY

    pnpm typecheck
    pnpm lint
    pnpm test
    pnpm build
    uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/

    実装指示として使うなら

    そのまま AI エージェントへ渡すなら、こう書くのが安全です。

    Issue #249 を実装する。ただし #249 単独の timeout 文言追加に留めず、同じ SKILL.md 早見表内の gh_commands 実装状況を usage-contract.md と整合させる。

    必須:

    • Closes #249
    • Refs #14 #87 #104 #81
    • timeout_sec 行に github_research / local_asset_research / proposal_only + gh_commands 使用時の timeout_sec: 300+ 推奨を追加
    • 根拠として gh_commands 事前実行、inline_context prepend、GitHub API レイテンシ、prompt 増加を明記
    • timeout_sec が wrapper 全体 wall-clock ではなく Gemini CLI 実行フェーズ中心である点を明記
    • gh_commands 行を usage-contract.md と整合させ、実装済み profile / 非対応 profile を正しく更新
    • #104 の Gemini CLI freeze と衝突しないよう、新機能追加ではなく現行 contract の docs 修正として扱う

    この束ね方なら、#249 の実害を直しつつ、#14 の大きすぎるスコープに飲み込まれず、#104 の Antigravity 移行とも矛盾しません。

    ## 結論

    #249 は単独の docs-only PR としては狭すぎます。類似Issueをまとめるなら、推奨単位は次です。

    推奨PR単位:
    docs(gemini-cli-headless-delegation): align timeout guidance and gh_commands contract

    Close: #249
    Refs: #14, #87, #104, #81
    基本方針: #14 全体は閉じない。#14 のうち、同一 SKILL.md に関係する「gh_commands / timeout / 429・fallback 記述整合」の小片だけを先に吸収する。

    #249 は github_research + gh_commands で timeout_sec: 120 が実績上不足したため、SKILL.md に timeout_sec: 300+ 推奨を追記する Issue です。Allowed Path は SKILL.md のみで、実装ロジック変更は Out of Scope です。 ただし #14 も同じ gemini-cli-headless-delegation/SKILL.md を含む open Issue で、429/quota/fallback、transport、preflight、post_to_issue_url 境界など同じ配布物の契約整備を扱っています。

    敵対的レビュー

    Blocker 1: timeout_sec: 300+ 文言だけでは実際の wall-clock timeout を説明できていない

    現行 run_gemini_headless.py は gh_commands を Gemini 実行前に subprocess.run(... timeout=30) で順次実行し、その後に timeout_sec を Gemini CLI の subprocess timeout として使っています。つまり timeout_sec は「wrapper 全体の総予算」ではなく、少なくとも実装上は「Gemini CLI 実行フェーズの timeout」として作用します。 Python の subprocess.run(timeout=...) も、指定した child process 単位で timeout を扱い、期限超過時にその child process を kill します。([Python documentation]1)

    したがって #249 の本文にある「gh_commands 事前実行・inline_context prepend で追加遅延があるから timeout_sec: 300+」という説明は半分だけ正しいです。より正確には、timeout_sec とは別に、gh_commands 件数 × 30 秒 + retry/backoff + model chain の wall-clock 余裕が必要です。

    Blocker 2: SKILL.md と usage-contract.md の gh_commands 実装状況が矛盾している

    現行 SKILL.md の gh_commands 行は、github_research のみ完全実装済みで、local_asset_research / proposal_only は設計済み・別Issue実装と読める記述になっています。 しかし usage-contract.md では、github_research、local_asset_research、proposal_only の gh_commands は完全実装済みとされ、no_tools / grounded_research は非対応と整理されています。

    #249 で timeout_sec 行だけを直すと、この隣接する契約ズレが残ります。SKILL.md は呼び出し側が最初に見る早見表なので、ここを放置すると AI エージェントが古い前提で request を作ります。

    High 1: #249 の VC は false pass しやすい

    #249 の VC は github_research.*gh_commands.*300 系の grep で、表の timeout_sec 行に正しく入ったか、Core Rules のどこに入ったか、timeout_sec の意味が正確に説明されたかを検証できません。

    最低でも section-anchored VC にして、リクエスト JSON 早見表 の timeout_sec 行、および Core Rules の gh_commands 近傍を個別に検証するべきです。

    High 2: #104 の Antigravity 移行と衝突しない表現にする必要がある

    #104 では、Gemini CLI から Antigravity CLI への段階移行が parent tracker 化され、初期 agy provider 対応は no_tools / proposal_only に限定し、github_research などは後続扱いとされています。 公式 Gemini CLI docs でも、unpaid tier / Google One ユーザー向け Gemini CLI は Antigravity CLI に置換される旨が案内されています。(Gemini CLI)

    そのため #249 の修正は「Gemini CLI 固有の新機能追加」ではなく、現行 wrapper contract の運用注意・バグフィックスとして書くべきです。これは #104 の「Gemini CLI 新機能 freeze」と矛盾しません。

    Medium: gh api GET-only 契約は正しいが、docs 側で理由を短く補強するとよい

    現行実装は gh api の -f / -F / --input を read-only 経路から弾いています。これは GitHub CLI 公式仕様上、field parameter を追加すると既定 method が POST に切り替わり、GET query にするには --method GET が必要だから妥当です。(GitHub CLI)

    timeout_sec とは別件ですが、gh_commands 近傍を触るなら「gh api は GET-only、-f/-F は POST 化し得るため禁止/制御」という理由を 1 行だけ明記すると、将来の回帰を減らせます。

    まとめて実装するなら、この範囲が妥当

    扱い Issue / PR 判断
    Close #249 主対象。timeout guidance を修正する
    Refs #14 同一 SKILL.md の契約整合。全部は閉じない
    Refs #87 #249 の発見元。timeout 事象の背景として参照
    Refs #104 Antigravity 移行と Gemini CLI freeze 方針に抵触しないことを確認
    Refs PR #81 外部 CLI transport の過大安全主張・契約境界の教訓として参照。PR #81 は ACP transport で境界設計と runtime evidence を #112/#113 に分けた経緯があります。
    Do not close #104 parent tracker。#249 の修正で閉じる対象ではない
    Do not bundle #112 / #113 ACP safety / runtime evidence。timeout docs と別スコープ

    推奨パッチ方針

    最小修正、docs-only

    SKILL.md の timeout_sec 行を次の意味にする。

    | `timeout_sec` | 任意 | 省略時は wrapper の既定値。`grounded_research` 使用時は 300 秒以上を推奨。`github_research` / `local_asset_research` / `proposal_only` で `gh_commands` を指定する場合も 300 秒以上を推奨する。`gh_commands` は Gemini 実行前に wrapper が read-only `gh` コマンドを事前実行し、その結果を `inline_context` に prepend するため、外部 API レイテンシと prompt 増加により 120 秒では不足しやすい。なお `timeout_sec` は主に Gemini CLI 実行フェーズの timeout であり、wrapper 全体の wall-clock 予算は `gh_commands` 件数・各 `gh` 実行 timeout・retry/backoff を含めて別途余裕を取る。 |

    さらに gh_commands 行を usage-contract.md と揃える。

    | `gh_commands` | 任意 | `[{ "argv": [...] }]` 形式の argv ベースコマンドリスト。wrapper が事前実行し結果を `inline_context` に prepend する general field。`github_research` / `local_asset_research` / `proposal_only` で実装済み。`no_tools` / `grounded_research` では非対応。profile ごとの deny/fail/warn 挙動は `references/usage-contract.md` を正本とする。 |

    品質優先なら、runtime warning まで入れる

    #249 の現契約は docs-only ですが、実効性を上げるなら Allowed Paths を広げて run_gemini_headless.py と tests も触るべきです。

    追加ロジックの趣旨:

    gh_commands = request.get("gh_commands")
    if (
        tool_profile in {GITHUB_RESEARCH_PROFILE, LOCAL_ASSET_RESEARCH_PROFILE, PROPOSAL_ONLY_PROFILE}
        and isinstance(gh_commands, list)
        and gh_commands
        and isinstance(_timeout_raw, (int, float))
        and _timeout_raw < 300
    ):
        request_warnings.append(
            f"{tool_profile} with gh_commands recommends timeout_sec >= 300 "
            f"(got {_timeout_raw}); gh_commands are pre-executed and prepended to inline_context"
        )

    これは #249 の Out of Scope を超えるため、やるなら #249 本文を更新して Allowed Paths に以下を追加します。

    allowed_paths:
      - .claude/skills/gemini-cli-headless-delegation/SKILL.md
      - .claude/skills/gemini-cli-headless-delegation/scripts/run_gemini_headless.py
      - .claude/skills/gemini-cli-headless-delegation/tests/

    修正版 AC / VC 案

    ## Acceptance Criteria
    
    - [ ] AC1: `SKILL.md` のリクエスト JSON 早見表 `timeout_sec` 行に、`github_research` / `local_asset_research` / `proposal_only` + `gh_commands` 使用時は `timeout_sec: 300+` 推奨であることが明記されている
    - [ ] AC2: 同じ記述に、`gh_commands` 事前実行・`inline_context` prepend・GitHub API レイテンシ・prompt 増加が timeout 不足の理由として明記されている
    - [ ] AC3: `timeout_sec` は wrapper 全体の wall-clock 予算ではなく、Gemini CLI 実行フェーズ中心の timeout であり、`gh_commands` 実行時間は別途 wall-clock 余裕に含める必要があることが明記されている
    - [ ] AC4: `SKILL.md` の `gh_commands` 行が `usage-contract.md` と整合し、実装済み profile が `github_research` / `local_asset_research` / `proposal_only`、非対応 profile が `no_tools` / `grounded_research` と記載されている
    # AC1-AC3: timeout_sec 行に github_research/local_asset/proposal + gh_commands + 300 + 根拠がある
    python3 - <<'PY'
    from pathlib import Path
    p = Path(".claude/skills/gemini-cli-headless-delegation/SKILL.md")
    text = p.read_text(encoding="utf-8")
    row = next(line for line in text.splitlines() if line.startswith("| `timeout_sec` "))
    required = [
        "github_research",
        "local_asset_research",
        "proposal_only",
        "gh_commands",
        "300",
        "inline_context",
        "prepend",
        "wall-clock",
    ]
    missing = [s for s in required if s not in row]
    assert not missing, f"timeout_sec row missing: {missing}"
    print("PASS: timeout_sec row is explicit enough")
    PY
    
    # AC4: gh_commands 行の実装済み/非対応 profile 整合
    python3 - <<'PY'
    from pathlib import Path
    p = Path(".claude/skills/gemini-cli-headless-delegation/SKILL.md")
    text = p.read_text(encoding="utf-8")
    row = next(line for line in text.splitlines() if line.startswith("| `gh_commands` "))
    required = ["github_research", "local_asset_research", "proposal_only", "no_tools", "grounded_research", "usage-contract.md"]
    missing = [s for s in required if s not in row]
    assert not missing, f"gh_commands row missing: {missing}"
    print("PASS: gh_commands row aligns with usage-contract")
    PY
    
    pnpm typecheck
    pnpm lint
    pnpm test
    pnpm build
    uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/

    実装指示として使うなら

    そのまま AI エージェントへ渡すなら、こう書くのが安全です。

    Issue #249 を実装する。ただし #249 単独の timeout 文言追加に留めず、同じ SKILL.md 早見表内の gh_commands 実装状況を usage-contract.md と整合させる。
    
    必須:
    - Closes #249
    - Refs #14 #87 #104 #81
    - `timeout_sec` 行に `github_research` / `local_asset_research` / `proposal_only` + `gh_commands` 使用時の `timeout_sec: 300+` 推奨を追加
    - 根拠として `gh_commands` 事前実行、`inline_context` prepend、GitHub API レイテンシ、prompt 増加を明記
    - `timeout_sec` が wrapper 全体 wall-clock ではなく Gemini CLI 実行フェーズ中心である点を明記
    - `gh_commands` 行を `usage-contract.md` と整合させ、実装済み profile / 非対応 profile を正しく更新
    - #104 の Gemini CLI freeze と衝突しないよう、新機能追加ではなく現行 contract の docs 修正として扱う

    この束ね方なら、#249 の実害を直しつつ、#14 の大きすぎるスコープに飲み込まれず、#104 の Antigravity 移行とも矛盾しません。

  3. changed the title [-]実装: gemini-cli-headless-delegation SKILL.md に github_research + gh_commands 使用時の timeout_sec: 300+ 推奨を追記する[/-] [+]実装: gemini-cli-headless-delegation SKILL.md の timeout_sec 推奨追記と gh_commands 記述整合[/+] on May 23, 2026
  4. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: 本文更新 (iteration 0)

    変更概要:

    • anchor comment (OWNER) の敵対的レビュー (Blocker 1: timeout_sec wall-clock 説明不足、Blocker 2: SKILL.md vs usage-contract.md gh_commands 矛盾) を反映
    • AC を 2件 → 4件に拡充 (timeout_sec 精確性・gh_commands 整合を追加)
    • VC を section-anchored Python script 形式に更新 (grep マッチ精度向上)
    • In Scope に gh_commands usage-contract.md 整合を追加
    • Outcome を両変更を反映した記述に更新
    • タイトルを拡張スコープに合わせて更新

    事実確認結果:

    • C1 (run_gemini_headless.py timeout=30): supported
    • C2 (SKILL.md vs usage-contract.md 矛盾): supported (矛盾を確認)
    • C_ext1-3 (Python/GitHub CLI/Gemini CLI 外部仕様): all supported

    anchor_comment: #249 (comment)

  5. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: VC フォーマット修正 (iteration 1)

    • C4 fix: bare コマンド行に - ハイフンプレフィックスを追加
    • C5 fix: # AC1-AC3: 範囲アンカーを # AC1: / # AC2: / # AC3: 個別アンカーに分割
  6. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: 完了 (2026-05-23T05:00:00Z)

    改善履歴

    iteration 0 (anchor comment feedback 反映):

    • タイトルを拡張スコープに合わせて更新
    • AC を 2件 → 4件に拡充 (AC3: timeout_sec wall-clock 区別、AC4: gh_commands profile 整合)
    • VC を section-anchored Python script 形式に更新
    • In Scope に gh_commands usage-contract.md 整合を追加
    • Outcome を両変更 (timeout_sec + gh_commands) を反映した記述に更新
    • Out of Scope に runtime warning 実装 (別 Issue) を追加

    iteration 1 (VC フォーマット修正):

    • C4 fix: bare コマンド行に - ハイフンプレフィックスを追加
    • C5 fix: # AC1-AC3: 範囲アンカーを # AC1: / # AC2: / # AC3: 個別アンカーに分割

    事実確認結果 (codebase-investigator + web-researcher)

    Claim Verdict
    C1: run_gemini_headless.py が gh_commands を subprocess.run(timeout=30) で実行 supported ✓
    C2: SKILL.md の gh_commands 行と usage-contract.md の矛盾 supported ✓ (矛盾を確認・In Scope に追加)
    C3: SKILL.md timeout_sec 行の github_research+gh_commands 推奨欠落 supported ✓
    C_ext1: Python subprocess.run の child process kill 挙動 supported ✓
    C_ext2: GitHub CLI -f/-F → POST 切り替え supported ✓
    C_ext3: Gemini CLI → Antigravity CLI 移行案内 supported ✓

    次アクション

    • issue-contract-review を実行して実装着手 preflight を完了させてください
    • 派生改善候補 (runtime warning ロジック実装) については終了コメントを参照
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      follow_up_issues: []
      note_only_observations:
        - dedupe_key: "gemini-cli-headless-delegation-runtime-timeout-warning-gh-commands"
          source_url: "https://github.com/squne121/loop-protocol/issues/249#issuecomment-4524192530"
          source_note_id: "anchor_comment_quality_option"
          summary: "run_gemini_headless.py に gh_commands + timeout_sec < 300 時の runtime warning を追加する実装 Issue。anchor comment の「品質優先」オプションとして提示。#249 の Out of Scope に明記済みのため、別途 Issue 起票が必要か人間判断を推奨。"
  7. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    follow-up Issue 起票完了

    refinement-loop 終了後の派生改善候補を起票しました:

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      follow_up_issues:
        - request_dedupe_key: "gemini-cli-headless-delegation-runtime-timeout-warning-gh-commands"
          issue_number: 258
          issue_url: "https://github.com/squne121/loop-protocol/issues/258"
          status: created
      note_only_observations: []
  8. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-05-23T05:30:00Z)

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: 2026-05-23T05:30:00Z
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/249
      checks:
        template_compliance: pass
        state_label: warning(non-blocking)  # state/queued 不在。phase/implementation + agent/implementer は存在。着手を blocking しない
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: true
          vc_failed_as_expected: 2
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          classifications:
            - ac: AC1-AC3
              command: "python3 - <<'PY' (timeout_sec row assertion)"
              exit_code: 1
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: "missing from row: ['github_research', 'local_asset_research', 'proposal_only', 'gh_commands', 'inline_context', 'prepend', 'wall-clock']"
              decision: go
            - ac: AC4
              command: "python3 - <<'PY' (gh_commands row assertion)"
              exit_code: 1
              category: expected_baseline_fail
              confidence: high
              evidence:
                stdout_excerpt: "missing from row: ['no_tools', 'grounded_research']"
              decision: go
        ac_verifiability: pass
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings:
        - "state/queued ラベル不在(非 blocking)"
        - "check_blockers.sh が 'コンフリクトリスクがある場合は Depends on #14 merge として...' の条件付き文言を fallback 検出。native API はブロッカーなし(0 件)。#14 に open PR なし・SKILL.md への未コミット変更なしを確認済み。偽陽性として warning に降格。"
    • Outcome: SKILL.md リクエスト JSON 早見表の timeout_sec 行に github_research/local_asset_research/proposal_only + gh_commands 使用時の timeout_sec: 300+ 推奨と wall-clock 区別を追記し、gh_commands 行を usage-contract.md と整合させる
    • Acceptance Criteria: AC1(timeout_sec + 300+ 推奨)/ AC2(理由明記)/ AC3(wall-clock 区別)/ AC4(gh_commands profile 整合)
    • Verification Commands: Python assert(AC1-3 timeout_sec row)+ Python assert(AC4 gh_commands row)+ pnpm typecheck/lint/test/build + uv run pytest
    • Allowed Paths: .claude/skills/gemini-cli-headless-delegation/SKILL.md
    • Worktree: .claude/worktrees/issue-249-gemini-cli-headless-delegation-skill-md-
    • Branch: worktree-issue-249-gemini-cli-headless-delegation-skill-md-
    • VC preflight: baseline fail = 2, 想定外 pass = 0, 実行不可 = 0
  9. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-05-23T05:11:57Z)

    • PR: docs(#249): SKILL.md の timeout_sec 推奨追記と gh_commands 記述整合 #262
    • Worktree: .claude/worktrees/issue-249-gemini-cli-headless-delegation-skill-md-
    • Branch: worktree-issue-249-gemini-cli-headless-delegation-skill-md-
    • Verification: AC1-AC4 全件 PASS / typecheck: PASS / lint: PASS / test: PASS (4 files, 5 tests) / build: PASS / pytest: PASS (397 tests)
    • 後続: PR レビュー(pr-review-judge)→ マージ → post-merge-cleanup
  10. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-05-23T05:35:00Z)

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      follow_up_issues: []
      note_only_observations: []
  11. added a commit that references this issue on May 23, 2026
  12. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-05-23T06:00:00Z)

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      follow_up_issues:
        - request_dedupe_key: "gemini-skill-md-thin-routing-redesign"
          issue_number: TBD
          status: pending_creation
      note_only_observations: []
  13. added a commit that references this issue on May 23, 2026
  14. squne121 commented on May 23, 2026

    @squne121
    OwnerAuthor

    post-merge-cleanup: 完了 (2026-05-23T06:10:00Z)

    • status: ok
    • 次アクション: なし(親 Issue なし・superseded PR なし)

    実施内容

    • worktree .claude/worktrees/issue-249-gemini-cli-headless-delegation-skill-md- 削除済み
    • branch worktree-issue-249-gemini-cli-headless-delegation-skill-md- 削除済み
    • main を origin/main に整合済み(merge commit: 68e6d6c)
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      follow_up_issues:
        - request_dedupe_key: "follow-up:squne121/loop-protocol:pr/262:check_blockers_false_positive"
          issue_number: 265
          issue_url: "https://github.com/squne121/loop-protocol/issues/265"
          status: created
    
        - request_dedupe_key: "follow-up:squne121/loop-protocol:pr/262:refinement_loop_queued_label"
          issue_number: 267
          issue_url: "https://github.com/squne121/loop-protocol/issues/267"
          status: created
          note: "state/queued 自動付与は #211 で停止済み。代わりに issue-contract-review の obsolete warning を除去する Issue として起票"
    
        - request_dedupe_key: "follow-up:squne121/loop-protocol:pr/262:impl_review_loop_contract_snapshot_fallback"
          issue_number: 266
          issue_url: "https://github.com/squne121/loop-protocol/issues/266"
          status: created
    
        - request_dedupe_key: "gemini-skill-md-thin-routing-redesign"
          issue_number: 264
          issue_url: "https://github.com/squne121/loop-protocol/issues/264"
          status: created
          note: "impl-review-loop 終了時に起票済み"
    
      note_only_observations: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions