@quikit/quikpilot-runner 9.3.0-rc.36 → 9.3.0-rc.37
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/README.md +2 -0
- package/dist/index.js +27 -10
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -152,6 +152,8 @@ wrong (a field that arrives from a database row or a request), so it only warns
|
|
|
152
152
|
|
|
153
153
|
**9.3.0-rc.36 — the run record says what each step cost and what it could touch (QUIKTR-1582, S7).** Each loop turn now records its request size by part (the list of files or the repository summary, the test cases, the task, earlier answers, the AI's notes, the fixed instructions; the runner's own estimate) and what the AI Runtime said the call used (`tokensInput`, `tokensOutput`, `costEstimateUsd`, `latencyMs`), at most 30 rows per loop; each step's record also carries its totals over the whole job (every attempt, phase and fix). The record says which folder the run could change and which it could read, and its largest request, in the list view too (before, only in map mode). The report back carries `aiCostUsd`, the sum of the AI Runtime's cost estimate over every AI call of the job (the estimate leaves out the model's thinking; the early look's own cost is not included). The early look's first call now waits up to 150 seconds (it was 60), so a cold AI service no longer ends it at once; QuikProjects waits about 200 seconds for the whole look, so it cannot wait longer. Numbers only: no text from a request or a reply is kept.
|
|
154
154
|
|
|
155
|
+
**9.3.0-rc.37 — the AI always sees what it just read (QUIKTR-1582, S7).** In map mode the code-writing loop trims old read outputs once a request passes a soft target, to keep turns small. That target was a flat 40,000 estimated tokens, and the trim also took the outputs of the turn just finished, before the AI had seen them. On a big repository the loop's first request alone can weigh about 36,000 (the summary, the context files, the cases), so every read went over the target and was dropped unseen: in the first S7 trial on the QuikIT fork the AI read the same three files 27 times and wrote nothing. Now the soft target is the first request plus room for 20,000 tokens of reads (at least 40,000, never above the ceiling); the soft trim only takes outputs the AI has already been shown; and an output it has not seen is dropped only when nothing else makes the request fit the ceiling, after the text of old writes is shortened. That last case answers "Too large to send with the rest of this request. Read a smaller part of the file." and logs `codegen.read_dropped_unseen`. Listing mode keeps the ceiling as its only target, with the same order.
|
|
156
|
+
|
|
155
157
|
**9.3.0-rc.35 — the AI's own notes, old looks shrunk to a stub, the end-of-turn recap, a folder's guidance, and the newer versions only where a repository needs them (QUIKTR-1581, S6 release B; contract §37).** On `targeting-loop-4` and `codegen-loop-6` (each behind its own AI Runtime flag; a refusal steps one version back, `-4` to `-3` and `-6` to `-5`, then as before) a loop request carries `loop.recap`, the LAST key of `loop`: the approved cases, the folders the AI may change and its own notes. A `TOOL_CALLS` reply may carry `notes`; they replace the notes kept so far (an empty string clears them, a reply without them keeps them), credentials are hidden, at most 1,500 characters are kept, and the run record keeps their length only. The answer of a look (`list_files`, `read_file`, `grep`, `find_definition`) from a turn older than the latest three shrinks to `{dropped: true, note: "read src/a.ts lines 120-220"}`; asking for it again is answered afresh, not as a repeat. The first read under a folder that has its own `AGENTS.md`, `CLAUDE.md` or `README.md` (not the repository root's, not one already shown in the repository map) carries that file once, credentials hidden, at most 2,000 characters, at most six a run. The early look's `findings` are cut to 6,000 characters of JSON before they are handed on (open questions first, never what the verdict stands on). **`QUIKPILOT_TOOLS2` now defaults to `auto`**: search tools v2 and the notes are asked for only when the repository needs them, that is in the map view or when its file list would cost `QUIKPILOT_TOOLS_MIN_TOKENS` (default 8,000) or more tokens; a small project keeps the loops it always had (`targeting-loop-1`, `codegen-loop-3`) and pays for no extra tool, response format or recap. `on` always asks for the newest version, `off` never asks, and `QUIKPILOT_NOTES=off` keeps the tools but never asks for the notes. The run logs `tools.decided`.
|
|
156
158
|
|
|
157
159
|
**9.3.0-rc.34 — the first turn of a loop waits for a new response schema (QUIKTR-1581 follow-up).** The first call with a response schema the model provider has not seen recently is very slow (232 to 275 seconds measured on 19 Oct 2026 for a request that takes 5 to 8 once the provider has it) and fast afterwards. The targeting loop's turn limit was 180 seconds, the same as the AI Runtime's own provider timeout, so that first call was cut off every time, the provider never kept the schema, and runs fell back to the single targeting call (one found no file and failed). Now the FIRST turn of the targeting loop and of the code-writing loop waits up to 420 seconds; every later turn keeps its own limit (180 and 300), so a hung call does not cost the long wait twice. The targeting loop's whole-loop limit is 900 seconds (it was 600). A limit set by the caller still applies to every turn. Pair it with `OPENROUTER_TIMEOUT_SECONDS=420` on the AI Runtime (its default, 180, ends the call before the runner would). Nothing else changes.
|
package/dist/index.js
CHANGED
|
@@ -39845,6 +39845,10 @@ var CODEGEN_LOOP_4_CONTRACT_VERSION = "codegen-loop-4";
|
|
|
39845
39845
|
var CODEGEN_LOOP_5_CONTRACT_VERSION = "codegen-loop-5";
|
|
39846
39846
|
var CODEGEN_LOOP_6_CONTRACT_VERSION = "codegen-loop-6";
|
|
39847
39847
|
var MAP_SOFT_REQUEST_TOKENS = 4e4;
|
|
39848
|
+
var MAP_SOFT_HEADROOM_TOKENS = 2e4;
|
|
39849
|
+
function mapSoftTarget(firstRequestTokens, ceiling) {
|
|
39850
|
+
return Math.min(ceiling, Math.max(MAP_SOFT_REQUEST_TOKENS, firstRequestTokens + MAP_SOFT_HEADROOM_TOKENS));
|
|
39851
|
+
}
|
|
39848
39852
|
var CodegenLoopFailure = class extends Error {
|
|
39849
39853
|
reason;
|
|
39850
39854
|
runtimeCode;
|
|
@@ -39913,6 +39917,7 @@ function isTestAnswer(x) {
|
|
|
39913
39917
|
return isPlainObject3(x) && typeof x.passed === "number" && Array.isArray(x.failingTests);
|
|
39914
39918
|
}
|
|
39915
39919
|
var DROPPED_OUTPUT = { dropped: true, note: "Dropped to keep the request small. Read the file again if you need it." };
|
|
39920
|
+
var DROPPED_UNSEEN_OUTPUT = { dropped: true, note: "Too large to send with the rest of this request. Read a smaller part of the file." };
|
|
39916
39921
|
function repoMapGuidancePaths(baseContext) {
|
|
39917
39922
|
const map = baseContext.repoMap;
|
|
39918
39923
|
return (Array.isArray(map?.guidance) ? map.guidance : []).map((g) => g.path).filter((p) => typeof p === "string");
|
|
@@ -39969,6 +39974,7 @@ async function runCodegenLoop(args, deps) {
|
|
|
39969
39974
|
const notesOn = harness && args.tools2?.notes === true;
|
|
39970
39975
|
const contractVersion = harness ? args.tools2 ? notesOn ? CODEGEN_LOOP_6_CONTRACT_VERSION : CODEGEN_LOOP_5_CONTRACT_VERSION : args.readRoots ? CODEGEN_LOOP_4_CONTRACT_VERSION : CODEGEN_LOOP_3_CONTRACT_VERSION : tests ? CODEGEN_LOOP_2_CONTRACT_VERSION : CODEGEN_LOOP_CONTRACT_VERSION;
|
|
39971
39976
|
let peakRequestTokens = 0;
|
|
39977
|
+
let firstRequestTokens = 0;
|
|
39972
39978
|
const usage = new TurnUsage();
|
|
39973
39979
|
let notes = "";
|
|
39974
39980
|
let stubbed = 0;
|
|
@@ -40081,19 +40087,26 @@ async function runCodegenLoop(args, deps) {
|
|
|
40081
40087
|
...usage.totals.calls > 0 ? { turnUsage: usage.rows.map((r) => ({ ...r, parts: { ...r.parts } })), usage: { ...usage.totals } } : {},
|
|
40082
40088
|
...usage.rowsCut ? { turnUsageCut: true } : {}
|
|
40083
40089
|
});
|
|
40084
|
-
const
|
|
40085
|
-
const under = (limit) => estimateRequestTokens(buildContext(nextTurn, nextFinal, finalReason)) <= limit;
|
|
40086
|
-
const fits = () => under(limits.maxRequestTokens);
|
|
40087
|
-
const soft = args.readRoots ? Math.min(MAP_SOFT_REQUEST_TOKENS, limits.maxRequestTokens) : limits.maxRequestTokens;
|
|
40088
|
-
if (under(soft)) return true;
|
|
40090
|
+
const dropOutputs = (upTo, done, output) => {
|
|
40089
40091
|
const lastTestRun = toolResults.map((r) => r.name).lastIndexOf(RUN_TESTS_TOOL);
|
|
40090
40092
|
const lastCall = toolResults.map((r) => r.name).lastIndexOf(CALL_FUNCTION_TOOL);
|
|
40091
|
-
|
|
40093
|
+
let dropped = 0;
|
|
40094
|
+
for (let i2 = 0; i2 < upTo && !done(); i2++) {
|
|
40092
40095
|
const r = toolResults[i2];
|
|
40093
|
-
if (
|
|
40094
|
-
|
|
40095
|
-
if (
|
|
40096
|
+
if (r.output === DROPPED_OUTPUT || r.output === DROPPED_UNSEEN_OUTPUT) continue;
|
|
40097
|
+
const stale = READ_TOOLS.has(r.name) && r.status === "ok" || r.name === RUN_TESTS_TOOL && i2 !== lastTestRun && r.output !== void 0 || r.name === CALL_FUNCTION_TOOL && i2 !== lastCall && r.output !== void 0;
|
|
40098
|
+
if (!stale) continue;
|
|
40099
|
+
toolResults[i2] = { ...r, output };
|
|
40100
|
+
dropped++;
|
|
40096
40101
|
}
|
|
40102
|
+
return dropped;
|
|
40103
|
+
};
|
|
40104
|
+
const makeRoom = (nextTurn, nextFinal, finalReason) => {
|
|
40105
|
+
const under = (limit) => estimateRequestTokens(buildContext(nextTurn, nextFinal, finalReason)) <= limit;
|
|
40106
|
+
const fits = () => under(limits.maxRequestTokens);
|
|
40107
|
+
const soft = args.readRoots ? mapSoftTarget(firstRequestTokens, limits.maxRequestTokens) : limits.maxRequestTokens;
|
|
40108
|
+
if (under(soft)) return true;
|
|
40109
|
+
dropOutputs(sent.results, () => under(soft), DROPPED_OUTPUT);
|
|
40097
40110
|
for (const key of [...ledger.seen.keys()]) {
|
|
40098
40111
|
if (key.startsWith("read_file:") || key.startsWith("grep:") || key.startsWith("list_files:") || key.startsWith("show_changes:")) ledger.seen.delete(key);
|
|
40099
40112
|
}
|
|
@@ -40105,6 +40118,9 @@ async function runCodegenLoop(args, deps) {
|
|
|
40105
40118
|
return { ...c, args: { ...path, _omitted: "written earlier; read the file to see it" } };
|
|
40106
40119
|
});
|
|
40107
40120
|
}
|
|
40121
|
+
if (fits()) return true;
|
|
40122
|
+
const unseen = dropOutputs(toolResults.length, fits, DROPPED_UNSEEN_OUTPUT);
|
|
40123
|
+
if (unseen > 0) log({ event: "codegen.read_dropped_unseen", turn: nextTurn - 1, outputs: unseen, ceiling: limits.maxRequestTokens });
|
|
40108
40124
|
return fits();
|
|
40109
40125
|
};
|
|
40110
40126
|
const settleNextTurn = (turn, forcedNow) => {
|
|
@@ -40165,6 +40181,7 @@ async function runCodegenLoop(args, deps) {
|
|
|
40165
40181
|
const contextData = buildContext(turn, isFinal, finalReason);
|
|
40166
40182
|
const requestTokens = estimateRequestTokens(contextData);
|
|
40167
40183
|
peakRequestTokens = Math.max(peakRequestTokens, requestTokens);
|
|
40184
|
+
if (firstRequestTokens === 0) firstRequestTokens = requestTokens;
|
|
40168
40185
|
if (requestTokens > limits.maxRequestTokens) {
|
|
40169
40186
|
log({ event: "codegen.loop_ceiling", turn, action: "not_sent", projectedTokens: requestTokens, ceiling: limits.maxRequestTokens });
|
|
40170
40187
|
throw new CodegenLoopFailure("token_ceiling");
|
|
@@ -43179,7 +43196,7 @@ var FAILURE_ARTIFACT_DIR = "quikpilot-failure";
|
|
|
43179
43196
|
var REPORT_COPY = "final-test-report.xml";
|
|
43180
43197
|
var MAX_REPORT_BYTES = 5 * 1024 * 1024;
|
|
43181
43198
|
var MAX_FILES = 200;
|
|
43182
|
-
var RUNNER_VERSION = true ? "9.3.0-rc.
|
|
43199
|
+
var RUNNER_VERSION = true ? "9.3.0-rc.37" : "dev";
|
|
43183
43200
|
function safeDestination(base, repoPath) {
|
|
43184
43201
|
if (!repoPath || (0, import_node_path21.isAbsolute)(repoPath)) return null;
|
|
43185
43202
|
const destination = (0, import_node_path21.resolve)(base, repoPath);
|