Skip to content

実装: Claude-GPT 起動時・statusLine で upstream CLI・proxy・モデル更新を非ブロッキング通知する #2773

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "Claude-GPT を使っている時だけ upstream CLI/proxy/model 更新を人間へ通知し、Native Claude Code には通知・checker・設定差分を一切持ち込まない"
change_kind: code
dedupe_key: "claude-gpt:upstream-update-advisory:claude-gpt-only:2026-09-26"

Parent Issue / Related Work

なし。#2772 は今回の GPT-6 Sol/Astra/Luna model adoption と Auto classifier の Luna 復帰。本 Issue は次回以降の upstream/model update の取り残しを防ぐ Claude-GPT 専用 notification。#2577 の model/effort research とも別 outcome。

Outcome

scripts/claude-gpt/launch.sh から起動した Claude-GPT だけが、次の2箇所で upstream update を把握できる。

  1. 起動ターミナル: cached な更新がある場合、launcher が短い update notice を terminal-visible な stderr へ一度出す。stdout は --check-only JSON や claude -p output の contract を壊さない。
  2. Claude-GPT status line: launcher-owned --settings にだけ statusLine を追加し、既存 Task Context status line の表示を保持したまま cached update marker を末尾に足す。status line renderer 自体は network を行わない。

plain Native claude は現行の repository .claude/settings.json の Task Context status line をそのまま使用し、update checker を起動せず、update cache を読まず、update notice を一切表示しない。

Current Validated Scope

調査日: 2026-09-26。参照 main: be5121f24ab7c25efdd3d9b2a3e95a2c13c9b7b7。実装開始時に latest main / related PR を再確認する。

  • project .claude/settings.json は現在 statusLine.command = python3 ${CLAUDE_PROJECT_DIR}/.claude/hooks/task_context/statusline.py を持つ。Native Claude はこれを利用する。
  • Claude-GPT launcher は独自 $CLAUDE_GPT_HOME/claude/settings.local.json を毎回生成し、Claude を --settings <that-file> 付きで起動するが、その generated settings は現在 statusLine を持たない。このため現状は project status line を継承している。
  • Claude Code の official settings precedence では command-line --settings <file-or-json> は local/project/user より高優先度で、指定した key だけを上書きし、省略した key は lower layer を保持する。したがって generated Claude-GPT settings にだけ statusLine を置けば、Native project settings を編集せず Claude-GPT の scalar statusLine だけを差し替えられる。
  • current Task Context statusline.py は stdin JSON を読み、read-only query だけを行う。update wrapper はこの既存表示を再利用し、Task Context を再実装しない。
  • launch.sh は stdout を structured/headless output 用に使うため、起動 update notice は stderr を使用する。

Design

1. Native Claude を完全に対象外にする

  • .claude/settings.json、.claude/settings.local.json、Native user settings、Native hooks、Native status line rendererへ update notification の設定・hook・条件分岐を追加しない。
  • Native 用 opt-in 設定例も本 Issue では提供しない。
  • update checker の起動元は scripts/claude-gpt/launch.sh のみ。
  • Claude-GPT を示す ambient heuristic だけに依存せず、launcher が生成する専用 --settings と CLAUDE_GPT_HOME が notification authority。

2. Upstream metadata checker

新規 scripts/claude-gpt/upstream_updates.py は model inference を使わない短命 metadata checker とする。

区別して保存/表示する:

  • selected local Claude binary/version
  • selected local claude-code-proxy absolute path/version
  • upstream released stable version/date
  • released proxy model registry の差分
  • OpenAI official model announcement/update metadata(取得可能な current stable source)
  • repository model policy の既知 ID
  • account entitlement は actual model smoke を行わない限り unknown。notification checker 自体は quota を使う model request を送らない。

古い local /v1/models だけを監視しない。remote released proxy registry と official model release の双方から、local proxy 更新前でも新 model を発見できるようにする。取得不能は「更新なし」に丸めない。

3. Non-blocking cache

  • network refresh は launcher の critical path から分離し、短い timeout + TTL(初期値24h)の cache を CLAUDE_GPT_HOME 配下へ atomic write する。
  • 複数 Claude-GPT session/worktree で single-flight 相当の軽量 lock を使い、同時取得と cache 破損を避ける。daemon / persistent DB は追加しない。
  • cache は public metadata と timestamp/digest のみ。credential/token/prompt/transcript/tool I/O を保存しない。
  • network failure / 403 / 429 / malformed response / lock contention / stale cache は Claude-GPT 起動を block しない。最後に確認できた時刻と unknown/stale 状態を保持する。

