init: 在 .Claude/settings.json 中的每个 `ruflo init` 标记 "model": "Claude-sonnet-5", 覆盖用户自己的模型 (仓库自己的 settings.json 也会这样)
@ruvnet @proffesor-for-testing ### Summary Since v3.32.1, every fresh ruflo init (and every init --force) writes "model": "Claude-sonnet-5" into the project's .Claude/settings.json. Claude Code ranks shared project settings above the user's own ~/.Claude/settings.json (settings precedence), so in every ruflo-initialised project the pin silently replaces whatever model the user chose, such as opus, opus[1m] or a newer Sonnet. The ruflo repo's own .Claude/settings.json has the same pin, so every clone and worktree of ruflo starts Claude Code on Sonnet 5 as well. The pin is also stale now. 3e9122a31 set it to "the latest Claude 5" in July; with Sonnet 5.5 and Opus 5.5 out, a hard-coded "latest" falls behind at every release. ### Environment ruflo 3.47.1 and @Claude-flow/cli 3.47.1 (npm latest), Claude Code 2.1.284, macOS arm64, Node 24.15.0. Upstream main at b636802d8 still has both pins. ### Steps to reproduce Hermetic: a throwaway HOME, and a codex stub so init doesn't probe a real Codex. sh T=$(mktemp -d); mkdir -p "$T/home/bin" "$T/proj" printf '#!/bin/sh\nexit 1\n' > "$T/home/bin/codex"; chmod +x "$T/home/bin/codex" npm i -g --prefix "$T/prefix" [email protected] --no-fund --no-audit >/dev/null cd "$T/proj" && HOME="$T/home" CODEX_HOME="$T/home/.codex" PATH="$T/home/bin:$PATH" "$T/prefix/bin/ruflo" init --force --no-codex-detect --no-skills-sh >/dev/null jq .model .Claude/settings.json ### Expected vs actual - Actual: "Claude-sonnet-5" - Expected: null (no model key), so Claude Code uses the user's own setting, or its own default if they have none. With "model": "opus" in ~/.Claude/settings.json, Claude Code started in that project therefore runs Sonnet 5. The docs also note that ANTHROPIC_DEFAULT_MODEL "applies only when no file sets model", so the pin disables that variable in these projects too. ### Root cause - settings-generator.ts#L62-L64 assigns settings.model = 'Claude-sonnet-5' unconditionally in generateSettings(). - History: when the file was written (6a356ffe6, 2026-01-05) this line set an object, and three days later (5d1dc2b74) it became a commented-out suggestion, // settings.model = 'Claude-sonnet-4-20250514'; // Uncomment if you want to set a default model. 3e9122a31 ("feat(routing): default to latest Claude 5/4.x models in tier map + init template", 2026-07-15, first released in v3.32.1) turned it into a live assignment while updating the tier map, and that made the optional default mandatory for every project. - The same commit pinned …
内容来源: ruvnet/ruflo