teapot-coding-agent 0.37.159 → 0.37.160
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/agent/agent.js
CHANGED
|
@@ -245,6 +245,15 @@ export class Agent {
|
|
|
245
245
|
pendingSubReport = "";
|
|
246
246
|
compactPhase = "";
|
|
247
247
|
awaitingUser = false;
|
|
248
|
+
/**
|
|
249
|
+
* The event id of the question the loop is parked on.
|
|
250
|
+
*
|
|
251
|
+
* The status says `needs_operator`, but the ROW lives in the log and the client only holds the last page of events — so
|
|
252
|
+
* a question that was asked before that window was invisible until the operator scrolled far enough:
|
|
253
|
+
* "タイムラインにask_userが出てないのにneeds_operatorが出てる / しばらくいじいじしてたら出てきた". The id lets the client
|
|
254
|
+
* fetch the page that contains it.
|
|
255
|
+
*/
|
|
256
|
+
pendingQuestionId = "";
|
|
248
257
|
/** when the previous round finished, for the time anchor in harness messages (#194) */
|
|
249
258
|
lastTurnEndedAt = null;
|
|
250
259
|
/** the last assistant text, so the loop can tell a context-limit stop from a real one (#201) */
|
|
@@ -1260,6 +1269,7 @@ export class Agent {
|
|
|
1260
1269
|
todo: this.todo.slice(0, 32_000),
|
|
1261
1270
|
parent: this.opts.parent,
|
|
1262
1271
|
awaiting: this.awaitingUser,
|
|
1272
|
+
...(this.awaitingUser && this.pendingQuestionId ? { pendingQuestionId: this.pendingQuestionId } : {}),
|
|
1263
1273
|
autoContinue: this.opts.autoContinue,
|
|
1264
1274
|
autoCompact: this.opts.autoCompact,
|
|
1265
1275
|
};
|
|
@@ -1909,11 +1919,12 @@ export class Agent {
|
|
|
1909
1919
|
})
|
|
1910
1920
|
.filter((o) => o.trim())
|
|
1911
1921
|
: [];
|
|
1912
|
-
await this.log.append("question", this.currentSession, this.currentBranch, {
|
|
1922
|
+
const questionEvent = await this.log.append("question", this.currentSession, this.currentBranch, {
|
|
1913
1923
|
question,
|
|
1914
1924
|
options,
|
|
1915
1925
|
callId: call.id,
|
|
1916
1926
|
});
|
|
1927
|
+
this.pendingQuestionId = questionEvent?.id ?? "";
|
|
1917
1928
|
await this.answerMeta(call, "question shown to the operator — the loop is parked until they reply. " +
|
|
1918
1929
|
"Their reply (possibly free text, not one of the options) arrives as your next user message.");
|
|
1919
1930
|
this.awaitingUser = true;
|