@triflux/remote 10.62.0 → 10.63.0
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.
|
@@ -58,6 +58,28 @@ function beginTurn(state) {
|
|
|
58
58
|
function acceptEntry(state, entry, marker) {
|
|
59
59
|
if (entry?.isSidechain) return;
|
|
60
60
|
const message = entry?.message;
|
|
61
|
+
if (
|
|
62
|
+
entry?.type === "attachment" &&
|
|
63
|
+
entry.attachment?.type === "goal_status"
|
|
64
|
+
) {
|
|
65
|
+
const goal = entry.attachment;
|
|
66
|
+
const cleared = goal.met === true && goal.sentinel === true;
|
|
67
|
+
state.goal = {
|
|
68
|
+
state: cleared ? "none" : goal.met ? "complete" : "active",
|
|
69
|
+
objective: cleared ? null : goal.condition,
|
|
70
|
+
judgedBy: "evaluator",
|
|
71
|
+
...(goal.reason !== undefined ? { reason: goal.reason } : {}),
|
|
72
|
+
...(goal.tokens !== undefined ? { tokensUsed: goal.tokens } : {}),
|
|
73
|
+
updatedAt: entry.timestamp ?? null,
|
|
74
|
+
};
|
|
75
|
+
if (goal.sentinel === true) {
|
|
76
|
+
state.goalSentinel = {
|
|
77
|
+
...goal,
|
|
78
|
+
updatedAt: entry.timestamp,
|
|
79
|
+
count: (state.goalSentinel?.count ?? 0) + 1,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
61
83
|
if (entry?.type === "system" && entry.subtype === "compact_boundary") {
|
|
62
84
|
state.compactCount += 1;
|
|
63
85
|
state.compact = {
|
|
@@ -211,6 +233,8 @@ export async function readClaudeTranscript(transcriptPath, { requestId } = {}) {
|
|
|
211
233
|
measuredAt: null,
|
|
212
234
|
compactCount: 0,
|
|
213
235
|
compact: null,
|
|
236
|
+
goal: { state: "none", objective: null, judgedBy: "evaluator" },
|
|
237
|
+
goalSentinel: null,
|
|
214
238
|
};
|
|
215
239
|
}
|
|
216
240
|
try {
|
|
@@ -248,6 +272,7 @@ export async function readClaudeTranscript(transcriptPath, { requestId } = {}) {
|
|
|
248
272
|
model: state.model,
|
|
249
273
|
measuredAt: state.measuredAt,
|
|
250
274
|
},
|
|
275
|
+
enqueued: state.queuedContent !== null,
|
|
251
276
|
userSeen: state.userSeen,
|
|
252
277
|
response: state.response,
|
|
253
278
|
error: state.error,
|
|
@@ -255,5 +280,7 @@ export async function readClaudeTranscript(transcriptPath, { requestId } = {}) {
|
|
|
255
280
|
sectionClosed: state.sectionClosed,
|
|
256
281
|
compactCount: state.compactCount,
|
|
257
282
|
compact: state.compact,
|
|
283
|
+
goal: state.goal,
|
|
284
|
+
goalSentinel: state.goalSentinel,
|
|
258
285
|
};
|
|
259
286
|
}
|
|
@@ -137,12 +137,19 @@ function acceptCodexLine(state, line) {
|
|
|
137
137
|
} catch {
|
|
138
138
|
return false;
|
|
139
139
|
}
|
|
140
|
+
if (entry?.type === "compacted") {
|
|
141
|
+
state.compactCount += 1;
|
|
142
|
+
state.compact = { preTokens: state.tokens, postTokens: null };
|
|
143
|
+
}
|
|
140
144
|
if (entry?.type === "turn_context")
|
|
141
145
|
state.model = entry.payload?.model || state.model;
|
|
142
146
|
if (entry?.type === "event_msg" && entry.payload?.type === "token_count") {
|
|
143
147
|
const info = entry.payload.info;
|
|
144
|
-
if (Number.isFinite(info?.last_token_usage?.total_tokens))
|
|
148
|
+
if (Number.isFinite(info?.last_token_usage?.total_tokens)) {
|
|
145
149
|
state.tokens = info.last_token_usage.total_tokens;
|
|
150
|
+
if (state.compact && state.compact.postTokens === null)
|
|
151
|
+
state.compact.postTokens = state.tokens;
|
|
152
|
+
}
|
|
146
153
|
if (Number.isFinite(info?.model_context_window))
|
|
147
154
|
state.executionContextLimitTokens = info.model_context_window;
|
|
148
155
|
}
|
|
@@ -172,6 +179,8 @@ export async function readCodexContext(rolloutPath, threadId) {
|
|
|
172
179
|
decoder: new StringDecoder("utf8"),
|
|
173
180
|
model: null,
|
|
174
181
|
tokens: null,
|
|
182
|
+
compactCount: 0,
|
|
183
|
+
compact: null,
|
|
175
184
|
executionContextLimitTokens: null,
|
|
176
185
|
};
|
|
177
186
|
}
|
|
@@ -199,6 +208,8 @@ export async function readCodexContext(rolloutPath, threadId) {
|
|
|
199
208
|
return {
|
|
200
209
|
...modelContext("codex", state.model, state.tokens),
|
|
201
210
|
model: state.model,
|
|
211
|
+
compactCount: state.compactCount,
|
|
212
|
+
compact: state.compact,
|
|
202
213
|
executionContextLimitTokens: state.executionContextLimitTokens,
|
|
203
214
|
};
|
|
204
215
|
}
|