minicode-ai 0.28.0 → 0.30.0

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.
@@ -675,6 +675,7 @@ export class Transcript {
675
675
  this.thinkingBuf = ""
676
676
  this.thinkingTail = ""
677
677
  this.thinkingArea = []
678
+ this.thinkingRowId = null
678
679
  this.evicted = 0
679
680
  this.hasEvictMarker = false
680
681
  this.runningMemo = null
@@ -1884,6 +1885,9 @@ export class Transcript {
1884
1885
  if (index < 0) return false
1885
1886
  this.lines[index] = line
1886
1887
  this.rowCache.delete(id)
1888
+ this.committedProjection = null
1889
+ this.projectedBase = null
1890
+ this.runningMemo = null
1887
1891
  return true
1888
1892
  }
1889
1893
 
@@ -153,6 +153,13 @@ export function createOpenAICompatProvider(config: OpenAICompatConfig): ModelPro
153
153
  }
154
154
  };
155
155
  for await (const chunk of sse(response.body, signal)) {
156
+ if (chunk.error && (typeof chunk.error === "object" || typeof chunk.error === "string")) {
157
+ const e = typeof chunk.error === "object" ? (chunk.error as Record<string, unknown>) : { message: String(chunk.error) };
158
+ const msg = String(e.message ?? e.msg ?? JSON.stringify(chunk.error));
159
+ const c = String(e.code ?? e.type ?? "");
160
+ const cat = /auth|401|403/i.test(msg + c) ? "auth" : /rate|quota|429/i.test(msg + c) ? "rate_limit" : /context/i.test(msg) ? "context_length_exceeded" : "server";
161
+ throw new ProviderError(cat, `${cat === "server" ? "server error" : cat}: ${msg}`);
162
+ }
156
163
  const usage = chunk.usage as {
157
164
  prompt_tokens?: number;
158
165
  completion_tokens?: number;