@vectorize-io/hindsight-coding-agents 0.3.1 → 0.3.2
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/antigravity-hook.js +7 -0
- package/dist/antigravity-stop-hook.js +31 -10
- package/dist/claude-hook.js +7 -0
- package/dist/claude-sessionstart-hook.js +7 -0
- package/dist/claude-stop-hook.js +31 -10
- package/dist/cline.js +19 -9
- package/dist/codex-hook.js +7 -0
- package/dist/codex-sessionstart-hook.js +7 -0
- package/dist/codex-stop-hook.js +31 -10
- package/dist/copilot-hook.js +7 -0
- package/dist/copilot-sessionstart-hook.js +7 -0
- package/dist/copilot-stop-hook.js +31 -10
- package/dist/cursor-hook.js +7 -0
- package/dist/cursor-sessionstart-hook.js +7 -0
- package/dist/cursor-stop-hook.js +31 -10
- package/dist/devin-hook.js +7 -0
- package/dist/devin-sessionstart-hook.js +7 -0
- package/dist/devin-stop-hook.js +31 -10
- package/dist/grok-hook.js +7 -0
- package/dist/grok-sessionstart-hook.js +7 -0
- package/dist/grok-stop-hook.js +31 -10
- package/dist/index.js +19 -9
- package/dist/installer.js +7 -0
- package/dist/kilo.js +19 -9
- package/dist/prime-agent.js +19 -9
- package/package.json +1 -1
package/dist/prime-agent.js
CHANGED
|
@@ -16073,10 +16073,10 @@ async function supportsAppend(client) {
|
|
|
16073
16073
|
return false;
|
|
16074
16074
|
}
|
|
16075
16075
|
}
|
|
16076
|
+
var DEFAULT_RETRY_WINDOW_MS = 6e4;
|
|
16076
16077
|
var RETAIN_RETRY_ATTEMPTS = 2;
|
|
16077
|
-
var
|
|
16078
|
-
async function submitWithRetry(send, isStillNewest) {
|
|
16079
|
-
let spent = 0;
|
|
16078
|
+
var REQUEST_BUDGET_MS = 15e3;
|
|
16079
|
+
async function submitWithRetry(send, isStillNewest, retryUntil) {
|
|
16080
16080
|
for (let attempt = 0; ; attempt++) {
|
|
16081
16081
|
try {
|
|
16082
16082
|
return await send();
|
|
@@ -16084,8 +16084,7 @@ async function submitWithRetry(send, isStillNewest) {
|
|
|
16084
16084
|
const limited = e instanceof RateLimitedError;
|
|
16085
16085
|
if (!limited || attempt >= RETAIN_RETRY_ATTEMPTS || !isStillNewest()) throw e;
|
|
16086
16086
|
const wait = e.retryAfterMs || 1e3;
|
|
16087
|
-
if (wait
|
|
16088
|
-
spent += wait;
|
|
16087
|
+
if (Date.now() + wait + REQUEST_BUDGET_MS > retryUntil) throw e;
|
|
16089
16088
|
await sleep(wait);
|
|
16090
16089
|
}
|
|
16091
16090
|
}
|
|
@@ -16105,14 +16104,24 @@ function serialize(cursors, sessionId, write2) {
|
|
|
16105
16104
|
}
|
|
16106
16105
|
async function retainLiveSession(client, sessionId, turns, startTs, harness, opts = {}) {
|
|
16107
16106
|
const cursors = opts.cursors;
|
|
16108
|
-
if (!cursors)
|
|
16107
|
+
if (!cursors)
|
|
16108
|
+
return writeSession(
|
|
16109
|
+
client,
|
|
16110
|
+
sessionId,
|
|
16111
|
+
turns,
|
|
16112
|
+
startTs,
|
|
16113
|
+
harness,
|
|
16114
|
+
opts.stamp,
|
|
16115
|
+
void 0,
|
|
16116
|
+
opts.retryUntil
|
|
16117
|
+
);
|
|
16109
16118
|
return serialize(
|
|
16110
16119
|
cursors,
|
|
16111
16120
|
sessionId,
|
|
16112
|
-
() => writeSession(client, sessionId, turns, startTs, harness, opts.stamp, cursors)
|
|
16121
|
+
() => writeSession(client, sessionId, turns, startTs, harness, opts.stamp, cursors, opts.retryUntil)
|
|
16113
16122
|
);
|
|
16114
16123
|
}
|
|
16115
|
-
async function writeSession(client, sessionId, turns, startTs, harness, stamp, cursors) {
|
|
16124
|
+
async function writeSession(client, sessionId, turns, startTs, harness, stamp, cursors, retryUntil = Date.now() + DEFAULT_RETRY_WINDOW_MS) {
|
|
16116
16125
|
const refId = `conversation:${sessionId}`;
|
|
16117
16126
|
const appendSupported = Boolean(cursors) && await supportsAppend(client);
|
|
16118
16127
|
const plan = planRetain(turns, cursors?.read(sessionId), { appendSupported, bank: client.bank });
|
|
@@ -16164,7 +16173,8 @@ ${content}`),
|
|
|
16164
16173
|
if (!cursors) return true;
|
|
16165
16174
|
const now = cursors.read(sessionId);
|
|
16166
16175
|
return now?.turns === claimed.turns && now?.fingerprint === claimed.fingerprint;
|
|
16167
|
-
}
|
|
16176
|
+
},
|
|
16177
|
+
retryUntil
|
|
16168
16178
|
);
|
|
16169
16179
|
cursors?.write(sessionId, next);
|
|
16170
16180
|
}
|