{"slug": "i-built-a-better-codex-pet-than-openai-did", "title": "I Built a Better Codex Pet Than OpenAI Did", "summary": "A developer built Mochi, an open-source Linux desktop companion with a real behavior state machine, persistent memory, and context awareness, positioning it as a more capable alternative to OpenAI's Codex Pets. The author argues Codex Pets, launched in May 2026, is essentially a status light tied to a single Codex agent thread with no state or memory between sessions, while Mochi mediates dozens of competing systems including typing detection, media playback, and app awareness. Mochi is a solo, Linux-only alpha, and the author concedes Codex Pets is the more polished, widely-used product.", "body_md": "*Sometimes you just have to let the agent cook.*\n\nWhen OpenAI shipped Codex Pets in May 2026, they wanted to give your coding agent a face. The pets float as an overlay on Windows and macOS, showing real-time status updates about what Codex is doing, and can notify users when a task completes or when the agent needs input. The feature launched with eight built-in pets and a way to generate custom, AI-animated pets from user images.\n\nBefore I go further, a caveat: this isn't really a fair fight. Codex Pets is a small feature bolted onto a coding agent used by millions of people, built by a team with the resources to ship across two operating systems on day one. Mochi is a solo, Linux-only alpha. They're not competing for the same thing, and if you're after \"which is the more polished, widely-used product,\" Codex Pets wins that easily. What they *do* share is one idea — a little creature that lives on your screen — and this is a look at what happens when you take that same idea and refuse to stop at \"cute status light.\"\n\nIt's a clever idea. It's also, underneath the cute art, kind of nothing. Strip away the sprite and a Codex Pet is a status light with a tail — a red clock when it's waiting on you, a green check when it's done. Cute, sure. Impressive, not really. So I built the version I actually wanted: [Mochi](https://github.com/miflow13/mochi-desktop), an open-source Linux desktop companion with a real state machine, real memory, and a real reason to exist beyond one app's notification stream.\n\nFunctionally, a Codex Pet is tied to one thing: the state of a Codex agent thread. It's a pixel-art animated companion that floats over the desktop while Codex codes, reacting to mouse interaction and Codex status — scratching its head when thinking, popping a speech bubble when a task completes. Custom pets are just a manifest file plus a spritesheet, dropped into a folder. There's no persistent internal state beyond \"what is the agent doing right now,\" no memory between sessions, and no behavior that isn't ultimately a reflection of Codex's own status.\n\nTo be fair, that's the correct amount of engineering for the job. A glanceable agent-status widget doesn't need a state machine. It needs to be cute, legible at a glance, and easy for a community to remix. OpenAI nailed that brief. But it *is* just a brief, and a narrow one — the pet doesn't outlive the thread it's watching.\n\nMochi doesn't report on anything external. It's not a status light for some other tool — it's meant to feel like it lives on your desktop, full stop, independent of whatever app you happen to have open. That's a different, harder problem, and it shows in the architecture.\n\nUnder the hood, Mochi runs on a single authoritative behavior-state machine that mediates between dozens of competing systems — clicking, dragging, sleep, typing detection, media playback, contextual app awareness, and more — all of which have to agree on one question at any given moment: what does Mochi currently own, and what's it allowed to do next? That's before you even get to the systems a Codex Pet has no equivalent for at all:\n\n```\nflowchart TD\n    Desktop[\"Linux Desktop\"]\n    GNOME[\"GNOME Shell Helper<br/>D-Bus\"]\n    Ambi[\"AmbiSense<br/>Local Rule-Based Context Layer\"]\n\n    Desktop --> GNOME\n    GNOME -->|\"coarse semantic signals\"| Ambi\n\n    Ambi --> Typing[\"Typing Activity\"]\n    Ambi --> Video[\"Video / Media Focus\"]\n    Ambi --> Apps[\"App Category\"]\n    Ambi --> Idle[\"Idle / Active State\"]\n    Ambi --> Files[\"File Browsing Activity\"]\n\n    User[\"User\"]\n\n    Click[\"Click\"]\n    Drag[\"Drag / Pickup\"]\n    Feed[\"Feed\"]\n    Media[\"Media Controls\"]\n\n    User --> Click\n    User --> Drag\n    User --> Feed\n    User --> Media\n\n    State[\"Authoritative<br/>Behavior State Machine\"]\n\n    Typing --> State\n    Video --> State\n    Apps --> State\n    Idle --> State\n    Files --> State\n\n    Click --> State\n    Drag --> State\n    Media --> State\n\n    Sleep[\"Sleep System\"]\n    Context[\"Contextual App Behavior\"]\n    Animation[\"Animation / Emote Playback\"]\n\n    Sleep --> State\n    Context --> State\n\n    State -->|\"Who owns Mochi?\"| Animation\n    State -->|\"What may happen next?\"| Sleep\n    State -->|\"Allowed reactions\"| Context\n\n    Bond[\"Bond Progression<br/>XP · Levels · No Decay\"]\n    Focus[\"Focus Sessions<br/>Independent Pomodoro Clock\"]\n    Catalogue[\"Emote Catalogue<br/>Rarity + Bond Unlocks\"]\n\n    Feed --> Bond\n    Typing --> Bond\n\n    Bond --> Catalogue\n    Catalogue --> State\n\n    User --> Focus\n    Focus --> State\n\n    State -. \"visual state may be interrupted\" .-> Focus\n    Focus -. \"session truth keeps running\" .-> State\n\n    Presentation[\"Mochi Presentation Layer<br/>animation · movement · expression\"]\n\n    Animation --> Presentation\n    Sleep --> Presentation\n    Context --> Presentation\n    State --> Presentation\n```\n\nMochi’s architecture separates what is true from what is currently visible. Desktop context, user interaction, progression, focus state, and autonomous behavior all converge on a single behavior-state machine that decides who currently “owns” Mochi and which transitions are legal.\n\nNone of that is decoration. Most of Mochi's codebase manual is about lifecycle and ownership: making sure a stale animation callback can't fire after a feature's been interrupted, that a context menu closing visually doesn't leave an invisible input grab behind, that recovery always reevaluates the *current* live context instead of blindly replaying whatever was happening before something interrupted it. That's the kind of problem you only run into once a system has enough moving parts to actually collide with itself — which is exactly the problem a Codex Pet is small enough to never have.\n\nHere's the honest version, not just the flex: a Codex Pet is *supposed* to be thin. It's a feature bolted onto a coding agent, meant to be authored in minutes and understood in one glance. Giving it Mochi's architecture would be overkill for what it's for.\n\nBut that's also exactly the point. OpenAI built a mascot for their product. I built a product whose whole job is *being* the mascot — one with persistence, context-awareness, care mechanics that don't depend on any single app, and a state machine robust enough to survive being dragged around, interrupted, and left alone for a week. Codex Pets are a nice feature riding on the back of a multi-billion-dollar coding agent. Mochi is the thing itself, built by one person who wanted the version that actually commits to the bit.\n\nI know which one I'd rather maintain.\n\n*Codex Pets details in this post are drawn from public reporting and documentation, not insider access. Mochi is open-source — [browse the code, file an issue, or just come say hi to the little guy](https://github.com/miflow13/mochi-desktop).*", "url": "https://wpnews.pro/news/i-built-a-better-codex-pet-than-openai-did", "canonical_source": "https://dev.to/mikachu/i-built-a-better-codex-pet-than-openai-did-eib", "published_at": "2026-09-26 11:16:56+00:00", "updated_at": "2026-09-26 11:30:02.348552+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["OpenAI", "Codex Pets", "Mochi", "Codex", "GNOME Shell", "AmbiSense", "Linux"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/i-built-a-better-codex-pet-than-openai-did", "markdown": "https://wpnews.pro/news/i-built-a-better-codex-pet-than-openai-did.md", "text": "https://wpnews.pro/news/i-built-a-better-codex-pet-than-openai-did.txt", "jsonld": "https://wpnews.pro/news/i-built-a-better-codex-pet-than-openai-did.jsonld"}}