@shanepadgett/tau-agent 0.41.3 → 0.42.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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Compacts long conversations before the next model turn when their context reaches an absolute token limit. Active work resumes through a hidden continuation message after Pi's native compaction finishes.
|
|
4
4
|
|
|
5
|
-
Set `extensions.autoCompact.tokenLimit` to change the limit. It defaults to 175,000 context tokens for every model. Pi still shows its native collapsed compaction entry in the chat.
|
|
5
|
+
Set `extensions.autoCompact.enabled` to `false` to turn automatic compaction off. Set `extensions.autoCompact.tokenLimit` to change the limit. It defaults to 175,000 context tokens for every model. Pi still shows its native collapsed compaction entry in the chat.
|
|
6
6
|
|
|
7
7
|
After changing this extension, run `/reload` before testing it.
|
|
8
8
|
|
|
@@ -8,6 +8,7 @@ const CONTINUATION_MESSAGE =
|
|
|
8
8
|
"Continue the current work directly from the compacted context. Do not mention compaction or wait for user input.";
|
|
9
9
|
|
|
10
10
|
export default function autoCompactExtension(pi: ExtensionAPI): void {
|
|
11
|
+
let enabled = true;
|
|
11
12
|
let tokenLimit = DEFAULT_AUTO_COMPACT_TOKEN_LIMIT;
|
|
12
13
|
let armed = true;
|
|
13
14
|
let compacting = false;
|
|
@@ -39,6 +40,7 @@ export default function autoCompactExtension(pi: ExtensionAPI): void {
|
|
|
39
40
|
const version = ++sessionVersion;
|
|
40
41
|
const settings = await loadTauExtensionSettings(ctx, autoCompactSettings);
|
|
41
42
|
if (version !== sessionVersion) return;
|
|
43
|
+
enabled = settings.enabled;
|
|
42
44
|
tokenLimit = settings.tokenLimit;
|
|
43
45
|
armed = true;
|
|
44
46
|
compacting = false;
|
|
@@ -67,7 +69,7 @@ export default function autoCompactExtension(pi: ExtensionAPI): void {
|
|
|
67
69
|
releaseAttentionHold("notify");
|
|
68
70
|
});
|
|
69
71
|
pi.on("turn_start", (_event, ctx) => {
|
|
70
|
-
if (compacting) return;
|
|
72
|
+
if (!enabled || compacting) return;
|
|
71
73
|
|
|
72
74
|
const tokens = ctx.getContextUsage()?.tokens;
|
|
73
75
|
if (tokens === undefined || tokens === null) return;
|
|
@@ -6,10 +6,17 @@ export const DEFAULT_AUTO_COMPACT_TOKEN_LIMIT = 175_000;
|
|
|
6
6
|
export default defineTauExtensionSettings({
|
|
7
7
|
key: "autoCompact",
|
|
8
8
|
defaults: {
|
|
9
|
+
enabled: true as boolean,
|
|
9
10
|
tokenLimit: DEFAULT_AUTO_COMPACT_TOKEN_LIMIT,
|
|
10
11
|
},
|
|
11
12
|
schema: Type.Object(
|
|
12
13
|
{
|
|
14
|
+
enabled: Type.Optional(
|
|
15
|
+
Type.Boolean({
|
|
16
|
+
default: true,
|
|
17
|
+
description: "Enable automatic compaction when context reaches the token limit.",
|
|
18
|
+
}),
|
|
19
|
+
),
|
|
13
20
|
tokenLimit: Type.Integer({
|
|
14
21
|
minimum: 1,
|
|
15
22
|
default: DEFAULT_AUTO_COMPACT_TOKEN_LIMIT,
|
|
@@ -20,7 +20,7 @@ Names sessions from their first request so saved sessions remain findable.
|
|
|
20
20
|
|
|
21
21
|
## auto-compact
|
|
22
22
|
|
|
23
|
-
Uses Pi's native compaction before a model turn when the current context reaches `extensions.autoCompact.tokenLimit`, which defaults to 175,000 tokens for every model. Interrupted work resumes through a hidden continuation message without an attention alert until the resumed work settles. Pi's native collapsed compaction entry remains visible in chat.
|
|
23
|
+
Uses Pi's native compaction before a model turn when the current context reaches `extensions.autoCompact.tokenLimit`, which defaults to 175,000 tokens for every model. Set `extensions.autoCompact.enabled` to `false` to disable it. Interrupted work resumes through a hidden continuation message without an attention alert until the resumed work settles. Pi's native collapsed compaction entry remains visible in chat.
|
|
24
24
|
|
|
25
25
|
## branch
|
|
26
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shanepadgett/tau-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"description": "Tau is a custom agentic harness built with pi extensions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@ast-grep/wasm": "0.45.1",
|
|
38
|
-
"@shanepadgett/tau-tui": "0.
|
|
38
|
+
"@shanepadgett/tau-tui": "0.42.0",
|
|
39
39
|
"@vscode/tree-sitter-wasm": "0.3.1",
|
|
40
40
|
"image-size": "2.0.2",
|
|
41
41
|
"smol-toml": "1.8.0",
|
package/schemas/tau.schema.json
CHANGED