@livx.cc/agentx 0.99.93 → 0.99.95

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/dist/index.d.ts CHANGED
@@ -1204,6 +1204,13 @@ declare class DuplexAgent {
1204
1204
  * not dead air, and a nudge would run on the same aborted signal (live: the "[reminder]" landed in the
1205
1205
  * transcript as a user turn with no reply, session 20260923-101910 msg 27). */
1206
1206
  private endTurn;
1207
+ /** The turn SAID it is on it ("got it — checking…") but called no tool and nothing is running: a promise nothing
1208
+ * keeps — the user waits on silence (live Para #798: a follow-up while the reflex believed a finished task still ran). */
1209
+ private get hollowPromise();
1210
+ static readonly PROMISE_RE: RegExp;
1211
+ static readonly FOLLOW_THROUGH = "[reminder] You told the user you are checking, but no task is running and you called no tool. Keep that promise now: if a finished task result above already answers it, give that answer; otherwise call Act with a clear brief. Do not acknowledge again.";
1212
+ /** Re-prompt the reflex ONCE, tools allowed, to keep its hollow promise; the reminder never stays in the transcript. */
1213
+ private followThrough;
1207
1214
  /** Rewrite the UNFORWARDED reflex text: drop complete stage-direction parentheticals (STAGE_DIRECTION_RE) and spoken
1208
1215
  * junk (scrubSpokenJunk). Only the unforwarded region is touched — already-spoken audio can't be unsent, and
1209
1216
  * splicing before reflexForwarded would corrupt the forward offset. Rewritten per step segment so the stepMarks
package/dist/index.js CHANGED
@@ -4997,7 +4997,8 @@ var Agent = class _Agent {
4997
4997
  // a child obeys the parent's allow/deny rules (else Task is a one-call bypass)
4998
4998
  tools: [...o.tools, ...this.injectedTools],
4999
4999
  systemPrompt: o.systemPrompt,
5000
- providerOptionsFor: o.providerOptionsFor ?? ((m) => modelProvider(m) === modelProvider(o.model) ? o.providerOptions : void 0)
5000
+ // A child never resumes the parent's own claude-code session (the host's `resume` link is the parent's).
5001
+ providerOptionsFor: o.providerOptionsFor ?? ((m) => modelProvider(m) === modelProvider(o.model) && o.providerOptions ? { ...o.providerOptions, resume: void 0, onClaudeCodeSession: void 0 } : void 0)
5001
5002
  };
5002
5003
  tools = [...tools, makeTaskTool(taskOpts), makeTaskBatchTool(taskOpts)];
5003
5004
  }
@@ -9984,6 +9985,37 @@ ${nowLine()}. Anchor every relative or time-sensitive reference \u2014 "today",
9984
9985
  }
9985
9986
  if (this.silentTurn && res?.finishReason === "error" && refusedCall(res.error)) this.emitHost({ kind: "text_delta", message: fallback ?? _DuplexAgent.FALLBACK_ERROR });
9986
9987
  else if (this.silentTurn) await this.ackIfSilent(fallback);
9988
+ else if (this.hollowPromise) await this.followThrough();
9989
+ }
9990
+ /** The turn SAID it is on it ("got it — checking…") but called no tool and nothing is running: a promise nothing
9991
+ * keeps — the user waits on silence (live Para #798: a follow-up while the reflex believed a finished task still ran). */
9992
+ get hollowPromise() {
9993
+ if (!this.options.host || this.turnDispatched || this.leakHit || this.fabricationCut) return false;
9994
+ if (this.voice.transcript.slice(this.turnBase).some((m) => m.tool_calls?.length)) return false;
9995
+ if ([...this.tasks.values()].some((t) => t.status === "running")) return false;
9996
+ return _DuplexAgent.PROMISE_RE.test(this.turnSpoken);
9997
+ }
9998
+ static PROMISE_RE = /\b(?:checking|looking (?:into|it up)|let me (?:check|look|see|find|pull)|i(?:'ll| will) (?:check|look|find|pull)|on it|one (?:moment|sec(?:ond)?))\b/i;
9999
+ static FOLLOW_THROUGH = "[reminder] You told the user you are checking, but no task is running and you called no tool. Keep that promise now: if a finished task result above already answers it, give that answer; otherwise call Act with a clear brief. Do not acknowledge again.";
10000
+ /** Re-prompt the reflex ONCE, tools allowed, to keep its hollow promise; the reminder never stays in the transcript. */
10001
+ async followThrough() {
10002
+ const base = this.voice.transcript.length, reminder = _DuplexAgent.FOLLOW_THROUGH;
10003
+ this.notify("diag", "hollow_promise", { text: this.turnSpoken.trim().slice(0, 80) });
10004
+ this.turnSpoken = "";
10005
+ this.reflexBuf = "";
10006
+ this.reflexForwarded = 0;
10007
+ this.stepMarks = [];
10008
+ this.dropJudge();
10009
+ try {
10010
+ await this.voice.send(reminder);
10011
+ } catch (e) {
10012
+ log22.warn(`follow-through nudge failed: ${e instanceof Error ? e.message : e}`);
10013
+ } finally {
10014
+ const i = this.voice.transcript.findIndex((m, k) => k >= base && m.role === "user" && m.content === reminder);
10015
+ if (i >= 0) this.voice.transcript.splice(i, 1);
10016
+ await this.drainReflex();
10017
+ this.scrubLeakFromTranscript();
10018
+ }
9987
10019
  }
9988
10020
  /** Rewrite the UNFORWARDED reflex text: drop complete stage-direction parentheticals (STAGE_DIRECTION_RE) and spoken
9989
10021
  * junk (scrubSpokenJunk). Only the unforwarded region is touched — already-spoken audio can't be unsent, and