cced184cab
·
2026-04-20 19:43:14 +07:00
6 Commits
tuffest harness
This is a tiny AI harness, not just a subprocess wrapper.
prompt.md is the model prompt seed. harness.py loads an OpenAI-compatible client, calls the model, and exposes five tools:
shell(command execution)list_dir(read-only directory listing)read_file(read-only file window)git_status(read-only git status)harness_state(self-state summary)
main.py is presentation + CLI flow: transcript rendering, rich/plain output mode, and optional prompt watching.
runtime
- Set
CEREBRAS_BASE_URL,CEREBRAS_API_KEY, andCEREBRAS_MODEL_STRINGin.env. - Run one turn with
uv run main.py --run-once. - Run one turn with a seed message:
uv run main.py --run-once "wsp". - Start interactive chat loop with
uv run main.py. - Watch
prompt.mdwhile chatting withuv run main.py --watch. - Watch-only (no stdin chat) with
uv run main.py --watch --no-chat. - Disable rich rendering with
uv run main.py --rich no.
chat controls
- Type a message and press Enter to append a user message and run a turn.
- Use
/runto force a turn without adding a user message. - Use
/exitor/quitto stop.
session
The session file is append-only JSONL. Each event is either a model message, a tool result, or an error event. That keeps the loop dumb and easy to inspect.
shape
tools_runtime.py: tool schemas and tool handlers.harness.py: model client, turn orchestration, transcript append.transcript_view.py: transcript rendering and rich/plain output formatting.main.py: CLI, chat loop, and watch loop wiring.prompt.md: the behavior seed for the model.
Languages
Python
100%