4. Launcher terminal notice

  • launcher が cache を読むだけの同期処理で、更新ありの場合に一度だけ stderr へ表示する。
  • stdout へ update text を混ぜない。
  • network refresh 完了を待つために起動を遅延させない。refresh が起動後に完了した場合は status line が後から拾える。

例(UI contract の例であり実測値ではない):

[Claude-GPT update] claude-code-proxy <local> → <released>
[Claude-GPT model] new upstream model available; repository routing is unchanged

5. Claude-GPT-only status line

新規 scripts/claude-gpt/statusline.py を launcher-owned renderer とする。

  • Claude Code が渡す statusLine stdin JSON を一度受け取る。
  • repository の既存 .claude/hooks/task_context/statusline.py と同じ Task Context output を保持する。可能なら既存 renderer を subprocess/import で再利用し、Task Context 表示ロジックを複製しない。
  • local update cache のみを read し、更新ありの場合だけ短い update:<component> marker を Task Context 表示の末尾へ append する。
  • status line 自身から network/GitHub/OpenAI API/model request を行わない。
  • generated Claude-GPT settings.local.json にだけ次を設定する。project .claude/settings.json は変更しない。
    • statusLine.type=command
    • command = Claude-GPT statusline wrapper
    • bounded refreshInterval(実装時の current Claude Code contract を確認し、外部 update が長時間 session 中にも反映される値。例30–60秒)
  • --settings の scalar override によって Claude-GPT では wrapper、Native では既存 Task Context renderer が使われることを active settings/readback と実 UI で検証する。

In Scope

  • scripts/claude-gpt/upstream_updates.py(新規)
  • scripts/claude-gpt/statusline.py(新規)
  • focused unit/integration tests
  • launch.sh generated settings への Claude-GPT-only statusLine override、cache refresh kick、stderr notice
  • lib.sh の必要最小限の path/fragment helper
  • operation docs
  • test plan registration(必要な場合のみ)

Out of Scope

  • Native Claude の settings / hooks / statusLine / updater / model config への変更。
  • project .claude/settings.json への update notification logic 追加。
  • Native Claude 向け opt-in 通知。
  • 自動 install/upgrade、git pull、model routing の自動変更、proxy restart/kill、live session hot swap。
  • update 発見のための model inference、ChatGPT quota 消費、OAuth/token/auth file 内容の読み取り。
  • 自動 Issue/PR 作成、常駐 daemon、dashboard、汎用 dependency updater。

Acceptance Criteria

  • AC1: Native negative control: plain Native claude では project の既存 Task Context status line がそのまま使われ、update text が status line/起動 terminal のどちらにも出ず、upstream checker process/cache access が発生しない。.claude/settings.json / Native user/local settings は implementation diff でも runtime でも変更されない。
  • AC2: Claude-GPT generated --settings にだけ statusLine override が存在し、effective setting は Claude-GPT wrapper。wrapper は既存 Task Context render を保持し、update がある時だけ marker を append する。update なしでは元表示と presentation-equivalent。
  • AC3: cached update がある Claude-GPT 起動時、launcher は terminal-visible stderr に一度 notice を出す一方、stdout は claude -p / structured output contract を一切汚さない。network refresh を同期で待たない。
  • AC4: Claude-GPT interactive UI の status line で fixture/cache の update marker が実際に表示され、cache を no-update に変更すると bounded refresh 後に marker が消える。debug log / cache write / additionalContext だけを user-visible PASS にしない。
  • AC5: official model announcement / released proxy registry / local selected proxy / repo policy の状態を区別する。local binary 更新前でも remote release に含まれる新 model を検知でき、account entitlement は unknown のまま推測しない。
  • AC6: offline/timeout/403/429/malformed response/corrupt cache/lock contention でも launcher と status line は fail-open advisory として動作し、Claude-GPT の通常操作を妨げない。statusLine path は常に cache-only。
  • AC7: 複数 Claude-GPT session/worktree の同時起動で fetch が bounded に集約され、cache が破損せず、同じ version/model update を terminal へ毎回 spam しない。TTL / explicit refresh / notification disable / dry-run behavior を deterministic にテストする。
  • AC8: notifier は installation/model/permission/repository content を変更せず、credential/token/raw transcript を保存せず、release code を実行せず、通知のための LLM/model request を発生させない。
  • AC9: focused tests + existing Claude-GPT launcher regressions が PASS し、実装 PR の current-head で AC1–AC4 の real Claude Code runtime verification を実施済み。interactive CLI 不在等で SKIP の場合は runtime-unverified とし、実装完了/merge-ready を主張しない。

