Repository navigation
fix: AGY OAuthトークンのisolated workspace内symlink配置先をHOME配下に修正する - #1746
Merged
squne121 merged 1 commit intoJul 25, 2026
Merged
Conversation
`_expose_agy_oauth_token_read_only()` の symlink 配置先を、isolated workspace の `XDG_CONFIG_HOME` 配下(`<isolated>/xdg-config/antigravity-cli/antigravity-oauth-token`) から isolated workspace 自身の `HOME` 配下 (`<isolated HOME>/.gemini/antigravity-cli/antigravity-oauth-token`)に修正する。 `agy` バイナリはこのファイルを `$HOME/.gemini/antigravity-cli/` から直接読み込むため、 `XDG_CONFIG_HOME` 配下への配置(#1740 の実装バグ)では symlink 自体は正常に作成されても `agy -p` は `agy_auth_required` で失敗し続けていた。#1494 の 4 回目の live fan-out 試行時の control-plane 診断(値は一切読まず symlink 到達性のみで検証)で、配置先を isolated HOME に 変更すれば成功することを確認済み。 - `materialize_isolated_agy_workspace()` の呼び出し引数を `xdg_config` から `workspace_dir` に変更 - `_expose_agy_oauth_token_read_only()` のパラメータ名を `xdg_config_home` から `isolated_home` に変更 - `test_agy_permission_policy_oauth_token.py` の既存アサーションを正しい配置先 (HOME 配下)に更新し、XDG_CONFIG_HOME 配下に作成されないことの否定アサーションを追加 - `agy -p` を模擬した軽量 subprocess smoke test を追加(reachability integration test 拡張) - `references/runtime-portability.md` の誤った配置先記述を修正 Closes #1743 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
Preview URLPreview removed (PR #1746 closed). |
squne121
commented
Jul 25, 2026
squne121
left a comment
Owner
Author
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, merge_state_status=CLEAN (ahead_by=1, behind_by=0 vs main)
Evidence Check
- CI:
ci_verdict_summary.py --pr 1746 --expected-head-sha 387db8e59bd2b10a4fd25527b1a45d08776fe06e→status: all_pass,failed_checks: [],pending_checks: [],stale_checks: [], head_sha matches expected. 13 exercised checks pass (typecheck/lint/test/build/e2e/python-test/node-backed-hook-tests/actionlint/deploy-pr/validate-generated-artifact/check-hook-integrity/PR Body Japanese Check/ci-verdict-summary); 5 correctly excluded as skipped (deploy-main, retrospective Japanese checks, cleanup-pr). - Allowed Paths: PR changed files (via
gh api repos/.../pulls/1746/files) = exactly.claude/skills/gemini-cli-headless-delegation/{references/runtime-portability.md, scripts/agy_permission_policy.py, tests/test_agy_permission_policy_oauth_token.py}, all 3 inside Issue #1743's 4-item Allowed Paths list (the conditional 4th pathtest_preflight_agy_oauth_token.pycorrectly left untouched — PR body confirms it was executed and still passes). No renames, no scope creep. - AC coverage (Issue #1743 AC1-AC9): PR body
## AC mappingtable maps each AC to concrete code/test changes; independently confirmed by reading the actual diff:- AC1/AC2:
_expose_agy_oauth_token_read_only(xdg_config_home)→_expose_agy_oauth_token_read_only(isolated_home),link_dir = isolated_home / ".gemini" / ANTIGRAVITY_CLI_DIRNAME, call site_expose_agy_oauth_token_read_only(workspace_dir). Test assertsworkspace.agy_oauth_token_path == Path(workspace.env["HOME"]) / ".gemini" / "antigravity-cli" / "antigravity-oauth-token"and a new negative assertion that the old XDG_CONFIG_HOME path does not exist. - AC3: no-op-when-absent test updated to assert absence under the new HOME-based path.
- AC4: existing
Path.open/read_text/read_bytesguard test unchanged (still content-blind). - AC5: tool-deny-matrix regression test unchanged/independent of this change.
- AC6: credential-leak test unchanged, still passes against new path.
- AC7:
test_agy_oauth_token_reachability_integrationextended with a realsubprocess.runsmoke test (HOME redirected to isolated HOME) assertingLOOP_AGY_ISOLATED_SMOKE_OKstdout marker and returncode 0 — genuine existence-check-only reachability proof, not a placeholder. - AC8: independently verified via
git show <PR head>:.../runtime-portability.md | grep -c "xdg-config/antigravity-cli/antigravity-oauth-token"→0(stale string fully removed). - AC9:
test_agy_permission_policy_oauth_token.pyfull file included inpython-testCI job (943 tests in.claude/skills/gemini-cli-headless-delegation/tests/per PR body, CI green).
- AC1/AC2:
- 検証コマンド結果: PR body Verification Results block reproduces each VC with pass counts; cross-checked independently (CI green, AC8 rg re-run, files-changed re-run) rather than trusted as self-report alone.
- Schema Change Applicability:
not_schema_change— accurate;_expose_agy_oauth_token_read_only()is a private function, only its parameter name/placement logic changed,IsolatedAgyWorkspace.agy_oauth_token_pathfield name/type unchanged. - Safety Claim Matrix: present (required — path is under
.claude/skills/gemini-cli-headless-delegation/, credential-adjacent). All "Not controlled" rows scoped to the explicitly out-of-scope liveagy -pexecution, tracked to parent #1494. Claims match test evidence (content-blind symlink ops, deny-matrix unaffected, no credential leakage, isolated-tree containment). - Scope Collision: Issue #1743 documents an
overlap_readback_waiverfor candidate #1736 (bulk-list readback artifact) with direct-readback justification and explicit disjoint reasoning for #14/#55; reasoning is sound and file-level Allowed Paths scoping limits actual collision risk.
Blockers
- なし
Non-blockers
- なし
LOOP_VERDICT_V2
LOOP_VERDICT_V2:
verdict: APPROVE
reviewed_head_sha: "387db8e59bd2b10a4fd25527b1a45d08776fe06e"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
squne121
marked this pull request as ready for review
July 25, 2026 11:30
squne121
deleted the
worktree-issue-1743-agy-oauth-isolated-workspace-symlink-xdg
branch
July 25, 2026 11:30
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_expose_agy_oauth_token_read_only()が作成する agy OAuth トークンの symlink 配置先を、isolated workspace の
XDG_CONFIG_HOME配下(<isolated>/xdg-config/antigravity-cli/antigravity-oauth-token)から、isolated workspace 自身の
HOME配下(
<isolated HOME>/.gemini/antigravity-cli/antigravity-oauth-token)に修正する。実際の
agy(Antigravity CLI)バイナリはこのファイルを$HOME/.gemini/antigravity-cli/から直接読み込んでおり、
$XDG_CONFIG_HOMEを一切参照しない。#1740 の実装(PR #1742、merge commit60b2d9ad3cac4540c6ba397e9966ca50c1d93df4)は誤ってXDG_CONFIG_HOME配下へ配置していたため、symlink 自体の作成には成功していても、isolated workspace 内の
agy -pはagy_auth_requiredで失敗し続けていた。親研究 Issue #1494 の最終 live E2E fan-out 実行(4 回目の試行)における
control-plane 診断(値は一切読まず symlink 到達性のみで検証)で、配置先を isolated
HOMEに変更すれば
agy -pが成功することを確認済みであり、本 PR はその診断結果に基づく直接のバグ修正。Closes #1743(本 PR のマージで Issue #1743 を close する)
Issue Contract(Issue 契約情報)
60b2d9ad3cac4540c6ba397e9966ca50c1d93df4)AC mapping(AC 対応表)
<isolated HOME>/.gemini/antigravity-cli/antigravity-oauth-tokenに作成し、XDG_CONFIG_HOME配下には作成しない_expose_agy_oauth_token_read_only()をisolated_homeパラメータへリネームし配置先ロジックを変更test_agy_oauth_token_exposed_read_only(HOME一致 + XDG_CONFIG_HOME非存在の否定アサーション追加)agy_oauth_token_pathがPath(workspace.env["HOME"]) / ".gemini" / "antigravity-cli" / "antigravity-oauth-token"と一致するtest_agy_oauth_token_exposed_read_only$HOMEにトークンファイルが存在しない場合は no-op でワークスペース生成は失敗しない_real_home_agy_oauth_token_file()がNoneを返す分岐)は変更なし、テストのみ HOME 配下の非存在確認に更新test_expose_agy_oauth_token_noop_when_absentPath.is_file()/Path.symlink_to()/Path.exists()のみで、ファイル内容を一切 open/read しないtest_expose_agy_oauth_token_never_reads_content(monkeypatch でPath.open/read_text/read_bytesを guard)no_tools/local_asset_researchの tool deny matrix が全 deny のまま_expose_agy_oauth_token_read_only()と独立)test_tool_deny_matrix_unaffected_by_agy_oauth_token_exposurefind_credential_like_files()/settings.jsonのいずれにも出現しないtest_agy_oauth_token_value_never_leakedenv["HOME"]を実行時 HOME としたagy -p相当の軽量 smoke test が、修正後の配置先構造を検証するtest_agy_oauth_token_reachability_integrationを拡張し、HOMEを isolated workspace の HOME に redirect した subprocess でLOOP_AGY_ISOLATED_SMOKE_OKmarker を返す existence-check-only smoke script を実行test_agy_oauth_token_reachability_integrationreferences/runtime-portability.mdに誤った配置先文字列が残存していないrg -c "xdg-config/antigravity-cli/antigravity-oauth-token" references/runtime-portability.md→ exit 1(0 件)test_agy_permission_policy_oauth_token.py全体 /test_preflight_agy_oauth_token.pyが本修正後も PASSVerification Results(検証結果)
Runtime Verification Applicability
decision: not_applicable(本 Issue は hermetic pytest のみで完結する。liveagy -p実行による最終 E2E 確認は Out of Scope であり、親研究 Issue #1494 側の最終 fan-out run に委ねる)。
Checks
pnpm typecheckPASSpnpm lintPASSpnpm testPASS(1727 tests)pnpm buildPASS.claude/skills/gemini-cli-headless-delegation/tests/全体(943 tests)で回帰なしを確認Schema Change Applicability
_expose_agy_oauth_token_read_only()は private(先頭_)関数であり、パラメータ名xdg_config_home→isolated_homeのリネームと呼び出し引数の変更のみ。IsolatedAgyWorkspaceデータクラスのフィールド名・型は変更しておらず、
agy_oauth_token_pathフィールドが指す値(symlink の配置先パス)が変わるのみで、公開スキーマ(key/型/構造)の変更はない。
Schema Consumer Inventory
N/A(Schema Change Applicability: not_schema_change のため、consumer inventory は対象外)。
Safety Claim Matrix
safety-sensitive パス(
.claude/skills/gemini-cli-headless-delegation/配下)を変更するため、以下に安全性主張を記載する。
Path.is_file()/Path.symlink_to()/Path.exists()のみで、agy OAuth トークンファイルの内容を一切 open/read しない(配置先変更後も不変)test_expose_agy_oauth_token_never_reads_content(Path.open/read_text/read_bytesを monkeypatch で guard し content-access を検出したら AssertionError)no_tools/local_asset_research全 deny、grounded_researchallowlist 限定)は配置先変更後も不変test_tool_deny_matrix_unaffected_by_agy_oauth_token_exposure(4 profile 全件)fake-token-value/ya29.FAKE_AGY_OAUTH_SECRET_TOKEN_VALUE_...等)がworkspace.env/settings.json/ repr /find_credential_like_files()のいずれにも出現しないtest_agy_oauth_token_value_never_leakedHOME/XDG_CACHE_HOME/XDG_STATE_HOMEの tmp workspace への差し替えは配置先変更後も維持される(.ssh/.netrc等、real$HOMEの他ファイルは引き続き到達不能)test_expose_agy_oauth_token_minimal_subpath_onlyagy -pバイナリ実行による live 認証成功の最終確認Allowed Paths compliance(許可パス遵守状況)
変更ファイルは Issue #1743 の Allowed Paths と完全一致(3 ファイル、
test_preflight_agy_oauth_token.pyは配置先変更の影響を受けないため不使用)。
.claude/skills/gemini-cli-headless-delegation/scripts/agy_permission_policy.py✅ Allowed Paths 内.claude/skills/gemini-cli-headless-delegation/tests/test_agy_permission_policy_oauth_token.py✅ Allowed Paths 内.claude/skills/gemini-cli-headless-delegation/references/runtime-portability.md✅ Allowed Paths 内test_preflight_agy_oauth_token.pyは変更不要と判断し未変更(Allowed Paths の「配置先変更に伴う修正が必要な場合のみ」条件に該当しなかったため)。実際に実行して 5 tests 全て PASS のままであることを確認済みScope Collision Evidence(スコープ衝突証跡)
check_implementation_overlap.py(--limit 2000)の route はhuman_review_requiredを返すが、これは bulk-list(
gh issue list)経由の readback で候補 #1736 の## Outcome/## In Scopeが欠落と誤判定される既知の artifact(
readback_incomplete_missing_outcome_or_in_scope)に起因する。gh issue view 1736 --json bodyによる直接 readback では両見出しとも存在しており(1 行目## Outcome、57 行目## In Scope)、内容は delegation contract Skill の分離・quota-onlyfallback gate の新設が対象であり、
_expose_agy_oauth_token_read_only()/materialize_isolated_agy_workspace()への言及は一切ない(symlink 配置先バグとは意味的に disjoint)。Issue #1743 本文の「Scope Collision 判断」節にこの判断が既に記載されており、加えて
open-prのgeneric overlap readback waiver 機構(Issue #1509)に基づく
overlap_readback_waiverブロックをIssue #1743 本文(
## Overlap Readback Waiver)に self-declare 済み。もう一方の候補 #55 はpolicy_class: C1、readback_complete: trueで構造的シグナルも disjoint と確認済み(
ordinal_ac_id_only、AC ID の numbering 一致のみで意味的関連なし)。Secrets / Billing Non-use(秘密情報・課金の不使用)
値そのものを読み取る・出力する変更ではない(
Path.symlink_to()によるパス文字列の書き込みのみ)agy -pの実行は本 PR の検証範囲に含まない。hermetic pytest と subprocess smoke test(既存プロセス起動のみ、外部通信なし)のみ)
Notes
60b2d9ad3cac4540c6ba397e9966ca50c1d93df4)agy -p認証成功の最終確認を行う)