mappu04 c96c925033 dynamic_workflow: name tool once, not twice
The registerTool name already comes from the first argument; drop the
redundant duplicate 'name' field inside the definition object from the
docs, example, and test.
2026-10-18 06:13:41 +00:00
2026-06-14 14:42:05 +12:00
2026-10-17 19:51:11 +13:00
2026-06-03 18:30:19 +12:00
2026-10-18 19:07:45 +13:00

bridle

An agentic harness and SDK for OpenAI-compatible chat completion endpoints.

View it on OpenRouter

Features

Harness user experience:

  • Readline-based CLI with tab completion
    • Coloured output for sections (-Colour, or NO_COLOR env var)
    • Description of every available tool via /tools
    • Press Ctrl+X to edit the current input line in $EDITOR
    • Press any key to interrupt a running model turn or tool call
    • Audible bell after 10 seconds to signal the terminal is ready for input
  • Oneshot mode (-p, implies -Agent=oneshot)
  • Select the agent logic at startup (-Agent=oneshot|interactive|autoengineer)
  • Manipulate turn history (/rewind, /turns, /submit)
    • /rewind prompts for a target index from /turns, defaults to today
  • Session management (-Autosave, manual /save, and resume via -r)
  • Import local files (wildcard match) into prompt (/read)
  • Restart the session with a freshly compiled binary (/reexec)
  • Linux sandboxing with Bubblewrap, on by default (-Sandbox=false to opt out, use at own risk)
    • Append extra Bubblewrap flags to every sandboxed command via -SandboxFlag (can be specified multiple times)
    • Leaves the harness process unconstrained and confines each thing the model can reach: file access by path, shell commands and MCP stdio servers by their own namespaces
    • Grant extra paths with -Allow, applied to every confined operation (repeatable)
      • A directory exposes itself and everything inside it; a single file exposes just that file
  • Git worktree support (-w), also works from inside the sandbox
  • Quiet mode (-Quiet) to suppress all system messages

Special modes:

  • "Autoengineer" (-Agent=autoengineer)
    • Implement every task in TODO file and TODO/FIXME comments in codebase.
    • The result is not necessarily very good, but it can run overnight and you can cherry-pick the good parts in the morning.

Model integration with harness:

  • Auto load AGENTS.md and CLAUDE.md files
  • Agent Skills support
    • Discovers SKILL.md bundles under .agents/skills/ or .claude/skills/
    • Scanned at project level and user level, project wins on name collision
    • The skill catalog is injected into the system prompt
    • Use read_skill to load the full contents of a skill (no size limit)
  • Context management
    • Auto compact on client-side token threshold (-MaxContext) or on server-side length exceeded
    • Soft limit: compaction fires 10% below the ceiling to leave a safety buffer
    • Auto-detect model context from /v1/models when -MaxContext is zero
    • Several strategies behind one dispatcher: handover (default), head-summarize, quick, summarize, drop-reasoning, drop-tool-calls, truncate, rewind
    • The default "handover" strategy appends a summary instead of rewriting history, preserving prefix caching
  • Tool calling
    • Available tools:
      • Local file I/O (read_file, write_file), with optional limit/offset to read a line range of a large file
      • Single-string replacement (edit_file) for reliable targeted edits
      • Auto-healing apply_patch, supporting both unified + V4A formats
      • Command execution (local_shell)
      • Subagents (subagent with fork/fresh context modes), optionally running in parallel (-Parallel <n>)
      • Web search with DuckDuckGo
      • Webpage read in Reader Mode (via go-readability), converting links to navigable markdown
      • Anti-hallucination: write_file/apply_patch must read a file first (or be nonexistent) before writing, and web_read only permits URLs already seen in the conversation
    • MCP support
      • Stdio, Streaming HTTP, or SSE transports
      • Static (-Mcp <name>=<command> / -Mcp <name>=http://url) or dynamic registration (/mcp-connect, /mcp-list, /mcp-disconnect)
      • Dynamic tool discovery
      • When using sandboxing, stdio servers are confined like any other subprocess (with the host network, so they can still reach an API); HTTP servers are remote and have no local process to confine
    • User confirmation levels (/checktools or -CheckTools: if-sandboxed default, ask, auto, or yolo)
      • if-sandboxed becomes yolo when the tools are confined and ask when bubblewrap is unavailable
      • Allow denying with alternative message (?)
      • Refuse and stop the turn outright (!), as distinct from n, which refuses this call but lets the model try something else
    • Trigger tools locally (/tool), optionally submit in next turn

Model settings:

  • Use custom model provider (-Host and -Key)
    • Supports timing metadata from both llama-server and OpenAI/OpenRouter
    • Can be changed mid-session with /host, /key and /model
  • Merge a custom JSON object into each API request body (-ExtraArgs), e.g. OpenRouter provider preferences
  • Toggle thinking (/think and /no-think) and set reasoning_effort (/reasoning-effort)
  • Running cost is tracked and reported per turn when the provider reports it
  • Customizable system message, default-tuned for Golang development

Usage

# For 128k 131072, for 256k 262144 . Mostly affects pp speed, not tg speed
llama-server -c 262144 --cache-type-k q8_0 --cache-type-v q8_0 -fa on -np 1 -m /srv/llama/Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf &

./bridle

# or
./bridle -CheckTools=yolo -Autosave=auto -w my-worktree

# Interactive session, with up to 4 parallel subagents
./bridle -Parallel 4

# Use with OpenRouter
./bridle -Host 'https://openrouter.ai/api/' -Key 'sk-or-v1-xxxx' -Model 'openrouter/free'
S
Description
An agentic harness for OpenAI-compatible chat completion endpoints
Readme ISC
1.2 MiB
0 Stars 1 Watchers 0 Forks
Languages
Go 98%
Shell 1%
JavaScript 1%