trantor 0.18.65 → 0.18.66
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/.claude-plugin/plugin.json +1 -1
- package/bin/crew-runner.mjs +23 -5
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trantor",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.66",
|
|
4
4
|
"description": "Trantor — the hub-world for AI agent crews: live message bus, presence, project Kanban/flow board + crew orchestration for independent AI coding agents (Claude, Codex, Gemini, Kimi, DeepSeek)",
|
|
5
5
|
"mcpServers": {
|
|
6
6
|
"relay": {
|
package/bin/crew-runner.mjs
CHANGED
|
@@ -1014,14 +1014,32 @@ async function loadLessons() {
|
|
|
1014
1014
|
// #5683: every prompt section is capped (bin/crew-payload.mjs) and the payload has ONE hard total
|
|
1015
1015
|
// cap; below the caps the composition is byte-identical to the old concatenation.
|
|
1016
1016
|
function composedTurn({ base = "", wakeText = "", ctxText = "", againText = "", tailText = "", rulesText = "", lessons = null }) {
|
|
1017
|
+
// STABLE FIRST, VOLATILE LAST — this order is a COST decision, not a stylistic one (#8199).
|
|
1018
|
+
// Every provider we send this to caches on an exact prefix match from token 0: DeepSeek's docs say
|
|
1019
|
+
// "only requests with identical prefixes (starting from the 0th token) will be considered
|
|
1020
|
+
// duplicates, and partial matches in the middle of the input will not trigger a cache hit", and a
|
|
1021
|
+
// hit bills at roughly a tenth of a miss. This array used to open with `base` and then the
|
|
1022
|
+
// per-turn WAKE, with the big unchanging blocks (RULES, lessons) buried at the end. On an ordinary
|
|
1023
|
+
// turn `base` is empty — the sha rides inside `again` — so token 0 was the wake text itself, which
|
|
1024
|
+
// is different every turn by definition. No cache could ever hit, and ~4,800 tokens of identical preamble were re-bought at full rate per turn,
|
|
1025
|
+
// on every foreign-CLI seat: dsh, codex, kimi and every opencode/BYOM seat. The state path had
|
|
1026
|
+
// known this for weeks — lib/state/assemble.mjs: "the bytes before STATE_DELIM are the caller's
|
|
1027
|
+
// preamble and NOTHING else, or prefix caching never engages" — and it was never carried across.
|
|
1028
|
+
//
|
|
1029
|
+
// Reading order improves with it rather than suffering: rules and lessons are the standing brief,
|
|
1030
|
+
// then context and history, and the ASK lands last, which is what #7063 found a work order wants.
|
|
1031
|
+
//
|
|
1032
|
+
// The `order` field is UNRELATED to this and deliberately unchanged: it ranks what gets trimmed
|
|
1033
|
+
// when the payload busts its total cap, and wake is trimmed last there because losing the
|
|
1034
|
+
// instruction is worse than losing the cache on that one turn.
|
|
1017
1035
|
const built = composePrompt([
|
|
1018
|
-
{ name: "base", text: base },
|
|
1019
|
-
{ name: "wake", text: wakeText, trim: "truncate", order: 4 },
|
|
1020
|
-
{ name: "ctx", text: ctxText, trim: "drop", order: 1 },
|
|
1021
|
-
{ name: "again", text: againText },
|
|
1022
|
-
{ name: "tail", text: tailText },
|
|
1023
1036
|
{ name: "rules", text: rulesText, trim: "drop", order: 3 },
|
|
1024
1037
|
{ name: "lessons", text: lessons?.text || "", trim: "drop", order: 2 },
|
|
1038
|
+
{ name: "ctx", text: ctxText, trim: "drop", order: 1 },
|
|
1039
|
+
{ name: "tail", text: tailText },
|
|
1040
|
+
{ name: "again", text: againText },
|
|
1041
|
+
{ name: "base", text: base },
|
|
1042
|
+
{ name: "wake", text: wakeText, trim: "truncate", order: 4 },
|
|
1025
1043
|
]);
|
|
1026
1044
|
const parts = built.sections.filter(s => s.chars).map(s => `${s.name} ${s.chars.toLocaleString("en-US")}c`).join(" · ");
|
|
1027
1045
|
const lessonsNote = lessons && lessons.total ? ` (lessons ${lessons.kept}/${lessons.total})` : "";
|