kafox-cli 0.9.6 → 0.9.7

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/package.json +1 -1
  2. package/src/gateway.js +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kafox-cli",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
4
4
  "description": "Kafox CLI: TUI com streaming, thinking, edit com diff, agent tools (files/shell), MCP e temas",
5
5
  "bin": {
6
6
  "kafox": "bin/kafox.js"
package/src/gateway.js CHANGED
@@ -258,13 +258,15 @@ async function chat({ messages, model, tools, onDelta, onReasoning, onRetry, sig
258
258
  const maxAttempts = Math.max(1, Number(retries) || RETRY_MAX);
259
259
  let attempt = 0;
260
260
  let last = null;
261
+ let clearedKey = false;
261
262
 
262
263
  while (attempt < maxAttempts) {
263
264
  attempt += 1;
264
265
  const result = await attemptChat({ messages, model, tools, onDelta, onReasoning, signal });
265
266
 
266
267
  if (result.ok || result.code === "aborted") return result;
267
- if (result.code === "invalid_api_key") {
268
+ if (result.code === "invalid_api_key" && !clearedKey) {
269
+ clearedKey = true;
268
270
  storage.clearApiKey();
269
271
  continue;
270
272
  }