Skip to content

fix: Support Codex pet sidekick animations#1533

Open
crilofer wants to merge 1 commit intostablyai:mainfrom
crilofer:feat/codex-pet-sidekick-states
Open

fix: Support Codex pet sidekick animations#1533
crilofer wants to merge 1 commit intostablyai:mainfrom
crilofer:feat/codex-pet-sidekick-states

Conversation

@crilofer
Copy link
Copy Markdown

@crilofer crilofer commented May 7, 2026

Summary

Import Codex pet bundles without requiring Orca-specific manifest metadata, preserve Codex's 8x9 WebP sprite row layout, and drive imported sprite sidekick animations from Orca's live agent state.

The problem: Codex pets and Orca Sidekick bundles currently describe sprites differently. Some Codex pets only provide id/displayName, while newer ones may add spritesheetPath: "spritesheet.webp" but still omit Orca's frame and animations fields. In Orca today, those bundles either fail during WebP dimension validation or import without sprite metadata, which makes the renderer fall back to frame auto-detection and can leave the pet animating the wrong strip, such as running-right, instead of idle or the current agent state.

Codex pet.json files either omit Orca sprite metadata entirely or declare only spritesheetPath; this PR treats those spritesheet.webp bundles as Codex bundles, fills the 192x208 frame metadata, and registers all nine Codex rows: idle, running-right, running-left, waving, jumping, failed, waiting, running, and review.

This keeps the existing manifest-driven sprite behavior intact: if a bundle already declares its own metadata, Orca preserves it. If a bundle does not define the state-selected animation, Orca still falls back to the bundle's defaultAnimation or first declared animation.

Related to #1395. This is a focused step toward using Sidekick as an agent status surface; it does not implement the full mini-dashboard, notification filtering, quick actions, or project/workspace source details described in that issue.

Screenshots

image

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed

Notes:

  • pnpm lint passes with 6 existing warnings in GitHub project components unrelated to this PR.
  • Added coverage for newer Codex-style manifests that declare spritesheetPath: "spritesheet.webp" but omit frame and animations.
  • pnpm build exited successfully; the dev CLI symlink helper could not write /usr/local/bin/orca-dev, which is a local permissions warning and not a build failure.

AI Review Report

Reviewed the change with an AI coding agent for correctness, fallback behavior, test coverage, and cross-platform compatibility.

The main risks checked were stale agent statuses driving the wrong animation, missing animation names in imported manifests, WebP sheets that Electron nativeImage cannot decode, multiple panes with competing agent states, reduced-motion/hidden-window behavior, and drag behavior. The implementation keeps animation selection pure and covered by unit tests, preserves manifest fallbacks, and limits Codex-specific defaults to manifests that omit spritesheetPath.

Cross-platform compatibility was explicitly checked for macOS, Linux, and Windows. This PR does not add platform-specific shell behavior, shortcuts, labels, auth requirements, or new IPC channels. The import path continues to normalize and validate bundle-relative paths with existing platform-aware prefix checks before copying files into Orca-managed storage.

Security Audit

Reviewed input handling, command execution, path handling, auth/secrets, dependency, and IPC risks.

This PR does not add command execution, auth handling, secrets handling, dependency changes, or renderer access to arbitrary file paths. The existing pet-bundle IPC handler still validates manifest size, rejects symlinks, rejects path traversal, checks bundle-relative spritesheet paths, and copies into Orca-managed storage. The selected animation name is chosen from a fixed TypeScript union and then used only to look up an optional manifest animation key with existing fallback behavior.

Notes

This is meant to make imported Codex pet bundles work as-is in Orca's Sidekick feature and feel alive by adapting Orca agent state to Codex row names.

The importer now captures all nine Codex rows. Current live state selection uses the rows Orca can infer from today’s agent status model:

  • idle: no fresh agent state
  • running: at least one fresh working agent
  • waiting: blocked or waiting agent
  • review: completed or retained agent work
  • failed: interrupted completion
  • jumping: sidekick drag interaction

running-right, running-left, and waving are imported and available in metadata, but Orca does not currently have autonomous sidekick movement direction or a dedicated greeting/notification event in this PR, so those rows are not triggered yet.

X/Twitter handle: https://x.com/Crilofer

@AmethystLiang
Copy link
Copy Markdown
Contributor

yayyyy, thx for the PR! More pets fun. Will get this PR in today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants