@livx.cc/agentx 0.99.29 → 0.99.30

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.
@@ -326,8 +326,10 @@ declare class AgentOptions {
326
326
  /** Stream tokens from the model. Takes effect only with a `host.notify`; off => current (non-stream) behavior. */
327
327
  stream: boolean;
328
328
  /** Closure reflex for delegated runtimes (cursor/claude-code): when such a turn ends on a tool call with
329
- * no assistant text after it (the runtime went silent post-work), nudge ONE more step for a brief summary
330
- * of what changed + what's pending — so the turn delivers a wrap-up instead of trailing off mid-narration.
329
+ * no assistant text after it (the runtime went silent post-work), nudge ONE more step to ANSWER the user
330
+ * from the tool results already in the transcript — so the turn delivers a reply instead of trailing off
331
+ * mid-narration. Deliberately not a "summarize what you did" nudge: that produced process reports and
332
+ * permission-asking instead of answers (see the nudge text in runLoop).
331
333
  * Fires at most once per run and only for delegated runtimes (native turns never emit the trigger). */
332
334
  closeDelegatedTurns: boolean;
333
335
  /** Fold the dropped middle of an over-long transcript into a synthetic summary (edge-safe, no LLM). Off => drop-oldest. */
package/dist/cli.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bun
2
- import { H as Hooks, i as RunResult, R as ReasoningEffort, A as Agent } from './Agent-qoEmC4ic.js';
2
+ import { H as Hooks, i as RunResult, R as ReasoningEffort, A as Agent } from './Agent-DC7FEEjF.js';
3
3
  import { IFilesystem } from '@livx.cc/wcli/core';
4
4
  import { M as Message, U as UserQuestion, H as HostBridge, c as ContentPart, g as MessageContent } from './tools-BZVppx-6.js';
5
5
 
package/dist/cli.js CHANGED
@@ -3615,8 +3615,10 @@ var AgentOptions = class {
3615
3615
  /** Stream tokens from the model. Takes effect only with a `host.notify`; off => current (non-stream) behavior. */
3616
3616
  stream = false;
3617
3617
  /** Closure reflex for delegated runtimes (cursor/claude-code): when such a turn ends on a tool call with
3618
- * no assistant text after it (the runtime went silent post-work), nudge ONE more step for a brief summary
3619
- * of what changed + what's pending — so the turn delivers a wrap-up instead of trailing off mid-narration.
3618
+ * no assistant text after it (the runtime went silent post-work), nudge ONE more step to ANSWER the user
3619
+ * from the tool results already in the transcript — so the turn delivers a reply instead of trailing off
3620
+ * mid-narration. Deliberately not a "summarize what you did" nudge: that produced process reports and
3621
+ * permission-asking instead of answers (see the nudge text in runLoop).
3620
3622
  * Fires at most once per run and only for delegated runtimes (native turns never emit the trigger). */
3621
3623
  closeDelegatedTurns = true;
3622
3624
  /** Fold the dropped middle of an over-long transcript into a synthetic summary (edge-safe, no LLM). Off => drop-oldest. */
@@ -4118,8 +4120,11 @@ var Agent = class _Agent {
4118
4120
  if (this.drainInjections()) continue;
4119
4121
  if (o.closeDelegatedTurns && res.endedOnToolNoText && !closureNudged && steps < o.maxSteps) {
4120
4122
  closureNudged = true;
4121
- log6.verbose("delegated turn went silent after a tool \u2014 nudging a closing summary");
4122
- this.transcript.push({ role: "user", content: "Summarize what you did this turn and what (if anything) still needs doing. Be concise." });
4123
+ log6.verbose("delegated turn went silent after a tool \u2014 nudging a closing answer");
4124
+ this.transcript.push({
4125
+ role: "user",
4126
+ content: "You ran tools but did not reply. Answer the user now using the tool results above; if a tool failed, say so plainly. Do NOT re-run those tools, do NOT narrate what you did, and do NOT ask for permission to continue."
4127
+ });
4123
4128
  continue;
4124
4129
  }
4125
4130
  log6.verbose(`completed in ${steps} step(s)`);
@@ -13611,9 +13616,8 @@ async function runTurn(agent, store, session, task, cp, cwd = process.cwd(), sen
13611
13616
  const cost = turnCost(agent.options.model, res.usage);
13612
13617
  const m = res.usageEstimated ? "~" : "";
13613
13618
  const tok = res.usage?.totalTokens ? `${m}${(res.usage.totalTokens / 1e3).toFixed(1)}k tok \xB7 ${cost > 0 ? m + fmtUsd(cost) + " \xB7 " : ""}` : "";
13614
- const lastUser = res.messages.map((m2) => m2.role).lastIndexOf("user");
13615
13619
  agent.options.host?.takeToolCount?.();
13616
- const tools = res.messages.slice(lastUser).filter((m2) => m2.role === "tool").length;
13620
+ const tools = res.messages.slice(msgsBefore).filter((m2) => m2.role === "tool").length;
13617
13621
  const ok = res.finishReason === "stop";
13618
13622
  const shortId = session.meta.id.replace(/^\d{8}-/, "");
13619
13623
  const didWork = agent.transcript.slice(msgsBefore).some((m2) => m2.role === "assistant" || m2.role === "tool");