Skip to content

Instantly share code, notes, and snippets.

View galligan's full-sized avatar
🧪
Tinkering

Matt Galligan galligan

🧪
Tinkering
View GitHub Profile
@galligan
galligan / codex-appserver-fd-exhaustion.md
Last active August 21, 2026 22:17
Codex app-server file-descriptor exhaustion on macOS: diagnosis, two-layer mitigation (raise limit + reap idle children), shell-specific gotchas, and troubleshooting

Codex app-server file-descriptor exhaustion on macOS

Codex / ChatGPT Desktop features start failing one at a time — Computer Use usually dies first — while open chats and already-connected MCP servers keep working. The cause is file descriptor exhaustion in the codex app-server process against macOS's default 256 soft limit, made worse by a known upstream leak where MCP stdio children are never reaped.

This is a containment guide. Upstream tracking issues are linked at the bottom; none are fixed as of 2026-08-21.

@galligan
galligan / retro-chatgpt-spawn-storm.md
Created August 20, 2026 18:21
Retro: six days chasing a ChatGPT desktop crash that turned out to be a symlink (openai/codex#38455, #39732)

Retro: six days chasing a ChatGPT desktop crash that turned out to be a symlink

TL;DR — ChatGPT for macOS 26.810.x+ spawns Computer Use helper processes in an unbounded retry loop and dies at ~600 helpers. It needs two ingredients: an uncapped retry loop in the app (OpenAI's bug), and a symlinked codex home (mine). Removing either one stops it. I spent five days on the first and fixed it in twenty minutes once I understood the second.

Investigation ran 2026-08-14 → 2026-08-20 across two Macs. This is the retrospective: what I believed, what was wrong, and what actually found it.

@galligan
galligan / chatgpt-macos-26810-computer-use-spawn-storm-field-report.md
Last active August 20, 2026 18:22
ChatGPT for macOS 26.810.x — Computer Use spawn storm: field report (2 Macs, measurements, what we tried, build comparison)

ChatGPT for macOS 26.810.x — Computer Use spawn storm: field report

⚠️ UPDATE 2026-08-20 — root cause found; two corrections to this document

The trigger is a symlinked codex home. The spawn loop needs both an uncapped retry loop in the app and ~/.codex (or CODEX_HOME) reached through a symlink. See openai/codex#39732, independently replicated here on a known-bad build: symlinked → 73 helpers in 27s; resolved real path → 1 helper, flat for 903s. Same binary, same machine, one variable. >

@galligan
galligan / what-pushed-the-bb-report.md
Created August 7, 2026 12:27
What Grid/Patch instructions nudged a short prompt into a thorough bb research report (with footnotes for outsiders)

What made a short prompt yield a thorough agent report?

A short ask — clone bb, figure out how it talks to Claude Code / Codex / etc., put findings in a gist — produced a long, sourced research writeup (that gist).

Afterwards I asked the same agent (running as Patch[^patch] inside The Grid[^grid]) whether anything in its instructions nudged that outcome. This note is that answer, rewritten for people who have never seen this setup.


Short answer

@galligan
galligan / bb-harness-research.md
Created August 6, 2026 13:47
How bb talks to Codex, Claude Code, Cursor (ACP), and other agent harnesses

How bb talks to Codex, Claude Code, Cursor, and other agent harnesses

Research notes from reading get-bb/bb (clone: research/repos/get-bb/bb in The Grid) and the locally installed bb 0.35.1 app.

  • Repo SHA at research time: 3e3e1934f22afd38a82ccf770cd423c6c2d1c4a2 (2026-08-06)
  • Installed app: /Applications/bb.app → host-daemon at …/bb-app/host-daemon/dist/
  • Primary code: packages/agent-runtime, apps/host-daemon, apps/server

@galligan
galligan / MIKE-QUESTIONS-RESPONSE.md
Created April 13, 2026 16:47
Response to Mike's questions on libxmtp modularity work

Responding to Mike's Questions on the Modularity Work

This document maps Mike's specific questions and concerns to what the exploration found, where things actually live in the stack, and what's protocol-required vs. solvable at a higher layer.

1. Crypto and security isolation

Mike's question: Stronger isolation of crypto and security concepts. Make it hard to get wrong. End consumers shouldn't care about nonces, inbox IDs, installations. How close can we get?

Where this stands today:

@galligan
galligan / 2026-04-13-libxmtp-modularity-exploration-status-check.md
Last active April 13, 2026 16:12
2026-04-13 `libxmtp` Modularity Exploration Status Check

libxmtp Modularity Exploration: Status and Findings

Context

Over the weekend I ran a structured exploration into whether libxmtp's internals, specifically mls_sync and the groups module, could be made meaningfully more modular without forcing a broad public crate split or breaking downstream consumers. These are the two largest and most complex modules in the codebase, and their size has been making it harder to reason about behavior, isolate bugs, and onboard new contributors.

I used my team of agents (Codex & Claude) to do the heavy lifting: planning milestones, executing the refactors, writing tests, and validating the results. The goal was to answer the modularity question with code, not architecture diagrams. Prove or disprove specific internal boundaries, then make a grounded recommendation. The work followed an incremental milestone plan (M0–M8), where each milestone produced reviewable commits and a retro that informed the next step.

By the numbers

@galligan
galligan / split-host-remote-design.md
Last active April 8, 2026 20:06
xmtp-signet: split host/remote design (draft)

Split host/remote signet — design

Status: Living draft. Section 1 reflects converged direction from the brainstorm; later sections are placeholders to be filled in as the conversation continues. Do not treat unfilled sections as decided.

0. Context

Signet today runs as a single daemon: the XMTP node, key vault, policy engine, credential lifecycle, and any agent code that consumes credentials all live in one process. That works for a developer running it on their laptop, but it forecloses two things we want:

  1. Ephemeral agent processes. A long-running container holds the XMTP connection; agent processes spin up only when there is work for them.
  2. Hosted signet. Eventually a third party (e.g. XMTP Labs) can run the host half so a developer signs up, points their code at it, and ships an agent without operating an XMTP node themselves.
@galligan
galligan / qmd-chunking-note.md
Last active April 10, 2026 16:29
qmd chunker improvements: four-PR series context for tobi

qmd chunker: improvements PR

PR: #553 (consolidated from earlier stacked PRs #538-#541)

I've been using qmd to index agent instruction files and Obsidian-style notes and noticed chunks landing in weird places. Pulled the thread and it turned into four distinct improvements, shipped as one PR with clean commit-per-change history.

What's wrong today

The chunker uses scored "break points" (places where splitting is OK) and "protected regions" (places to never split). Four specific issues:

@galligan
galligan / trails-ergonomics-brief.md
Created April 5, 2026 11:49
Trails ergonomics brief — CLI surface, scaffolding, pattern generators design context

Trails Ergonomics Brief

Comprehensive context for designing the next phase of Trails developer experience. Covers three layers: CLI trailhead primitives, the trails CLI tool, and pattern generators. Written April 5, 2026 after shipping beta.14.

Design Direction (from conversation with Matt)

These decisions shape the design across all three layers:

Audience

Both agents and curious human developers. An agent operates entirely through flags and JSON. A human who runs trails create without flags gets a guided experience. Neither should feel like a second-class citizen.