Skip to content

feat(stage): add character-owned Live2D controls - #2458

Open
nekomeowww wants to merge 1 commit into
mainfrom
nekomeowww/feat/live2d-avatar-controls
Open

feat(stage): add character-owned Live2D controls#2458
nekomeowww wants to merge 1 commit into
mainfrom
nekomeowww/feat/live2d-avatar-controls

Conversation

@nekomeowww

@nekomeowww nekomeowww commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Add Character-owned Avatar Model references and keep the active model synchronized across Electron windows.
  • Discover Live2D expressions and motions, register enabled controls, and add them to the ACT prompt.
  • Add expression cards with AIRI visibility switches, preview controls, metadata, and timed expression reset support.

Testing

  • pnpm typecheck
  • pnpm lint (passes with 10 existing warnings)
  • pnpm -F @proj-airi/stage-ui-live2d exec vitest run
  • pnpm -F @proj-airi/stage-ui exec vitest run src/stores/modules/airi-card.test.ts src/stores/modules/airi-card.browser.test.ts src/stores/live2d.browser.test.ts src/constants/prompts/live2d-act.test.ts
  • pnpm -F @proj-airi/pipelines-audio exec vitest run src/llm-streaming-control/payloads.test.ts
  • pnpm -F @proj-airi/scenarios-stage-tamagotchi-electron exec vitest run src/scenarios/display-model-from-file.test.ts
  • pnpm build:tamagotchi
  • Vishot Electron capture with the Iru v2.0 Live2D archive

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T12:35:37.940800Z e53a8a6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

⏳ Approval required for deploying to Cloudflare Workers (Preview) for stage-web.

Name Link
🔭 Waiting for approval For maintainers, approve here

Hey, maintainers, kindly take some time to review and approve this deployment when you are available. Thank you! 🙏

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e53a8a6db0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +300 to +302
// TODO: Remove this bridge after Character creation and import paths write
// the Avatar Model reference and default ID without modules.displayModelId.
async function ensureCharacterDefaultAvatarModelFromDisplayModel(characterId: string) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove the temporary display-model compatibility bridge

This function is explicitly a backward-compatibility bridge from modules.displayModelId, which keeps the old and new ownership models active at the same time and violates the repository rule against adding compatibility guards. Update the creation and import paths to write the avatar-model reference directly, and use the required documented refactor process if old stored data must remain supported.

AGENTS.md reference: AGENTS.md:L109-L110

Useful? React with 👍 / 👎.

Comment on lines +15 to +17
// The active Character owns the durable Avatar Model references. This store
// only replicates the current runtime selection between renderer windows.
const selected = shallowRef('')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Repoint character state when deleting models

When the active Character uses an imported model, deleteAllModels() in use-data-maintenance.ts deletes that resource and writes only settingsStore.stageModelSelected = 'preset-live2d-1'. Now that this selection store is runtime-only, the durable defaultAvatarModelId still points to the deleted model; activating the Character again or restarting selects the missing resource and disables the renderer. The deletion flow must update or clear the Character-owned reference, which is now the persistence owner.

AGENTS.md reference: AGENTS.md:L234-L235

Useful? React with 👍 / 👎.


const nextAppliedExpressionNames = new Set<string>()
for (const name of desiredExpressionNames) {
if (appliedExpressionNames.has(name) || live2d.expressions.setActive(name, true).success)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reapply remaining previews after removing an expression

When two previewed expressions modify the same Live2D parameter, removing either one resets its parameters to model defaults in the preceding loop. This short-circuit then treats the other expression as already applied, so it is not re-applied and remains checked in the UI while its shared parameter is visually inactive. Recompute the parameter state from all desired expressions, or reapply every remaining expression after removals.

Useful? React with 👍 / 👎.

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.

1 participant