Skip to content

fix: apply wizard personality picker and identity persistence#30

Merged
cpaczek merged 1 commit into
cpaczek:mainfrom
escapables:fix/apply-wizard-personality-and-identity
Apr 3, 2026
Merged

fix: apply wizard personality picker and identity persistence#30
cpaczek merged 1 commit into
cpaczek:mainfrom
escapables:fix/apply-wizard-personality-and-identity

Conversation

@escapables

Copy link
Copy Markdown

Summary

  • Fix personality picker in TUI apply wizard ignoring user selection
  • Restore companion name/personality after binary re-patch (e.g. after Claude Code updates)

Bug 1: Personality picker ignores selection

src/tui/apply/index.ts:589 read activeSelect.selectedIndex — a setter-only property on OpenTUI's SelectRenderable with no corresponding getter. Reading it returns undefined, not the current index.

Since values[undefined] is undefined, the choice never matched 'keep' or 'default', falling through to the custom-input prompt. Pressing Enter without typing left personality unchanged.

Fix

- const idx = activeSelect.selectedIndex;
+ const idx = activeSelect.getSelectedIndex();

Bug 2: Name/personality lost after re-patch

After a Claude Code update resets the binary, the SessionStart hook (apply --silent) re-patches the salt but never restores the companion's custom name and personality from the saved profile. Claude Code regenerates the companion with defaults, and the user's choices are lost.

Fix

Added restoreProfileIdentity() in src/tui/commands/apply.ts — after every successful patch or salt verification, reads the active profile and writes name/personality back to the Claude config. Fails silently if the companion hasn't been hatched yet.

Test plan

  • pnpm run typecheck — pass
  • pnpm run lint — pass
  • pnpm run test — 203/203 pass
  • Manual test: applied a new buddy, confirmed personality selection works and persists

🤖 Generated with Claude Code

Two bugs in the apply flow:

1. Personality picker read `activeSelect.selectedIndex` (setter-only,
   returns undefined) instead of `getSelectedIndex()`. Selection was
   silently ignored.

2. `apply --silent` (SessionStart hook) re-patched the binary after
   Claude Code updates but never restored the companion's custom name
   and personality from the saved profile. They reverted to defaults.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cpaczek

cpaczek commented Apr 3, 2026

Copy link
Copy Markdown
Owner

@escapables thank you for PR merged

@cpaczek cpaczek merged commit e71648d into cpaczek:main Apr 3, 2026
7 checks passed
@escapables escapables deleted the fix/apply-wizard-personality-and-identity branch April 3, 2026 20:20
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