xonecas.io
64875
Mc

mini-coder / commit b0891f6

chore: cleanup of old irrelevant code and comments

xonecas2026-05-14 b0891f6391190260f73508702db2fe2dcd23765b parent 8f82746

2 files changed

src/session.ts+0−2
@@ -5,8 +5,6 @@ import { Value } from "typebox/value";
55 import { SESSIONS_DIR } from "./shared";
66 import { type Session, SessionSchema } from "./types";
77
8-// TODO: sessions are json files in SESSIONS_DIR inside of DATA_DIR, use a 10 length `secureRandomString()` for the ids.
9-
108 export async function ensureSessionsDir(): Promise<void> {
119 await mkdir(SESSIONS_DIR, { recursive: true });
1210 }
src/tool-bash.ts+2−20
@@ -1,8 +1,6 @@
11 import { type Tool, Type } from "@earendil-works/pi-ai";
2-import { secureRandomString } from "./shared";
32 import type { ToolRunnerEvent } from "./types";
43
5-const OUTPUT_THRESHOLD = 16000;
64 const description = `Bash CLI tool
75
86 Execute shell commands on the user's environment.
@@ -68,25 +66,9 @@ export async function* runBashTool(
6866
6967 const exitCode = await proc.exited;
7068
71- let result = `# EXIT CODE: ${exitCode}`;
69+ let result = `${output.length ? output : "(no ouput)"}\n\nExit code: ${exitCode}`;
7270 if (output.length) {
73- result += `
74-# OUTPUT:
75-
76-${output}`;
77- }
78-
79- // If `out` is too big, more than ~XXKB, write it to a temp file
80- // And add that to the truncation label for the agent to be able
81- // to continue the read with scans. This is to protect context,
82- // not a general read guard. The hint is for the agent, not the TUI
83- if (result.length > OUTPUT_THRESHOLD) {
84- const key = `${Date.now()}-${secureRandomString(4)}`;
85- const pathname = `/tmp/bash_result_${key}.txt`;
86- await Bun.write(pathname, result);
87- result = `${result.substring(0, OUTPUT_THRESHOLD)}
88-
89-Truncated at ~${OUTPUT_THRESHOLD / 1000}KB. Full output at ${pathname}`;
71+ result += `${output}`;
9072 }
9173
9274 yield {