You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
aft-pi: hoisted read/write/edit reuse Pi built-in names but render incompatibly in Pi chat #15
With @cortexkit/aft-pi 0.14.0 and the default tool_surface: "recommended", the hoisted read / write / edit tools reuse Pi built-in names but do not provide custom renderers.
In Pi main chat, those same-name tools then pick up Pi's built-in renderers automatically. For edit and write, the payload shape is not compatible with the built-in renderer expectations, so rendering degrades.
For example, edit succeeds but can render as just:
edit ...
or otherwise miss the expected built-in preview/result rendering.
This is reproducible in pi 0.68.0 with AFT installed, and does not reproduce for me with a clean pi config and no AFT package.
Steps to reproduce
Install @cortexkit/aft-pi 0.14.0.
Keep default AFT config with tool_surface: "recommended".
Start pi main chat.
Send: Use only the built-in write and edit tools. First, create note.txt with exactly one line: hello. Second, use the built-in edit tool to change hello to world. When complete, reply with exactly: done
Observed in AFT-backed setup:
write ...
hello
edit ...
done
But with a clean PI_CODING_AGENT_DIR and no AFT package, I get normal built-in rendering:
write note.txt
hello
edit note.txt
-1 hello
+1 world
Why I think this is happening
AFT hoists tools named exactly read, write, and edit.
From the installed package:
README.md says recommended includes hoisted read / write / edit
dist/index.js registers those exact tool names
But the AFT tool payload shape differs from Pi built-ins:
AFT write / edit use filePath
AFT edit uses oldString / newString
AFT result details do not include the built-in edit details.diff shape
Since AFT does not provide custom renderCall / renderResult for those same-name tools, Pi appears to reuse its built-in renderer automatically, and the renderer mismatch produces degraded output.
Expected behavior
One of these should happen:
AFT hoisted read / write / edit should provide custom renderers
or AFT hoisted tools should align their arg/result shape with Pi built-in renderer expectations
or AFT should avoid same-name hoisting where renderer compatibility is not intended
Temporary local workaround
Disabling hoisted conflicting tools in ~/.pi/agent/aft.jsonc fixes it for me:
Hi @kseikyo — fix shipped in v0.14.1 (@cortexkit/aft-pi@0.14.1 on npm).
Hoisted write and edit now ship Pi-native renderCall + renderResult (using @mariozechner/pi-tui primitives and Pi-format line-numbered diffs) so they render properly in Pi chat instead of falling back to Pi's built-in renderers and producing garbled output. Hoisted read and grep keep Pi's text fallback since their payload already matches Pi's expected shape.
We also added promptSnippet and promptGuidelines for the hoisted tools, so the model sees AFT's parameter schema (filePath, oldString/newString, occurrence, replaceAll) directly in the system prompt instead of having to guess from training data of Pi's built-in conventions.
To pick up the fix, restart Pi after upgrading. Thanks for the detailed report — really helpful to have the renderer-fallback behavior documented from the user side.
Activity
ualtinok commentedon Apr 22, 2026
Hi @kseikyo — fix shipped in v0.14.1 (
@cortexkit/aft-pi@0.14.1on npm).Hoisted
writeandeditnow ship Pi-nativerenderCall+renderResult(using@mariozechner/pi-tuiprimitives and Pi-format line-numbered diffs) so they render properly in Pi chat instead of falling back to Pi's built-in renderers and producing garbled output. Hoistedreadandgrepkeep Pi's text fallback since their payload already matches Pi's expected shape.We also added
promptSnippetandpromptGuidelinesfor the hoisted tools, so the model sees AFT's parameter schema (filePath,oldString/newString,occurrence,replaceAll) directly in the system prompt instead of having to guess from training data of Pi's built-in conventions.To pick up the fix, restart Pi after upgrading. Thanks for the detailed report — really helpful to have the renderer-fallback behavior documented from the user side.
fix(rust): honest move_file partial failure, surface bash_rewrite err…
fix(plugins): close 3 v0.18 council findings on Pi parity and apply_p…
test(plugins): real-bridge tool-layer e2e (#3, #4, #15, #16, #26)
fix(permissions): v0.21.1 audit batch — Windows + AST/safety + grep p…
fix(e2e): real Windows timeout + poll-to-terminal + restore Docker ch…
merge: stream semantic index I/O + trigram aggregation, drop embed ba…