@ouro.bot/cli 0.1.0-alpha.114 → 0.1.0-alpha.116
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.json +12 -0
- package/dist/heart/provider-failover.js +11 -2
- package/dist/heart/provider-ping.js +13 -18
- package/dist/senses/bluebubbles.js +1 -3
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.116",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Provider ping now uses a minimal direct API call (max_tokens:1, no thinking/reasoning params) instead of streamTurn, which was adding provider-specific features that could cause 400 errors unrelated to auth."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"version": "0.1.0-alpha.115",
|
|
12
|
+
"changes": [
|
|
13
|
+
"Failover message now shows providers with expired/failing credentials separately with refresh instructions ('run ouro auth --agent X --provider Y to refresh') instead of silently omitting them."
|
|
14
|
+
]
|
|
15
|
+
},
|
|
4
16
|
{
|
|
5
17
|
"version": "0.1.0-alpha.114",
|
|
6
18
|
"changes": [
|
|
@@ -19,6 +19,7 @@ function buildFailoverContext(errorMessage, classification, currentProvider, cur
|
|
|
19
19
|
: `${providerWithModel} ${label}`;
|
|
20
20
|
const workingProviders = [];
|
|
21
21
|
const unconfiguredProviders = [];
|
|
22
|
+
const failingProviders = [];
|
|
22
23
|
for (const [provider, result] of Object.entries(inventory)) {
|
|
23
24
|
if (result.ok) {
|
|
24
25
|
workingProviders.push(provider);
|
|
@@ -26,7 +27,10 @@ function buildFailoverContext(errorMessage, classification, currentProvider, cur
|
|
|
26
27
|
else if (result.classification === "auth-failure" && result.message === "no credentials configured") {
|
|
27
28
|
unconfiguredProviders.push(provider);
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
+
else {
|
|
31
|
+
// Configured but ping failed (expired token, provider also down, etc.)
|
|
32
|
+
failingProviders.push({ provider, reason: result.message });
|
|
33
|
+
}
|
|
30
34
|
}
|
|
31
35
|
const lines = [`${errorSummary}.`];
|
|
32
36
|
if (workingProviders.length > 0) {
|
|
@@ -38,10 +42,15 @@ function buildFailoverContext(errorMessage, classification, currentProvider, cur
|
|
|
38
42
|
lines.push(`these providers are ready to go: ${switchDescriptions.join(", ")}.`);
|
|
39
43
|
lines.push(`reply ${switchOptions} to continue.`);
|
|
40
44
|
}
|
|
45
|
+
if (failingProviders.length > 0) {
|
|
46
|
+
for (const { provider, reason } of failingProviders) {
|
|
47
|
+
lines.push(`${provider} is configured but its credentials failed (${reason}). run \`ouro auth --agent ${agentName} --provider ${provider}\` to refresh.`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
41
50
|
if (unconfiguredProviders.length > 0) {
|
|
42
51
|
lines.push(`to set up ${unconfiguredProviders.join(", ")}, run \`ouro auth --agent ${agentName}\` in terminal.`);
|
|
43
52
|
}
|
|
44
|
-
if (workingProviders.length === 0 && unconfiguredProviders.length === 0) {
|
|
53
|
+
if (workingProviders.length === 0 && unconfiguredProviders.length === 0 && failingProviders.length === 0) {
|
|
45
54
|
lines.push(`no other providers are available. run \`ouro auth --agent ${agentName}\` in terminal to configure one.`);
|
|
46
55
|
}
|
|
47
56
|
(0, runtime_1.emitNervesEvent)({
|
|
@@ -48,18 +48,6 @@ function createRuntimeForPing(provider, config) {
|
|
|
48
48
|
throw new Error(`unsupported provider for ping: ${provider}`);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
/* v8 ignore start -- no-op stubs: never invoked, ping only needs streamTurn to not throw @preserve */
|
|
52
|
-
const noop = () => { };
|
|
53
|
-
/* v8 ignore stop */
|
|
54
|
-
const noopCallbacks = {
|
|
55
|
-
onModelStart: noop,
|
|
56
|
-
onModelStreamStart: noop,
|
|
57
|
-
onTextChunk: noop,
|
|
58
|
-
onReasoningChunk: noop,
|
|
59
|
-
onToolStart: noop,
|
|
60
|
-
onToolEnd: noop,
|
|
61
|
-
onError: noop,
|
|
62
|
-
};
|
|
63
51
|
async function pingProvider(provider, config) {
|
|
64
52
|
if (hasEmptyCredentials(provider, config)) {
|
|
65
53
|
return { ok: false, classification: "auth-failure", message: "no credentials configured" };
|
|
@@ -82,12 +70,19 @@ async function pingProvider(provider, config) {
|
|
|
82
70
|
/* v8 ignore next -- timeout callback: only fires after 10s, tests resolve faster @preserve */
|
|
83
71
|
const timeout = setTimeout(() => controller.abort(), PING_TIMEOUT_MS);
|
|
84
72
|
try {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
73
|
+
// Minimal API call — no thinking, no reasoning, no tools.
|
|
74
|
+
// We use the runtime's client directly to avoid provider-specific
|
|
75
|
+
// streamTurn params (adaptive thinking, reasoning effort, phase
|
|
76
|
+
// annotations) that can cause 400 errors unrelated to auth/quota.
|
|
77
|
+
if (provider === "anthropic") {
|
|
78
|
+
const client = runtime.client;
|
|
79
|
+
await client.messages.create({ model: runtime.model, max_tokens: 1, messages: [{ role: "user", content: "ping" }] }, { signal: controller.signal });
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
// OpenAI-compatible providers (azure, codex, minimax, github-copilot)
|
|
83
|
+
const client = runtime.client;
|
|
84
|
+
await client.chat.completions.create({ model: runtime.model, max_tokens: 1, messages: [{ role: "user", content: "ping" }] }, { signal: controller.signal });
|
|
85
|
+
}
|
|
91
86
|
return { ok: true };
|
|
92
87
|
}
|
|
93
88
|
finally {
|
|
@@ -628,7 +628,6 @@ async function handleBlueBubblesNormalizedEvent(event, resolvedDeps, source) {
|
|
|
628
628
|
capabilities: bbCapabilities,
|
|
629
629
|
messages: [userMessage],
|
|
630
630
|
continuityIngressTexts: getBlueBubblesContinuityIngressTexts(event),
|
|
631
|
-
callbacks,
|
|
632
631
|
friendResolver: { resolve: () => Promise.resolve(context) },
|
|
633
632
|
sessionLoader: {
|
|
634
633
|
loadOrCreate: () => Promise.resolve({
|
|
@@ -672,6 +671,7 @@ async function handleBlueBubblesNormalizedEvent(event, resolvedDeps, source) {
|
|
|
672
671
|
accumulateFriendTokens: resolvedDeps.accumulateFriendTokens,
|
|
673
672
|
signal: controller.signal,
|
|
674
673
|
runAgentOptions: { mcpManager },
|
|
674
|
+
callbacks,
|
|
675
675
|
failoverState: (() => {
|
|
676
676
|
if (!bbFailoverStates.has(event.chat.sessionKey)) {
|
|
677
677
|
bbFailoverStates.set(event.chat.sessionKey, { pending: null });
|
|
@@ -684,8 +684,6 @@ async function handleBlueBubblesNormalizedEvent(event, resolvedDeps, source) {
|
|
|
684
684
|
await client.sendText({ chat: event.chat, text: result.failoverMessage });
|
|
685
685
|
}
|
|
686
686
|
/* v8 ignore stop */
|
|
687
|
-
// switchedProvider: no separate confirmation — the agent's context message
|
|
688
|
-
// tells it about the switch, and it acknowledges naturally in its response.
|
|
689
687
|
// ── Handle gate result ────────────────────────────────────────
|
|
690
688
|
if (!result.gateResult.allowed) {
|
|
691
689
|
// Send auto-reply via BB API if the gate provides one
|