Skip to content

feat: personality system, chat agents, and first-launch onboarding#5

Merged
ByteMirror merged 14 commits intomainfrom
fabian.urbanek/memory
Feb 23, 2026
Merged

feat: personality system, chat agents, and first-launch onboarding#5
ByteMirror merged 14 commits intomainfrom
fabian.urbanek/memory

Conversation

@ByteMirror
Copy link
Copy Markdown
Owner

Summary

  • Personality system — OpenClaw-inspired SOUL.md / IDENTITY.md / USER.md files injected into every chat agent session via --append-system-prompt. Files live at ~/.hivemind/chats/<slug>/ and are never overwritten — user edits persist across sessions.
  • Chat sidebar tab — Two tabs ([ / ]) below the search bar: Code (existing behaviour, unchanged) and Chat (global, repo-independent). Chat agents share the coding memory at ~/.hivemind/memory/ so the assistant already knows what you've been building.
  • First-launch onboarding — On first run, a centered full-screen panel appears with no sidebar or chrome. A companion agent wakes up, discovers its own identity with the user in a natural conversation, writes its personality files, gives a tour of Hivemind, then calls onboarding_complete via Brain IPC to open the real UI.
  • New chat agent flow — Press n in the Chat tab to create a named chat agent. Only asks for a name (no repo/branch). Bootstrap ritual fires on first conversation.

Key files

File What it does
session/chat_storage.go GetChatsDir, EnsureAgentDir, ReadWorkspaceState, MarkBootstrapped
session/personality.go BuildSystemPrompt — assembles bootstrap or SOUL+IDENTITY+USER+memory
session/templates/ BOOTSTRAP.md, SOUL.md, IDENTITY.md, USER.md embedded templates
session/instance_lifecycle.go startChatAgent() — skips git worktree, injects personality
session/tmux/tmux.go AppendArgs field — passes --append-system-prompt as discrete exec arg (no shell injection)
app/app_onboarding.go startOnboarding(), viewOnboarding() — first-launch screen
ui/sidebar.go Code/Chat tab bar rendering
ui/tabbed_window.go SetChatMode — hides Diff/Git tabs for chat agents
brain/protocol.go + server.go onboarding_complete Brain IPC action
config/state.go Onboarded bool field + SetOnboarded()

Test plan

  • go test ./... passes (all 10 packages)
  • First launch (reset onboarded to false in ~/.hivemind/state.json) shows centered panel, no sidebar
  • Companion agent starts bootstrap conversation, writes IDENTITY.md + SOUL.md to ~/.hivemind/chats/companion/
  • After tour, companion calls onboarding_complete → full UI opens, companion visible in Chat tab
  • [ / ] switches between Code and Chat tabs in sidebar
  • n in Chat tab asks for name only → creates agent → bootstrap starts
  • Selecting a chat agent hides Diff and Git tabs in the tabbed window
  • Selecting a code agent restores all 4 tabs
  • ~/.hivemind/memory/ coding memories are accessible to chat agents

Captures the full design for OpenClaw-inspired agent personalities,
global chat section with sidebar tabs, bootstrap ritual, and first-launch
onboarding screen with Brain IPC transition.
11-task TDD plan covering chat storage, personality injection,
sidebar tabs, Brain IPC onboarding_complete, and first-launch
onboarding screen.
Introduces session/chat_storage.go with GetChatsDir, GetAgentPersonalityDir,
EnsureAgentDir, ReadWorkspaceState, and MarkBootstrapped for the chat
personality system. Exports config.AtomicWriteFile (was unexported) so the
session package can write files safely per project convention.
Embeds BOOTSTRAP.md, SOUL.md, IDENTITY.md, and USER.md into the session
package and adds CopyTemplatesToAgentDir to copy them into a new agent's
personality directory on first setup, skipping files that already exist
so user edits are never overwritten.
Adds IsChat (bool) and PersonalityDir (string) to Instance,
InstanceOptions, InstanceData, ToInstanceData, and FromInstanceData
so chat agents can be created and round-tripped through storage.
Adds session/personality.go with BuildSystemPrompt that assembles the
system prompt from SOUL.md, IDENTITY.md, USER.md and memory snippets
when bootstrapped, or BOOTSTRAP.md only when not yet bootstrapped.
Add AppendArgs to TmuxSession so arbitrary extra args can be passed
without shell injection. In Instance.Start(), short-circuit to
startChatAgent() when IsChat is true: reads workspace state, builds
the system prompt via BuildSystemPrompt, then starts Claude in the
personality directory with --append-system-prompt passed as a
discrete exec argument.
Add a two-tab bar (Code / Chat) below the search bar in the sidebar.
Active tab renders with underline+bright foreground; inactive renders
dimmed. [ and ] key bindings switch tabs when the app is in default
state. Introduces sidebarTab type in the app package and activeTab int
(plus SetTab/ActiveTab) in ui.Sidebar to avoid circular imports.
Adds the onboarding_complete IPC method so the companion agent can signal
the end of the bootstrap ritual, causing the TUI to persist onboarded=true
and transition back to stateDefault.
- ui/list.go: add chatFilter field and SetChatFilter(*bool) method applied in rebuildFilteredItems
- app/app.go: add visibleInstances() and refreshListChatFilter(); apply initial chat filter on startup
- app/app_input.go: call refreshListChatFilter + instanceChanged when sidebar tab switches
- app/app_state.go: call tabbedWindow.SetChatMode(selected.IsChat) in instanceChanged
- ui/tabbed_window.go: add chatMode bool field, SetChatMode(), visibleTabIndices() helper; update Toggle, ToggleWithReset, HandleTabClick, and String() to hide Diff/Git tabs for chat agents
When the user is in the Chat tab and presses `n`, a text input overlay
prompts for the agent name. On submit, slugify() converts it to a directory
slug, EnsureAgentDir/CopyTemplatesToAgentDir provision the personality dir,
and the agent is created with IsChat=true and started via the existing
instanceStartedMsg flow.
… panel

Add app/app_onboarding.go providing startOnboarding(), viewOnboarding(), and
onboardingStartedMsg — completing the stateOnboarding wiring that was already
partially committed in app.go and app_input.go (first-launch detection in
newHome(), Init() call, View() dispatch, key blocking, and onboardingContent
refresh in the previewTickMsg loop).
@ByteMirror ByteMirror merged commit 9624510 into main Feb 23, 2026
5 of 6 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.

1 participant