Skip to content

Instantly share code, notes, and snippets.

@aliou
aliou / README.md
Created February 5, 2026 01:47
Repro/test for streaming image drop bug (pi-mono PR #1271)

Image delivery repro tests

Two test artifacts for verifying that images are not dropped when steer / follow_up are used during streaming.

RPC test (rpc-test.mjs)

Spawns pi in RPC mode and runs three tests:

  1. prompt with image (non-streaming baseline) -- should always pass
@aliou
aliou / Dockerfile
Created February 1, 2026 14:58
Pi Alpine ARM64 MUSL repro
FROM node:22-alpine
# Install pi-coding-agent
RUN npm install -g @mariozechner/pi-coding-agent
# Try to run it
CMD ["pi", "--help"]
@aliou
aliou / index.ts
Created January 23, 2026 17:26
Sleep tool for testing abort behavior with multiple queued tools
/**
* Sleep Tool - For testing abort behavior with multiple queued tools
*/
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
import { Type } from "@sinclair/typebox";
export default function (pi: ExtensionAPI) {
pi.registerTool({
name: "sleep",
@aliou
aliou / index.ts
Last active January 23, 2026 16:23
Pi extension - A nice surprise
/**
* Surprise Extension
*
* Displays a countdown and then opens a surprise URL.
*/
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
import { exec } from "node:child_process";
import { platform } from "node:os";
@aliou
aliou / index.ts
Last active January 23, 2026 16:21
Pi extension test - stall compaction
/**
* Stall Compaction Extension (for debugging)
*
* Provides /stall-compact command to force-trigger compaction, and stalls it for 10 seconds
* to reproduce the Alt-Up "no queued messages to restore" bug.
*/
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
const STALL_SECONDS = 15;
@aliou
aliou / postmortem.md
Created May 5, 2020 14:32 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym

While going source spelunking, I came across this piece of code in Rails' ActiveModel:

key = "#{key.to_s.camelize}Validator"

begin
  validator = key.include?("::".freeze) ? key.constantize : const_get(key)
rescue NameError
@aliou
aliou / autoload-swiftcomplete.vim
Created April 28, 2018 12:28
autoload/swiftcomplete.vim
let s:cpo_save = &cpoptions
set cpoptions&vim
function! s:reduce(fct, list) abort
let [l:acc; l:tail] = a:list
while !empty(l:tail)
let [l:head; l:tail] = l:tail
let l:acc = a:fct(l:acc, l:head)
endwhile