Verification Commands

以下は実装後の contract。新規 node/file は起票時点では未実装。

# Offline/focused behavior
$ uv run --locked pytest scripts/claude-gpt/tests/test_upstream_updates.py -q
$ uv run --locked pytest scripts/claude-gpt/tests/test_claude_gpt_statusline.py -q

# Existing launcher/policy regressions
$ uv run --locked pytest scripts/claude-gpt/tests/test_auto_mode_policy.py scripts/claude-gpt/tests/test_classify_all_shell_native_projection.py scripts/claude-gpt/test_launch_transport_policy.py -q

# Generated settings / stdout-stderr separation / Native negative fixture
$ uv run --locked pytest scripts/claude-gpt/tests/test_upstream_update_integration.py -q

Required live verification

実装時に、同じ repository/worktree で次を current-head against installed Claude Code で実施し sanitized evidence を PR に残す。

  1. plain claude を起動 → existing Task Context status line のみ、update marker/launcher notice/checker なし。
  2. fixture cache に update を入れて scripts/claude-gpt/launch.sh を起動 → stderr notice を確認。
  3. Claude-GPT の active settings/readback で launcher --settings の statusLine override が有効であることを確認。
  4. Claude-GPT interactive status line に Task Context + update marker が同時表示されることを目視/terminal evidence で確認。
  5. cache を no-update に切り替え → bounded refresh 後に update marker が消えることを確認。
  6. network refresh を failure fixture にする → Claude-GPT prompt/tool operation が通常どおり継続することを確認。
  7. headless claude -p 相当で stdout deterministic marker を照合し、notice は stderr のみに出て stdout が byte-level contract を壊さないことを確認。

Runtime Verification Applicability

decision: immediate
reason: "settings fixture や JSON test だけでは Claude-GPT 専用 override、Native 非通知、interactive status line の可視性、stdout/stderr 分離を証明できない"
applicable_acs: [AC1, AC2, AC3, AC4, AC9]
execution_environment: "変更後 current-head。plain Native Claude + scripts/claude-gpt/launch.sh の双方を同一 repository で起動できる isolated/local environment。実 upstream update network は fixture/cache に置換可能"
skip_conditions: "interactive Claude CLI または statusLine capability が利用不能なら runtime_unverified/environment_blocked。PASS/merge-ready へ昇格しない"
fallback_policy: "Native に update logic を入れる、project statusLine を変更する、debug log/additionalContext だけで通知済みとする、stdout を汚す、network fetch を statusLine 同期 path に入れる、のいずれも fallback として禁止"
artifact_requirements: "current-head SHA、Claude version、Native/Claude-GPT active settings source、sanitized startup stderr、stdout deterministic marker、status line render、failure時の通常操作継続。raw private transcript/credential は保存しない"

Allowed Paths

  • scripts/claude-gpt/upstream_updates.py
  • scripts/claude-gpt/statusline.py
  • scripts/claude-gpt/launch.sh
  • scripts/claude-gpt/lib.sh
  • scripts/claude-gpt/tests/test_upstream_updates.py
  • scripts/claude-gpt/tests/test_claude_gpt_statusline.py
  • scripts/claude-gpt/tests/test_upstream_update_integration.py
  • docs/dev/claude-gpt-upstream-updates.md
  • .github/ci/python-test-plan.json(必要な場合のみ)

禁止 path: .claude/settings.json, .claude/settings.local.json, Native user settings。既存 Task Context statusline は read-only dependency として参照してよいが本 Issue では編集しない。

Stop Conditions / Delivery

Sources

Activity

  1. changed the title [-]実装: Claude Code 利用中に upstream CLI・proxy・モデル更新を検知して非ブロッキング通知する[/-] [+]実装: Claude-GPT 起動時・statusLine で upstream CLI・proxy・モデル更新を非ブロッキング通知する[/+] on Sep 26, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions