revert(pi): IOP read extension을 제거한다
This commit is contained in:
parent
79f507c349
commit
856e8d82a6
3 changed files with 0 additions and 18 deletions
|
|
@ -1,13 +0,0 @@
|
|||
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
||||
|
||||
const IOP_MAX_READ_LINES = 240;
|
||||
|
||||
export default function (pi: ExtensionAPI) {
|
||||
pi.on("tool_call", (event, ctx) => {
|
||||
if (ctx.model?.provider !== "iop" || event.toolName !== "read") return;
|
||||
const limit = event.input.limit;
|
||||
if (typeof limit !== "number" || limit > IOP_MAX_READ_LINES) {
|
||||
event.input.limit = IOP_MAX_READ_LINES;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -4,7 +4,6 @@ set -euo pipefail
|
|||
PI_DIR="$HOME/.pi/agent"
|
||||
SETTINGS="$PI_DIR/settings.json"
|
||||
MODELS="$PI_DIR/models.json"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PYTHON_BIN="/usr/bin/python3"
|
||||
|
||||
if [[ ! -x "$PYTHON_BIN" ]]; then
|
||||
|
|
@ -17,8 +16,6 @@ if [[ -z "$PYTHON_BIN" || ! -x "$PYTHON_BIN" ]]; then
|
|||
fi
|
||||
|
||||
mkdir -p "$PI_DIR"
|
||||
mkdir -p "$PI_DIR/extensions"
|
||||
install -m 0644 "$SCRIPT_DIR/extensions/iop-read-limit.ts" "$PI_DIR/extensions/iop-read-limit.ts"
|
||||
|
||||
"$PYTHON_BIN" - "$SETTINGS" "$MODELS" <<'PY'
|
||||
import json
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ class _TempHomeMixin:
|
|||
self.pi_dir.mkdir(parents=True)
|
||||
self.settings_path = self.pi_dir / "settings.json"
|
||||
self.models_path = self.pi_dir / "models.json"
|
||||
self.read_limit_path = self.pi_dir / "extensions" / "iop-read-limit.ts"
|
||||
|
||||
def tearDown(self):
|
||||
shutil.rmtree(self.tmp_home, ignore_errors=True)
|
||||
|
|
@ -193,7 +192,6 @@ class TestPreservesOpenaiResponsesConsumptionAndUserSettings(_TempHomeMixin, uni
|
|||
# (already checked above but be explicit about the contract)
|
||||
legacy_in_enabled = [m for m in enabled if m.startswith("seulgivibe-openai/")]
|
||||
self.assertEqual(legacy_in_enabled, [], "Legacy openai entries must be removed from enabledModels")
|
||||
self.assertIn("IOP_MAX_READ_LINES = 240", self.read_limit_path.read_text())
|
||||
|
||||
|
||||
class TestIdempotentRerun(_TempHomeMixin, unittest.TestCase):
|
||||
|
|
|
|||
Loading…
Reference in a new issue