Skip to content

Instantly share code, notes, and snippets.

View brand-it's full-sized avatar

Brandt Lareau brand-it

View GitHub Profile
@brand-it
brand-it / README.md
Last active November 6, 2026 01:07
OMP stop-advisor extension: judge-gated stop continuation

stop-advisor — OMP extension

On the main session's stop, assumes the stop may be a mistake and lets a small configurable model (default: the judge role) decide whether it was legit. The advisor runs on every stop and keeps the agent going until the agent signals a legit stop: it emitted the <done> token, or the judge says the stop is clean (a final answer was delivered). On any judge failure (timeout, empty, error, no model) it sends a generic continue. Posts a visible decision notice on every stop.

Every forced continue is posted via pi.sendMessage with

#!/usr/bin/env bash
# head.sh — rank 0 (head box). llama-swap cmd: this script --port ${PORT}
set -euo pipefail
MODEL_ID="qwen38-flash-next-nvfp4"
source "$HOME/bin/sg2/lib.sh"
sg2_env "$MODEL_ID"
PORT="$API_PORT"
while [[ $# -gt 0 ]]; do
@brand-it
brand-it / rebuild_llama.sh
Created August 31, 2026 16:42
A script I use to quickly build llama.cpp for nvidia spark dgx- NCCL enabled. can run multiple times to update server
#!/bin/bash
set -e
LLAMA_DIR="$HOME/llama.cpp"
# 1. Clone or update
cd "$HOME"
if [ ! -d "$LLAMA_DIR/.git" ]; then
echo "=== Cloning llama.cpp (first time) ==="
@brand-it
brand-it / caffeinate.ts
Created August 13, 2026 18:27
Mac extention for OMP to keep the PC awake when it is doing things. Places a little ☕ icon when it is working. just add it to `~/.omp/agent/extensions/caffeinate.ts`
import { spawn, type ChildProcess } from "node:child_process";
export default function (pi: { on: Function }) {
let caffeinate: ChildProcess | undefined;
const stop = (ctx: { ui: { setWorkingMessage(message?: string): void } }) => {
const wakeLock = caffeinate;
caffeinate = undefined;
wakeLock?.kill();
@brand-it
brand-it / windrose.bat
Created June 6, 2026 21:01
windrose.bat works with game-smith
@echo off
pushd "%~dp0"
:: Launches ONE instance, prints the child PID, waits, and forwards the exit/crash code to the parent
powershell -Command "$exe='R5\Binaries\Win64\WindroseServer-Win64-Shipping.exe'; Write-Host '[WRAPPER] Starting Windrose Server...' -Fore Green; $p=Start-Process $exe -ArgumentList '-log' -NoNewWindow -PassThru; Write-Host '[WRAPPER] Server running. Child PID is:' $p.Id -Fore Cyan; try { Wait-Process -Id $p.Id } finally { if (!$p.HasExited) { Write-Host '[WRAPPER] Signal received. Cleaning up child PID:' $p.Id -Fore Red; Stop-Process -Id $p.Id -Force } }; exit $p.ExitCode"
:: Captures the PowerShell exit code and forwards it directly to your process manager
exit /b %errorlevel%
0eNrs3e2OHsl1IOhbEfibbWR8xxF2fxgD72KBwRjwenZ+GEKD3V2SCLPJNsmWrTV0AXMfuzc2V7L10d1VlCo648negWRJMCB3kRWH+eaJ/Hgy4z3n31988ebbm2/ev3778cXP//3F6y/fvf3w4uf/9O8vPrz+1dtXb+7+7O2rr29e/PzF22+/fHPz6v1n729effnx3fsXv3v54vXbr27+7cXP0+9+8fLFzduPrz++vnkYfP/Dbz9/++3XX9y8v/2Fl98H+eb1NzeffXz32a/ev/v27VcvXr745t2H22Hv3t79Q7ehco6/aS9f/PbFzz/Ldf5Nu/1Hvnr9/ubLh1+Zv3v5B7HzJ7H/MGKK8Rjx9j9/90yMsr19n0Trz0erEG1+um2ffNqUnwne9nflMX4keH0mdofYvOFjP3iauOETYodueJxMsE+m7GKCpQOOAP30CQ6vcujHT48H2Pt3X7z75t37j8/F7T9EvY35/uZfvr358PHzX75+8/Hm/Ye7X/rw8I88nB6+P2+8fPHDb3zyp9/9e2/e/er1h4+vv/zs7h+++1f/5dtXb2637e5k9O7917dnp5cvvnz39Tev3r+6OyH9/MX/ev8H396dytrxu1/c/t9zH2j/aM818e6qEP3QTMPR35IGh8O/Zd4vcPz3wtHhDNCz7pjYDz4KBs/H2ell1NPTS4YzwNNwiwtYfjzkv7r58vVXN+8/uz3Mvnj99v4we+bgL98HrH+Yrbsj8u3H9+/efP7Fza9f/eb13YH679/H/fz27756/d2J4d9fPP3p9oTwy9fvb08ijzciH3/7zd02/eb1+4/f3h/8323kw2989o93tyR39y8fX92fAdrxe6eH//Hf/58Xdx/39+N+F+bb96/evv72689++e3Nm8++vHnz5iHeH5xf7v7g5vPvNubV7U6+u/159+3Hb779+Pu3Tidb/Kv3NzdvH/6Vb377+f2Z6/Nfvn/39eev394Ge/HzX7568+Hm7iz2XJIeT2Nf33x1t903b273+vv
@brand-it
brand-it / .irbrc
Last active November 7, 2023 06:39
.irbrc with a bunch of stuff I found useful. This is all sort of hacky but that kinda of the point. Do what you want take what you need. no need to be perfect
# frozen_string_literal: true
MAX_COLUMNS_FOR_TABLE = 15 unless defined?(MAX_COLUMNS_FOR_TABLE)
DEFAULT_EDITOR = 'code' unless defined?(DEFAULT_EDITOR)
class PrettyString < String
# https://no-color.org/
NO_COLOR = ENV.key?('NO_COLOR') || `tput colors`.chomp.to_i < 8 unless defined?(NO_COLOR)
unless defined?(ANSI_COLORS)
ANSI_COLORS = {
red: 31,
@brand-it
brand-it / have_scope.rb
Created April 7, 2023 17:08
A simple tool to make it easier to test scopes on models using rspec
# frozen_string_literal: true
# A quick and easy way to test scopes sql queries by checking only the sql output
#
# is_expected.to have_scope(:user, 1).include('users.id = 1')
# is_expected.to have_scope(:user, 1).match_array([user])
# is_expected.to have_scope(:user, 1).eq([user])
module RSpec
module Matchers
class HaveScope
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'uri'
require 'json'
require 'net/http'
require 'optparse'
require 'forwardable'
COMMAND_NAME = File.basename(__FILE__)
class SnowflakeId < ApplicationService
MAC_ADDRESS_PATTERN = /(?:(?:(?:[a-f0-9]{2}:){5})|(?:(?:[a-f0-9]{2}-){5}))[a-f0-9]{2}/i
MAC_ADDRESS = lambda {
address = RUBY_PLATFORM =~ /darwin/ ? `ifconfig` : `cat /sys/class/net/*/address`
address.match(MAC_ADDRESS_PATTERN).to_s.delete(':')
}.call
NODE_ID = -> { (MAC_ADDRESS.to_i(16) % 1023).to_s(2).rjust(10, '0') }.call
SEQUENCE_STARTED_AT = 1671750375309
COUNTER_MAX = 4096