Skip to content

fix: #1455 新版 App 桌宠兼容更新 / restore #1455 on newer Codex App#1484

Merged
BigPizzaV3 merged 1 commit into
BigPizzaV3:mainfrom
Yuimi-chaya:codex/pet-css-background-compat
Jul 13, 2026
Merged

fix: #1455 新版 App 桌宠兼容更新 / restore #1455 on newer Codex App#1484
BigPizzaV3 merged 1 commit into
BigPizzaV3:mainfrom
Yuimi-chaya:codex/pet-css-background-compat

Conversation

@Yuimi-chaya

Copy link
Copy Markdown
Contributor

中文

#1455 新版 Codex App 紧急兼容更新(2026-07-13)

这是已合并 PR #1455 的后续兼容修复,希望能够尽快审查并合并。#1455 合并时已经通过真人测试,V2 桌宠真实鼠标朝向、原生 hover 交互和 Computer Use 优先级均正常;但 Codex App 26.707.8479.0 随后改变了 V2 spritesheet 的渲染结构,导致已合并功能在新版 App 中无法识别桌宠并安全 no-op。如果本修复未合并,#1455 提供的“桌宠跟随真实鼠标”会在该新版 App 中保持不可用。

为什么会失效

旧版 App 将 V2 spritesheet 渲染为桌宠节点下的 <img>#1455 通过 naturalWidth === 1536 && naturalHeight === 2288 确认 V2 素材,避免错误驱动 V1 宠物。

新版 App 不再创建该 <img>,而是将同一份 1536×2288 PNG 作为 .codex-avatar-root 的 CSS background-image data URI。功能本身和素材版本没有变化,但旧探针找不到 <img> 后会按设计停止注入,因此真实鼠标朝向完全失效。这是新版 App 渲染结构变化带来的兼容回归,不是 #1455 初始实现时就存在的问题。

本次修改

  • 保留原有 <img> V2 尺寸检测,继续兼容旧版 App。
  • 新增 CSS background-image PNG data URI 检测,只读取 Base64 头部并解析 PNG IHDR 宽高,不解码完整 spritesheet。
  • capability probe 与每次坐标更新共用同一 V2 判定逻辑,避免探针通过但更新被拒绝。
  • 仍只接受 1536×2288 V2;1536×1872 V1 和缺失素材继续安全拒绝。
  • 不改变 feat: V2 桌宠跟随真实鼠标 / V2 pet real-mouse gaze #1455 的功能入口、交互优先级、Windows 平台限制或用户宠物素材。

验证

  • Codex App 26.707.8479.0 现场检查:新版 CSS V2 spritesheet 可识别,热注入后运行状态恢复正常。
  • cargo fmt --all -- --check
  • cargo test -q -p codex-plus-core --test cdp_bridge -j 277/77 通过。
  • cargo check -q -p codex-plus-launcher -j 2
  • 执行级 Node harness 覆盖:CSS V2 接受、旧 <img> V2 接受、CSS V1 拒绝、缺失素材拒绝。

English

Urgent compatibility follow-up for #1455 on newer Codex App (2026-07-13)

This is a compatibility follow-up to merged PR #1455, and an early review/merge would be appreciated. #1455 was human-tested when merged: V2 real-mouse gaze, native hover interactions, and Computer Use priority all worked correctly. Codex App 26.707.8479.0 later changed how the V2 spritesheet is rendered, so the merged feature can no longer identify the pet and intentionally no-ops on the newer App. Without this follow-up, the real-mouse pet gaze delivered by #1455 remains unavailable on that App version.

Why it regressed

The previous App rendered the V2 spritesheet as a descendant <img>, and #1455 safely identified V2 through naturalWidth === 1536 && naturalHeight === 2288 to avoid driving V1 pets.

The newer App no longer creates that <img>. It renders the same 1536×2288 PNG as a CSS background-image data URI on .codex-avatar-root. The feature and sprite version are unchanged, but the original probe cannot find its <img> evidence and therefore stops injection by design. This is a compatibility regression caused by the newer App rendering structure, not a defect that existed when #1455 was introduced.

Changes

  • Preserve legacy <img> V2 dimension detection for older App builds.
  • Detect CSS background-image PNG data URIs by reading only the Base64 header and parsing PNG IHDR dimensions, without decoding the full spritesheet.
  • Share the same V2 predicate between the capability probe and every coordinate update.
  • Continue accepting only 1536×2288 V2; reject 1536×1872 V1 and missing sprites safely.
  • Do not change feat: V2 桌宠跟随真实鼠标 / V2 pet real-mouse gaze #1455's settings entry, interaction priority, Windows-only scope, or user pet assets.

Verification

  • Live inspection on Codex App 26.707.8479.0: the CSS V2 spritesheet is detected and the injected runtime becomes healthy again.
  • cargo fmt --all -- --check
  • cargo test -q -p codex-plus-core --test cdp_bridge -j 2: 77/77 passed.
  • cargo check -q -p codex-plus-launcher -j 2
  • Execution-level Node harness covers CSS V2 accepted, legacy <img> V2 accepted, CSS V1 rejected, and missing sprite rejected.

@BigPizzaV3 BigPizzaV3 merged commit d8d66ec into BigPizzaV3:main Jul 13, 2026
3 checks passed
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