Skip to content

restore: PR #313 + #318 を復活 (真犯人は node_modules 重複だった)#333

Merged
MocA-Love merged 2 commits intomainfrom
restore/pr-313-check
Apr 18, 2026
Merged

restore: PR #313 + #318 を復活 (真犯人は node_modules 重複だった)#333
MocA-Love merged 2 commits intomainfrom
restore/pr-313-check

Conversation

@MocA-Love
Copy link
Copy Markdown
Owner

概要

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 の内容

  1. `ded574fdf` (Revert upstream取り込み: mastracode 0.14 + small-model refactor (#3517) #313) を再 revert → upstream取り込み: mastracode 0.14 + small-model refactor (#3517) #313 復活
  2. `83eca3dfb` (Revert fix(desktop): PR #313 small-model regression (OAuth + provider fallback) #318) を再 revert → fix(desktop): PR #313 small-model regression (OAuth + provider fallback) #318 復活

`runtime-dependencies.ts` の mastracode externalize エントリは #313 で元々追加されるため、PR #332 に含まれた `d9cd50893` (externalize 維持 commit) は不要だが、履歴として残しても無害。

事後対応

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

Warning

Rate limit exceeded

@MocA-Love has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 18 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eb176be4-ab88-47a2-8eb7-d4581cf09824

📥 Commits

Reviewing files that changed from the base of the PR and between be71a6c and 40c0dc5.

📒 Files selected for processing (50)
  • apps/desktop/package.json
  • apps/desktop/plans/done/20260415-v2-host-service-ai-branch-naming-test-plan.md
  • apps/desktop/plans/done/20260415-v2-host-service-ai-branch-naming.md
  • apps/desktop/plans/done/20260417-fix-api-key-storage-slot.md
  • apps/desktop/runtime-dependencies.ts
  • apps/desktop/src/lib/ai/call-small-model.test.ts
  • apps/desktop/src/lib/ai/call-small-model.ts
  • apps/desktop/src/lib/ai/provider-diagnostics.ts
  • apps/desktop/src/lib/trpc/routers/changes/git-operations.ts
  • apps/desktop/src/lib/trpc/routers/index.ts
  • apps/desktop/src/lib/trpc/routers/model-providers/index.ts
  • apps/desktop/src/lib/trpc/routers/workspaces/utils/ai-branch-name.ts
  • apps/desktop/src/lib/trpc/routers/workspaces/utils/ai-name.test.ts
  • apps/desktop/src/lib/trpc/routers/workspaces/utils/ai-name.ts
  • apps/desktop/src/renderer/components/Chat/ChatInterface/components/ModelPicker/components/AnthropicOAuthDialog/AnthropicOAuthDialog.tsx
  • apps/desktop/src/renderer/components/Chat/ChatInterface/components/ModelPicker/components/OAuthDialog/OAuthDialog.tsx
  • apps/desktop/src/renderer/components/Chat/ChatInterface/components/ModelPicker/components/OAuthDialog/index.ts
  • apps/desktop/src/renderer/components/Chat/ChatInterface/components/ModelPicker/components/OpenAIOAuthDialog/OpenAIOAuthDialog.tsx
  • apps/desktop/src/renderer/components/Chat/ChatInterface/components/ModelPicker/hooks/useAnthropicOAuth/useAnthropicOAuth.ts
  • apps/desktop/src/renderer/components/Chat/ChatInterface/components/ModelPicker/hooks/useOpenAIOAuth/useOpenAIOAuth.ts
  • apps/desktop/src/renderer/routes/_authenticated/settings/models/components/ModelsSettings/ModelsSettings.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/models/components/ModelsSettings/components/AccountCard/AccountCard.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/models/components/ModelsSettings/components/AccountCard/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/settings/models/components/ModelsSettings/components/ConfigRow/ConfigRow.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/models/components/ModelsSettings/components/SettingsSection/SettingsSection.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/models/components/ModelsSettings/utils.ts
  • apps/desktop/src/shared/ai/provider-status.test.ts
  • apps/desktop/src/shared/ai/provider-status.ts
  • packages/chat/package.json
  • packages/chat/src/server/desktop/auth/anthropic/anthropic.ts
  • packages/chat/src/server/desktop/chat-service/auth-storage-utils.ts
  • packages/chat/src/server/desktop/chat-service/chat-service.test.ts
  • packages/chat/src/server/desktop/chat-service/chat-service.ts
  • packages/chat/src/server/desktop/index.ts
  • packages/chat/src/server/desktop/small-model/index.ts
  • packages/chat/src/server/desktop/small-model/small-model.test.ts
  • packages/chat/src/server/desktop/small-model/small-model.ts
  • packages/chat/src/server/desktop/title-generation/index.ts
  • packages/chat/src/server/desktop/title-generation/title-generation.test.ts
  • packages/chat/src/server/desktop/title-generation/title-generation.ts
  • packages/chat/src/server/shared/index.ts
  • packages/chat/src/server/shared/small-model/get-small-model.ts
  • packages/chat/src/server/shared/small-model/index.ts
  • packages/chat/src/server/trpc/utils/runtime/runtime.test.ts
  • packages/chat/src/server/trpc/utils/runtime/runtime.ts
  • packages/host-service/package.json
  • packages/host-service/src/providers/model-providers/LocalModelProvider/LocalModelProvider.ts
  • packages/host-service/src/providers/model-providers/LocalModelProvider/utils/resolveAnthropicCredential.ts
  • packages/host-service/src/trpc/router/workspace-creation/utils/ai-branch-name.ts
  • packages/host-service/src/trpc/router/workspace-creation/workspace-creation.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch restore/pr-313-check

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MocA-Love MocA-Love merged commit f61123e into main Apr 18, 2026
14 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +513 to +515
const model = getSmallModel();
if (!model) return;
try {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +61 to 63
const model = getSmallModel();
if (!model) return null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

MocA-Love added a commit that referenced this pull request Apr 18, 2026
PR #332/#333 の DiffViewer 調査で実施した `rm -rf node_modules && bun install`
に伴う lockfile の再解決。新しい transitive 依存 (mastracode 0.14 経由の
ai-sdk プロバイダ群等) が正式に記録される。
MocA-Love added a commit that referenced this pull request Apr 18, 2026
他環境の開発者にも分かるよう、Desktop アプリのビルド手順 (ローカル dev /
配布ビルド確認) と desktop-v* タグによるリリースフローを明記。
合わせて、PR #332/#333 で判明した「dependency bump 後の node_modules
フルクリーン必須」を明文化し、同じ症状 (DiffViewer セパレータ白化等) の
再発を防ぐ。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant