Repository navigation
オートモードを到着時間推定の見込みで走らせるかをリモート設定のauto_mode_estimated_enabledで切り替えられるようにした - #7161
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (6)
Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour. 📝 WalkthroughWalkthroughRemote Config の設定値に応じて、オートモードが Estimated クエリまたは Legacy クエリを選択します。フラグ無効時や取得失敗時は Legacy を使用し、Estimated クエリがエラーの場合も Legacy に切り替えます。 Changes到着時間推定の切り替え
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Worker
participant remoteConfig
participant useAutoModeEstimatedEnabled
participant useSimulationMode
participant StationAPI
Worker->>remoteConfig: auto_mode_estimated_enabled を配信
remoteConfig->>useAutoModeEstimatedEnabled: キャッシュ値を通知
useAutoModeEstimatedEnabled->>useSimulationMode: 設定値を返す
alt 設定が有効
useSimulationMode->>StationAPI: Estimated クエリ
StationAPI-->>useSimulationMode: 結果またはエラー
useSimulationMode->>StationAPI: エラー時に Legacy クエリ
else 設定が無効または未配信
useSimulationMode->>StationAPI: Legacy クエリ
end
Merge Risk: ⚪ Minimal · up to The change defaults to Legacy, enables Estimated only when explicitly configured, and falls back on errors. No actionable merge-blocking risk is established; merge after normal checks pass. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
うさぎは設定を読み取った Comment |
概要
オートモードを到着時間推定の見込み(
trainRouteのmodel: Estimated、#7158)で走らせるか、従来の値(Legacy)で走らせるかを、Worker の/config/remoteが配信するauto_mode_estimated_enabledで切り替えられるようにしました。既定は
Legacyです。trueを配信したときだけ、見込みで走ります。変更の種類
変更内容
src/lib/remoteConfig.ts)auto_mode_estimated_enabledとisAutoModeEstimatedEnabled()を足しました。真偽値のときだけ取り込み、未配信・不正値・取得失敗のときはfalseに倒します。src/hooks/useAutoModeEstimatedEnabled.ts)useAIAgentFeatureEnabledと同じく、設定の取得完了をuseSyncExternalStoreで購読します。src/hooks/useSimulationMode.ts)trueのときは オートモードを到着時間推定の見込みで走らせ、ETAとGPXと同じ時間で駅に着いて停まるようにした #7158 と同じです。Estimatedで引き、エラーならLegacyに戻します。falseのときは、Estimatedのクエリをskipして、最初からLegacyで引きます。オートモードを到着時間推定の見込みで走らせ、ETAとGPXと同じ時間で駅に着いて停まるようにした #7158 より前と同じ走り方です。skipしても同じクエリキーのキャッシュがあればdataは返ります。そのため、どちらの結果を使うかもフラグで決めています。docs/location-simulation.mdに、キーと既定値を書き足しました。切り替え方
Worker の KV
config:remoteにauto_mode_estimated_enabledを真偽値で入れます。TrainLCD/functions の/config/remoteは、未知のキーも真偽値ならそのまま配信するので、Worker のコード変更は要りません。アプリは起動時に 1 回だけ値を取得するので、切り替えた後はアプリを起動し直すと反映されます。リグレッションのリスク
canary には #7158 が、フラグなしで入っています(#7159)。この PR が入った後の canary は、KV に
trueを入れるまでLegacyで走ります。今の canary と同じ挙動で試すには、KV にtrueを入れてください。テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること関連Issue
Refs #7158
スクリーンショット(任意)
UI 変更なし: オートモードが区間の値をどの問い合わせで取るかを切り替える変更で、画面の見た目は変わりません。
🤖 Generated with Claude Code
Summary by CodeRabbit