@shanepadgett/tau-agent 0.15.0 → 0.16.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.
@@ -1,6 +1,6 @@
1
1
  # patch
2
2
 
3
- Replaces the built-in `edit` and `write` tools with one multi-file patch tool. The agent applies structured patches to create, edit, move, and delete files while this extension is active.
3
+ Replaces the built-in `edit` and `write` tools with one multi-file patch tool. The agent applies structured patches to create, edit, move, and delete files while this extension is active. For xAI and Grok models, Tau disables `patch` and leaves `edit` and `write` active because those models are unreliable with the patch format.
4
4
 
5
5
  ## What it does
6
6
 
@@ -135,6 +135,19 @@ export default function patchExtension(pi: ExtensionAPI): void {
135
135
  const rowState = createToolRowStateStore(pi, "patch.tool-row-state");
136
136
  pi.registerTool(createPatchTool(rowState));
137
137
 
138
+ function configureMutationTools(model: { provider: string; id: string } | undefined): void {
139
+ const active = new Set(pi.getActiveTools());
140
+ const usesGrok = model?.provider.toLowerCase() === "xai" || model?.id.toLowerCase().includes("grok") === true;
141
+ if (usesGrok) {
142
+ active.delete("patch");
143
+ for (const tool of SUPPRESSED_TOOLS) active.add(tool);
144
+ } else {
145
+ active.add("patch");
146
+ for (const tool of SUPPRESSED_TOOLS) active.delete(tool);
147
+ }
148
+ pi.setActiveTools([...active]);
149
+ }
150
+
138
151
  // AgentToolResult has no isError field, so execute returns are always treated as success.
139
152
  // Override via tool_result to flag partial/failed patches as errors for the model and UI.
140
153
  pi.on("tool_result", async (event, ctx) => {
@@ -160,11 +173,12 @@ export default function patchExtension(pi: ExtensionAPI): void {
160
173
  return { isError: true };
161
174
  });
162
175
 
163
- pi.on("session_start", () => {
176
+ pi.on("session_start", (_event, ctx) => {
164
177
  rowState.clear();
165
- const active = new Set(pi.getActiveTools());
166
- active.add("patch");
167
- for (const tool of SUPPRESSED_TOOLS) active.delete(tool);
168
- pi.setActiveTools([...active]);
178
+ configureMutationTools(ctx.model);
179
+ });
180
+
181
+ pi.on("model_select", (event) => {
182
+ configureMutationTools(event.model);
169
183
  });
170
184
  }
@@ -52,7 +52,7 @@ Adds `/manage-sessions` to browse saved sessions and `/sweep` to archive or dele
52
52
 
53
53
  ## patch
54
54
 
55
- Replaces separate edit/write operations with one multi-file `patch` tool. It can create, rewrite, edit, move, and delete files in one structured call. Fewer tool calls means fewer turns, and each avoided turn prevents the full chat context from being sent again.
55
+ Replaces separate edit/write operations with one multi-file `patch` tool. It can create, rewrite, edit, move, and delete files in one structured call. Fewer tool calls means fewer turns, and each avoided turn prevents the full chat context from being sent again. Tau keeps `patch` disabled and uses `edit` and `write` for xAI and Grok models.
56
56
 
57
57
  ## publish
58
58
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shanepadgett/tau-agent",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Tau is a custom agentic harness built with pi extensions",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,7 +28,7 @@
28
28
  "README.md"
29
29
  ],
30
30
  "dependencies": {
31
- "@shanepadgett/tau-tui": "0.15.0",
31
+ "@shanepadgett/tau-tui": "0.16.0",
32
32
  "@toon-format/toon": "2.3.0",
33
33
  "smol-toml": "1.7.0"
34
34
  },