Two test artifacts for verifying that images are not dropped when
steer / follow_up are used during streaming.
Spawns pi in RPC mode and runs three tests:
promptwith image (non-streaming baseline) -- should always pass
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Session Export</title> | |
| <style> | |
| :root { | |
| --accent: #7a8aa6; |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Session Export</title> | |
| <style> | |
| :root { | |
| --accent: #7a8aa6; | |
| --border: #404040; |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Session Export</title> | |
| <style> | |
| :root { | |
| --accent: #7a8aa6; | |
| --border: #404040; |
| FROM node:22-alpine | |
| # Install pi-coding-agent | |
| RUN npm install -g @mariozechner/pi-coding-agent | |
| # Try to run it | |
| CMD ["pi", "--help"] |
| /** | |
| * 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", |
| /** | |
| * 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"; |
| /** | |
| * 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; |
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