Skip to content

feat: add personality module with IDENTITY.md / SOUL.md / USER.md support#4355

Open
HHHEEEWWW wants to merge 5 commits into
esengine:main-v2from
HHHEEEWWW:fix-add-personality-conflict
Open

feat: add personality module with IDENTITY.md / SOUL.md / USER.md support#4355
HHHEEEWWW wants to merge 5 commits into
esengine:main-v2from
HHHEEEWWW:fix-add-personality-conflict

Conversation

@HHHEEEWWW

Copy link
Copy Markdown
Contributor

新增:人格模块(Personality Module)

为 Reasonix 增加完整的人格模块,允许用户通过三个 Markdown 文件(IDENTITY.md、SOUL.md、USER.md)自定义 Agent 的身份认同、行为风格和用户认知。

架构

.reasonix/personality/
├── IDENTITY.md   → 注入 === IDENTITY ===  → 定义 Agent 身份、信念、价值观
├── SOUL.md       → 注入 === SOUL ===       → 定义沟通风格、情绪语气、行为特征
└── USER.md       → 注入 === USER ===       → 定义用户角色、偏好、上下文

后端(Go)

  • internal/personality/ — 新包,提供 Load()、Compose()、ReadFile/WriteFile/DeleteFile、List、ProjectDirs
  • internal/config/config.go — 新增 PersonalityConfig(Enabled bool)字段,PersonalityEnabled() 方法
  • internal/boot/boot.go — 在 output style 之后、memory/skills 之前加载人格,默认关闭
  • desktop/settings_app.go — 新增 5 个绑定方法
  • reasonix.example.toml — 添加 [personality] 配置示例

前端(TypeScript/React)

  • Settings 新增 Personality 选项卡 — 开关人格模块、切换编辑三个文件、保存/删除
  • types.ts — 新增 PersonalityFileView、PersonalitySettingsView 接口,SettingsTab 加入 personality
  • bridge.ts — 5 个新方法签名 + 完整 mock 实现
  • 三语 locale — en/zh/zh-TW 已同步

附带修复

  • ErrorBoundary.tsx — 崩溃时不再返回 null(白屏),改为显示具体错误信息和堆栈

向后兼容

  • [personality] enabled = false 默认关闭,不改变任何现有行为
  • 新包不导入原有代码,零侵入

改动文件

类型 文件
🆕 internal/personality/personality.go
🆕 internal/personality/personality_test.go
🆕 docs/personality-templates/*
✏️ internal/config/config.go
✏️ internal/boot/boot.go
✏️ desktop/settings_app.go
✏️ desktop/frontend/src/lib/types.ts
✏️ desktop/frontend/src/lib/bridge.ts
✏️ desktop/frontend/src/components/SettingsPanel.tsx
✏️ desktop/frontend/src/components/ErrorBoundary.tsx
✏️ desktop/frontend/src/locales/en.ts
✏️ desktop/frontend/src/locales/zh.ts
✏️ desktop/frontend/src/locales/zh-TW.ts
✏️ reasonix.example.toml

…port

Add a personality module that loads three markdown files (IDENTITY.md,
SOUL.md, USER.md) from .reasonix/personality/ and folds them into the
system prompt to shape the agent's identity, behaviour, and user awareness.

Backend (Go):
- New internal/personality/ package: Load, Compose, ReadFile, WriteFile,
  DeleteFile, List, ProjectDirs
- PersonalityConfig with Enabled toggle in config.Config
- Integrated in boot.go: loads personality after output style, before
  memory/skills, when [personality] enabled = true
- Desktop settings API: 5 new bound methods
- Default: disabled (backward compatible)

Frontend (TypeScript/React):
- New 'personality' tab in SettingsPanel with enable toggle and
  three-file editor (IDENTITY.md / SOUL.md / USER.md)
- PersonalityFileView and PersonalitySettingsView types
- Full bridge bindings + mock implementation for browser dev mode
- Locale keys added to en.ts, zh.ts, zh-TW.ts

Change: ErrorBoundary now renders crash details instead of null
(blank page) for easier debugging.

Template examples in docs/personality-templates/.
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) config Configuration & setup (internal/config) labels Jun 14, 2026
user and others added 2 commits June 14, 2026 12:48
- Run gofmt -w on desktop/settings_app.go, internal/boot/boot.go,
  internal/config/config.go to fix formatting
- Change Load() to first-wins (project overrides home dir)
- Fix tests to be Windows-path agnostic (use filepath.Join, HasPrefix,
  HasSuffix instead of hardcoded / separators)
- Update Load() doc comment to reflect first-wins behavior
@HHHEEEWWW HHHEEEWWW closed this Jun 14, 2026
@HHHEEEWWW HHHEEEWWW reopened this Jun 14, 2026
@HHHEEEWWW

Copy link
Copy Markdown
Contributor Author

Sorry, I messed up and I don't know what happened. It prompted me that there was a conflict between the two versions, and GitHub couldn't verify which one was accurate. So I merged the two, which resulted in many CI validation failures. The first version that passed validation was the most direct, clear, and pure version I submitted. I hope to adopt some of the code and have the repository developer add this agent soul feature to give the agent a soul and emotion.

@HHHEEEWWW

Copy link
Copy Markdown
Contributor Author

so,who can help me complete this compare

@github-actions github-actions Bot added tui Terminal UI / CLI (internal/cli, internal/control) skills Skill system (internal/skill, internal/tool) agent Core agent loop (internal/agent, internal/control) mcp MCP servers / plugins (internal/plugin, codegraph) labels Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Core agent loop (internal/agent, internal/control) config Configuration & setup (internal/config) desktop Wails desktop app (desktop/**) mcp MCP servers / plugins (internal/plugin, codegraph) skills Skill system (internal/skill, internal/tool) tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant