runtime初期化/実行の異常系を onError + fatalError で分離伝播#218
Conversation
Agent-Logs-Url: https://github.com/ut-code/my-code/sessions/3499a4d7-2b75-4046-b6d5-24912d4eaf0a Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ut-code/my-code/sessions/3499a4d7-2b75-4046-b6d5-24912d4eaf0a Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
my-code | 9c8c35f | Commit Preview URL Branch Preview URL |
Apr 17 2026, 04:47 PM |
|
@copilot このPRの前後で、サーバーサイドのバンドルサイズが増加し、cloudflare workerのサイズ制限を超えてしまいデプロイに失敗しました。何が原因でしょう? このPRの後(copilot/add-onerror-argument-to-initブランチ): |
Agent-Logs-Url: https://github.com/ut-code/my-code/sessions/f1dea2f9-037f-4cd9-a9e0-cefe2e569bfa Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
原因は Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot 解決していません。コード差分に原因があるはずです。 |
Agent-Logs-Url: https://github.com/ut-code/my-code/sessions/1f1e6587-2ca0-4873-86cf-5cc4025a539b Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
原因を再調査し、コード差分側で特定・修正しました。 Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
e899203 to
424aa9b
Compare
424aa9b to
9c8c35f
Compare
* sentryをセットアップ * bundleSizeOptimizationを指定 * sentryとopentelemetryを別ファイルにしてみる * instrumentation.tsでsentryをトップレベルimportしない * 名前を消してみる * sentry/nextjsをexternalPackagesにしてみる * Revert "instrumentation.tsでsentryをトップレベルimportしない" This reverts commit ae747fa. * catchしたエラーとチャットエラーをsentryに送信 * 動作確認用に新しいコミットをpush * eventIDの表示を追加、エラーページのレイアウトを修正 * dev環境でエラーを記録しない * エラーページにEventIDつきフォームリンクを追加、全エラーページをコンポーネントにまとめる * runtime初期化/実行の異常系を `onError` + `fatalError` で分離伝播 (#218) * chore: plan runtime fatal error handling changes Agent-Logs-Url: https://github.com/ut-code/my-code/sessions/3499a4d7-2b75-4046-b6d5-24912d4eaf0a Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com> * feat(runtime): add fatalError and onError callback propagation Agent-Logs-Url: https://github.com/ut-code/my-code/sessions/3499a4d7-2b75-4046-b6d5-24912d4eaf0a Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com> * revert package-lock.json * fix: restore package-lock from sentry to prevent dependency drift Agent-Logs-Url: https://github.com/ut-code/my-code/sessions/f1dea2f9-037f-4cd9-a9e0-cefe2e569bfa Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com> * fix(runtime): avoid bundling typescript.js in server handler Agent-Logs-Url: https://github.com/ut-code/my-code/sessions/1f1e6587-2ca0-4873-86cf-5cc4025a539b Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com> * fatalErrorをそんなに目立たせる必要ない * handleRuntimeErrorをplainの関数にし、alertを追加 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com> * テストのエラーもsentryに送る * Update app/errorMessage.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update app/errorMessage.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * sentry関連の設定をすべて環境変数に & debugオフ * global-errorページのスタイル修正 & フォームパラメータ修正 * sentryの環境変数をREADMEに書いておく --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
packages/runtimeで、ユーザーコードの実行エラーとアプリ/ランタイム側の予期せぬエラーが同じ"error"扱いになっていました。本PRでは、runtime初期化・実行時の異常を
onError経由で上位へ通知しつつ、出力種別を"fatalError"として分離します。Runtime APIの拡張(契約変更)
RuntimeContext.initをinit(onError?)に拡張ReplOutputTypeSchemaに"fatalError"を追加useRuntime(language, { onError })で呼び出し側からエラーハンドラを注入可能に変更ランタイム実装での異常系伝播
worker/runtime.tsxonError呼び出しfatalError出力を検知した場合もonErrorへ伝播wandbox/runtime.tsxrunFiles失敗時にonError+fatalErrortypescript/runtime.tsxonError+fatalErrorworker内の「ユーザーコード外エラー」の明確化
worker/pyodide.worker.ts"error""fatalError"に変更worker/ruby.worker.tsErrorなどユーザーコード外と判断されるケースを"fatalError"で返却"error"を維持アプリ側の利用更新(Sentry連携)
app/terminal/exec.tsx,app/terminal/repl.tsxuseRuntime(..., { onError: captureException })を導入repl描画で"fatalError"の表示分岐を追加(通常エラーと視覚的に区別)