restore: PR #313 + #318 を復活 (真犯人は node_modules 重複だった)#333
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 18 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (50)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40c0dc56da
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const model = getSmallModel(); | ||
| if (!model) return; | ||
| try { |
There was a problem hiding this comment.
Retry another small-model candidate for chat titles
getSmallModel() returns the first candidate whose model object can be constructed, but auth/permission failures happen later when generateTitleFromMessage runs. This code now tries only that single model and exits on the first exception, so an expired or unauthorized primary credential (for example stale Anthropic OAuth) prevents fallback to another valid provider. The previous provider loop retried on invocation failures, so this is a regression for multi-provider users.
Useful? React with 👍 / 👎.
| const model = getSmallModel(); | ||
| if (!model) return null; | ||
|
|
There was a problem hiding this comment.
Preserve provider failover in AI branch-name generation
This path now selects one model via getSmallModel() and returns null if that single invocation fails, but getSmallModel() does not prove the credential is usable at request time. If the first credential is stale (e.g., expired OAuth) while another provider is healthy, branch-name generation stops instead of trying the next provider. The prior implementation used callSmallModel and retried providers, so branch suggestions can regress in mixed-credential setups.
Useful? React with 👍 / 👎.
概要
PR #332 で revert した #313 (mastracode 0.14 + small-model refactor) と #318 (その regression 修正) を復活させます。
#313 は DiffViewer 崩れの原因ではありませんでした。真犯人は node_modules 内の重複パッケージでした。
真犯人: node_modules の重複
`rm -rf node_modules && bun install` 直前の node_modules:
```
@pierre+diffs@1.1.3+2b5434204782a989 ← bun.lock に記載
@pierre+diffs@1.1.7+2b5434204782a989 ← bun.lock に無い残骸
shiki@3.23.0 ← bun.lock に記載
shiki@4.0.2 ← bun.lock に無い残骸
@shikijs+core@3.23.0 / 4.0.2 (重複)
@shikijs+engine-javascript@3.23.0 / 4.0.2 (重複)
@shikijs+engine-oniguruma@3.23.0 / 4.0.2 (重複)
@shikijs+langs@3.23.0 / 4.0.2 (重複)
@shikijs+themes@3.23.0 / 4.0.2 (重複)
@shikijs+types@3.23.0 / 4.0.2 (重複)
```
@pierre/diffs は Web Components を使い、`customElements.define(DIFFS_TAG_NAME, FileDiffContainer)` を top-level で実行します。重複 install で同名要素の登録が 2 度走り、2 度目は silently 失敗。結果として一部 DiffViewer インスタンスに style sheet が正しく `adoptedStyleSheets` されず、`:host` の CSS 変数デフォルト(`--diffs-bg: #fff` など)がそのまま出て、unchanged lines セパレータの枠線が白くなっていた。
混入経緯(推定)
upstream取り込み bisect を行った際、`mastracode` を複数バージョンへ override 切替しながら `bun install` を繰り返した。bun は lockfile を正しく更新する一方、古いバージョンの `@pierre/diffs` / `shiki` を node_modules から削除せず残してしまったため、lockfile 上は 1 バージョンだが disk 上は複数バージョンが共存する状態になった。
この PR の内容
`runtime-dependencies.ts` の mastracode externalize エントリは #313 で元々追加されるため、PR #332 に含まれた `d9cd50893` (externalize 維持 commit) は不要だが、履歴として残しても無害。
事後対応