@ouro.bot/cli 0.1.0-alpha.91 → 0.1.0-alpha.92

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 CHANGED
@@ -1,6 +1,13 @@
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.92",
6
+ "changes": [
7
+ "Final-answer truth checks now reject `intent=complete` when a must-resolve handoff still has an active live-session return obligation and no newer follow-up proves the loop resumed.",
8
+ "This keeps visible operator loops open until the agent actually brings back the external-state update or reports a concrete blocker instead of going dark early."
9
+ ]
10
+ },
4
11
  {
5
12
  "version": "0.1.0-alpha.91",
6
13
  "changes": [
@@ -228,7 +228,7 @@ function parseFinalAnswerPayload(argumentsText) {
228
228
  return {};
229
229
  }
230
230
  }
231
- function getFinalAnswerRetryError(mustResolveBeforeHandoff, intent, sawSteeringFollowUp, delegationDecision, sawSendMessageSelf, sawGoInward, sawQuerySession, innerJob) {
231
+ function getFinalAnswerRetryError(mustResolveBeforeHandoff, intent, sawSteeringFollowUp, delegationDecision, sawSendMessageSelf, sawGoInward, sawQuerySession, currentObligation, innerJob) {
232
232
  // 1. Delegation adherence: delegate-inward without evidence of inward action
233
233
  if (delegationDecision?.target === "delegate-inward" && !sawSendMessageSelf && !sawGoInward && !sawQuerySession) {
234
234
  (0, runtime_1.emitNervesEvent)({
@@ -254,8 +254,11 @@ function getFinalAnswerRetryError(mustResolveBeforeHandoff, intent, sawSteeringF
254
254
  if (mustResolveBeforeHandoff && intent === "direct_reply" && !sawSteeringFollowUp) {
255
255
  return "your final_answer used intent=direct_reply without a newer steering follow-up. continue the unresolved work, or call final_answer again with intent=complete or blocked when appropriate.";
256
256
  }
257
- // 5. Default malformed fallback
258
- return "your final_answer was incomplete or malformed. call final_answer again with your complete response.";
257
+ // 5. mustResolveBeforeHandoff + complete while a live return loop is still active
258
+ if (mustResolveBeforeHandoff && intent === "complete" && currentObligation && !sawSteeringFollowUp) {
259
+ return "you still owe the live session a visible return on this work. don't end the turn yet — continue until you've brought back the external-state update, or use intent=blocked with the concrete blocker.";
260
+ }
261
+ return null;
259
262
  }
260
263
  // Re-export kick utilities for backward compat
261
264
  var kicks_1 = require("./kicks");
@@ -582,9 +585,11 @@ async function runAgent(messages, callbacks, channel, signal, options) {
582
585
  // Extract answer from the tool call arguments.
583
586
  // Supports: {"answer":"text","intent":"..."} or "text" (JSON string).
584
587
  const { answer, intent } = parseFinalAnswerPayload(result.toolCalls[0].arguments);
588
+ const retryError = getFinalAnswerRetryError(mustResolveBeforeHandoffActive, intent, sawSteeringFollowUp, options?.delegationDecision, sawSendMessageSelf, sawGoInward, sawQuerySession, options?.currentObligation ?? null, options?.activeWorkFrame?.inner?.job);
585
589
  const validDirectReply = mustResolveBeforeHandoffActive && intent === "direct_reply" && sawSteeringFollowUp;
586
590
  const validTerminalIntent = intent === "complete" || intent === "blocked";
587
591
  const validClosure = answer != null
592
+ && !retryError
588
593
  && (!mustResolveBeforeHandoffActive || validDirectReply || validTerminalIntent);
589
594
  if (validClosure) {
590
595
  completion = {
@@ -622,10 +627,9 @@ async function runAgent(messages, callbacks, channel, signal, options) {
622
627
  // malformed. Clear any partial streamed text or noise, then push the
623
628
  // assistant msg + error tool result and let the model try again.
624
629
  callbacks.onClearText?.();
625
- const retryError = getFinalAnswerRetryError(mustResolveBeforeHandoffActive, intent, sawSteeringFollowUp, options?.delegationDecision, sawSendMessageSelf, sawGoInward);
626
630
  messages.push(msg);
627
- messages.push({ role: "tool", tool_call_id: result.toolCalls[0].id, content: retryError });
628
- providerRuntime.appendToolOutput(result.toolCalls[0].id, retryError);
631
+ messages.push({ role: "tool", tool_call_id: result.toolCalls[0].id, content: retryError ?? "your final_answer was incomplete or malformed. call final_answer again with your complete response." });
632
+ providerRuntime.appendToolOutput(result.toolCalls[0].id, retryError ?? "your final_answer was incomplete or malformed. call final_answer again with your complete response.");
629
633
  }
630
634
  continue;
631
635
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.91",
3
+ "version": "0.1.0-alpha.92",
4
4
  "main": "dist/heart/daemon/ouro-entry.js",
5
5
  "bin": {
6
6
  "cli": "dist/heart/daemon/ouro-bot-entry.js",