@@ -190,6 +190,41 @@ RUN CLOUDCLI_BUNDLE="/usr/local/lib/node_modules/@siteboon/claude-code-ui/dist/a
190190 echo "[patch] Shell scroll position fix applied" || \
191191 echo "[patch] WARNING: Shell scroll pattern not found in vendored CloudCLI bundle, skipping patch"
192192
193+ # patch v1.2.2-1: commands.js expose newModel in spawn args (issue #36)
194+ RUN CLOUDCLI_COMMANDS="/usr/local/lib/node_modules/@siteboon/claude-code-ui/server/routes/commands.js" && \
195+ grep -q 'message: args.length > 0' "$CLOUDCLI_COMMANDS" && \
196+ perl -pi -e 's/^(\s +)(message: args\. length > 0)/$1newModel: args.length > 0 ? args[0] : null,\n $1$2/' "$CLOUDCLI_COMMANDS" && \
197+ echo "[patch] commands.js newModel field added" || \
198+ echo "[patch] WARNING: commands.js newModel pattern not found, skipping patch"
199+
200+ # patch v1.2.2-2: bundle expose setClaudeModel in claudeModel context spread (issue #36)
201+ RUN CLOUDCLI_BUNDLE="/usr/local/lib/node_modules/@siteboon/claude-code-ui/dist/assets/index-X3ImjnMV.js" && \
202+ grep -q 'claudeModel:W,codexModel:V' "$CLOUDCLI_BUNDLE" && \
203+ perl -pi -e 's/\Q claudeModel:W,codexModel:V\E /claudeModel:W,setClaudeModel:L,codexModel:V/g' "$CLOUDCLI_BUNDLE" && \
204+ echo "[patch] bundle setClaudeModel context spread applied" || \
205+ echo "[patch] WARNING: bundle claudeModel:W pattern not found, skipping patch"
206+
207+ # patch v1.2.2-3: bundle wire setClaudeModel:lS2 into cursorModel destructure (issue #36)
208+ RUN CLOUDCLI_BUNDLE="/usr/local/lib/node_modules/@siteboon/claude-code-ui/dist/assets/index-X3ImjnMV.js" && \
209+ grep -q 'cursorModel:o,claudeModel:l,codexModel:c' "$CLOUDCLI_BUNDLE" && \
210+ perl -pi -e 's/\Q cursorModel:o,claudeModel:l,codexModel:c\E /cursorModel:o,claudeModel:l,setClaudeModel:lS2,codexModel:c/g' "$CLOUDCLI_BUNDLE" && \
211+ echo "[patch] bundle setClaudeModel:lS2 destructure applied" || \
212+ echo "[patch] WARNING: bundle cursorModel destructure pattern not found, skipping patch"
213+
214+ # patch v1.2.2-4: bundle apply newModel on SSE model event (issue #36)
215+ RUN CLOUDCLI_BUNDLE="/usr/local/lib/node_modules/@siteboon/claude-code-ui/dist/assets/index-X3ImjnMV.js" && \
216+ grep -q 'case"model":k({type:"assistant"' "$CLOUDCLI_BUNDLE" && \
217+ perl -pi -e 's/\Q case"model":k({type:"assistant"\E /case"model":me.newModel\&\& lS2\&\& (lS2(me.newModel),localStorage.setItem("claude-model",me.newModel));k({type:"assistant"/g' "$CLOUDCLI_BUNDLE" && \
218+ echo "[patch] bundle SSE model event handler applied" || \
219+ echo "[patch] WARNING: bundle case\" model\" pattern not found, skipping patch"
220+
221+ # patch v1.2.2-5: bundle add custom model option to select (issue #36)
222+ RUN CLOUDCLI_BUNDLE="/usr/local/lib/node_modules/@siteboon/claude-code-ui/dist/assets/index-X3ImjnMV.js" && \
223+ grep -q 'children:N.OPTIONS.map(({value:C,label:j})=>s.jsx("option",{value:C,children:j},C+j))}' "$CLOUDCLI_BUNDLE" && \
224+ perl -pi -e 's/\Q children:N.OPTIONS.map(({value:C,label:j})=>s.jsx("option",{value:C,children:j},C+j))}\E /children:[...N.OPTIONS.map(({value:C,label:j})=>s.jsx("option",{value:C,children:j},C+j)),!N.OPTIONS.some(C=>C.value===k)\&\& k\&\& s.jsx("option",{value:k,children:k},k+"custom")].filter(Boolean)}/g' "$CLOUDCLI_BUNDLE" && \
225+ echo "[patch] bundle custom model select option applied" || \
226+ echo "[patch] WARNING: bundle custom model select pattern not found, skipping patch"
227+
193228# ---------- CloudCLI plugins (baked into image) ----------
194229USER claude
195230RUN mkdir -p /home/claude/.claude-code-ui/plugins && \
0 commit comments