fix: Support Codex pet sidekick animations#1533
Open
crilofer wants to merge 1 commit intostablyai:mainfrom
Open
fix: Support Codex pet sidekick animations#1533crilofer wants to merge 1 commit intostablyai:mainfrom
crilofer wants to merge 1 commit intostablyai:mainfrom
Conversation
Contributor
|
yayyyy, thx for the PR! More pets fun. Will get this PR in today. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 addspritesheetPath: "spritesheet.webp"but still omit Orca'sframeandanimationsfields. 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 asrunning-right, instead ofidleor the current agent state.Codex
pet.jsonfiles either omit Orca sprite metadata entirely or declare onlyspritesheetPath; this PR treats thosespritesheet.webpbundles as Codex bundles, fills the 192x208 frame metadata, and registers all nine Codex rows:idle,running-right,running-left,waving,jumping,failed,waiting,running, andreview.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
defaultAnimationor 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
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildNotes:
pnpm lintpasses with 6 existing warnings in GitHub project components unrelated to this PR.spritesheetPath: "spritesheet.webp"but omitframeandanimations.pnpm buildexited 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
nativeImagecannot 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 omitspritesheetPath.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 staterunning: at least one fresh working agentwaiting: blocked or waiting agentreview: completed or retained agent workfailed: interrupted completionjumping: sidekick drag interactionrunning-right,running-left, andwavingare 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