Skip to content

fix(agents): allow gh api reads that pass --allow-escape-sequences - #265

Merged
furedea merged 1 commit into
mainfrom
fix/allow-read-only-gh-api
Oct 21, 2026
Merged

furedea merged 1 commit into
mainfrom
fix/allow-read-only-gh-api

Conversation

@furedea-agent

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

Copy link
Copy Markdown
Contributor

概要

CI ログを読む gh api --allow-escape-sequences <endpoint> が,読み取り専用の gh api ルールに載っておらず,毎回確認を求められていました.このフラグをエンドポイントの前後どちらでも許可します.

変更内容

  • agents/hooks/rules/allowed_commands.json の汎用 gh api パターンに --allow-escape-sequences を追加(エンドポイントの前に任意で 1 つ,後ろのオプション列にも可).
  • tests/agents/hooks/test_allowed_gh_api.py を新設し,許可・ask 双方の回帰テストを追加(既存テストファイルが 500 行上限に近いため分離).

調査結果

  • 二重引用符で囲んだ展開を含むエンドポイント("repos/o/r/contents/$f")や -q '.jobs[0].id' は,すでに許可されていました.
  • 引用なしの展開(repos/o/r/actions/jobs/${J%% *}/logs,contents/$f)は単語分割で引数を注入できるため,従来どおり確認を求めます.レーンは二重引用符で囲めば通ります.

検証

  • 許可: 引用付き変数のジョブログ取得,--allow-escape-sequences の前置・後置,引用付き変数の raw ファイル取得(ファイルへのリダイレクト付き),-q 付きジョブ ID 取得.
  • ask: 引用なし変数( -X DELETE を含む値を含む),-X/--method(エンドポイントの前後),-f/-F/--raw-field,--input(前後),graphql,"$@" や $(...) の追加引数,eval 経由.
  • uv run --frozen pytest tests/agents: 1801 passed.pre-commit(ruff,file-length ほか): 全件通過.

Closes #263

🤖 Generated with Claude Code

CI log reads use `gh api --allow-escape-sequences <endpoint>`, a flag the
read-only gh api rule did not list, so every such call asked. Accept it
before or after the endpoint. Quoted expansions in the endpoint and -q
filters already passed; unquoted expansions, -X/--method, fields, --input,
and graphql still ask, and regression tests pin both sides.

Refs #263

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea
furedea merged commit c119608 into main Oct 21, 2026
11 checks passed
@furedea
furedea deleted the fix/allow-read-only-gh-api branch October 21, 2026 10:27
furedea added a commit that referenced this pull request Nov 21, 2026
…487)

agent-config を 0.4.0,agent-harness を 0.9.15 に上げる.T3 で lane
を回す仕組みと,Antigravity の provider・hook adapter が入る.Antigravity の hook
の配線と有効化は別の PR.

| 入力 | 変更前 | 変更後 |
| --- | --- | --- |
| `agent-config` | `3dfa0ad8`(0.3.1 後) | `51f91f9a`(v0.4.0) |
| `agent-harness` | `83caaa98`(0.9.14) | `c5b13036`(0.9.15) |

- [ ] CI
- [ ] 反映後,`~/.claude/settings.json` の `sandbox.excludedCommands` に `t3
thread *` がある
- [ ] 反映後,`delegation` skill が Claude と Codex に入っている

<details>
<summary>内容と出典</summary>

- agent-config 0.4.0:`t3 thread` の guard(#265),T3 の lane worktree
の片付け(#266),`delegation` skill(#268),ADR-0028(#267),Antigravity の hook
adapter(#263).furedea/agent-config#264
- agent-harness 0.9.15:Antigravity
provider(furedea/agent-harness#257).`programs.agent-harness.antigravity`
は未設定なので,この PR では Antigravity の設定は作られない想定
- 変更は `flake.lock` のみ

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: furedea <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

Let read-only gh api calls with variables pass without approval

1 participant