ikie-cli 0.1.44 → 0.1.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +19 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -164,22 +164,28 @@ async function main() {
164
164
  config.requestsPerMinute = Math.floor(rpm);
165
165
  }
166
166
  // If user hasn't explicitly chosen a model, fetch the server's default.
167
+ // Retry once: the server can be slow on a cold start / right after a deploy,
168
+ // and a single timeout would otherwise silently strand us on the stale
169
+ // config default instead of the current server default.
167
170
  if (!argv.model && !hasExplicitModel()) {
168
- try {
169
- const modelsUrl = (config.baseURL ?? IKIE_API_BASE).includes('/api/v1')
170
- ? (config.baseURL ?? IKIE_API_BASE).replace('/api/v1', '/api/models')
171
- : `${IKIE_HOST}/api/models`;
172
- const res = await fetch(modelsUrl, { signal: AbortSignal.timeout(4000) });
173
- if (res.ok) {
174
- const data = await res.json();
175
- const serverDefault = data.models?.find(m => m.is_default);
176
- if (serverDefault) {
177
- config.model = serverDefault.name;
171
+ const modelsUrl = (config.baseURL ?? IKIE_API_BASE).includes('/api/v1')
172
+ ? (config.baseURL ?? IKIE_API_BASE).replace('/api/v1', '/api/models')
173
+ : `${IKIE_HOST}/api/models`;
174
+ for (let attempt = 0; attempt < 2; attempt++) {
175
+ try {
176
+ const res = await fetch(modelsUrl, { signal: AbortSignal.timeout(8000) });
177
+ if (res.ok) {
178
+ const data = await res.json();
179
+ const serverDefault = data.models?.find(m => m.is_default);
180
+ if (serverDefault) {
181
+ config.model = serverDefault.name;
182
+ }
183
+ break;
178
184
  }
179
185
  }
180
- }
181
- catch {
182
- // Silently fall back to DEFAULT_MODEL
186
+ catch {
187
+ // Retry once, then silently fall back to DEFAULT_MODEL.
188
+ }
183
189
  }
184
190
  }
185
191
  const oneShot = argv._.length > 0 ? argv._.join(' ') : undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ikie-cli",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "description": "Agentic coding CLI — your terminal AI pair programmer",
5
5
  "type": "module",
6
6
  "bin": {