@kolisachint/hoocode-agent 0.4.23 → 0.4.24
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.
- package/CHANGELOG.md +11 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +14 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/provider-health.d.ts +36 -0
- package/dist/core/provider-health.d.ts.map +1 -0
- package/dist/core/provider-health.js +54 -0
- package/dist/core/provider-health.js.map +1 -0
- package/dist/core/subagent-pool.d.ts +6 -0
- package/dist/core/subagent-pool.d.ts.map +1 -1
- package/dist/core/subagent-pool.js +28 -0
- package/dist/core/subagent-pool.js.map +1 -1
- package/dist/core/subagent-result.d.ts.map +1 -1
- package/dist/core/subagent-result.js +32 -2
- package/dist/core/subagent-result.js.map +1 -1
- package/dist/core/tools/subagent.d.ts.map +1 -1
- package/dist/core/tools/subagent.js +26 -0
- package/dist/core/tools/subagent.js.map +1 -1
- package/dist/init-templates.generated.d.ts.map +1 -1
- package/dist/init-templates.generated.js +1 -1
- package/dist/init-templates.generated.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +4 -4
- package/templates/agents/general-purpose.md +1 -0
|
@@ -28,6 +28,7 @@ import { createToolHtmlRenderer } from "./export-html/tool-renderer.js";
|
|
|
28
28
|
import { ExtensionRunner, wrapRegisteredTools, } from "./extensions/index.js";
|
|
29
29
|
import { emitSessionShutdownEvent } from "./extensions/runner.js";
|
|
30
30
|
import { expandPromptTemplate } from "./prompt-templates.js";
|
|
31
|
+
import { clearProviderExhaustion, isProviderQuotaError, markProviderExhausted } from "./provider-health.js";
|
|
31
32
|
import { CURRENT_SESSION_VERSION, getLatestCompactionEntry } from "./session-manager.js";
|
|
32
33
|
import { createSyntheticSourceInfo } from "./source-info.js";
|
|
33
34
|
import { updateSubagentSkillPaths } from "./subagent-pool-instance.js";
|
|
@@ -317,6 +318,11 @@ export class AgentSession {
|
|
|
317
318
|
const assistantMsg = event.message;
|
|
318
319
|
if (assistantMsg.stopReason !== "error") {
|
|
319
320
|
this._overflowRecoveryAttempted = false;
|
|
321
|
+
// A successful response clears any prior provider-exhaustion flag so
|
|
322
|
+
// subagent dispatch is unblocked as soon as the provider recovers.
|
|
323
|
+
const provider = this.model?.provider;
|
|
324
|
+
if (provider)
|
|
325
|
+
clearProviderExhaustion(provider);
|
|
320
326
|
}
|
|
321
327
|
// Reset retry counter immediately on successful assistant response
|
|
322
328
|
// This prevents accumulation across multiple LLM calls within a turn
|
|
@@ -339,6 +345,14 @@ export class AgentSession {
|
|
|
339
345
|
const didRetry = await this._handleRetryableError(msg);
|
|
340
346
|
if (didRetry)
|
|
341
347
|
return; // Retry was initiated, don't proceed to compaction
|
|
348
|
+
// Retries are exhausted/disabled and a quota or rate-limit error
|
|
349
|
+
// persists: flag the provider so subagent dispatch can skip pointless
|
|
350
|
+
// spawns (subagents inherit this provider). Self-expires via TTL and is
|
|
351
|
+
// cleared on the next successful response.
|
|
352
|
+
const provider = this.model?.provider;
|
|
353
|
+
if (provider && isProviderQuotaError(msg.errorMessage)) {
|
|
354
|
+
markProviderExhausted(provider, msg.errorMessage ?? "provider error");
|
|
355
|
+
}
|
|
342
356
|
}
|
|
343
357
|
this._resolveRetry();
|
|
344
358
|
await this._checkCompaction(msg);
|