Skip to content

feat(profile-helper): align helper runtime with standalone flow#2

Merged
FZR95 merged 1 commit intoTashanGKD:mainfrom
zhang2023-byte:main
Mar 8, 2026
Merged

feat(profile-helper): align helper runtime with standalone flow#2
FZR95 merged 1 commit intoTashanGKD:mainfrom
zhang2023-byte:main

Conversation

@zhang2023-byte
Copy link
Contributor

@zhang2023-byte zhang2023-byte commented Mar 8, 2026

Adopt the standalone profile helper's interaction and auto-save behavior while keeping Topic-Lab's existing API boundaries and module structure intact.

Made-with: Cursor

Change Type

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / optimization
  • Other

Description

Related Issue

Checklist

  • Unit tests pass: pytest -q -m "not integration"
  • If touching AgentSDK call paths, ran locally with real .env: bash scripts/ci_local.sh
  • Updated relevant docs (if applicable)
  • Follows project code style

总览

这次改造把 tashan-profile-helper 的核心能力迁进了 TopicLab 的 /profile-helper 模块,目标是“交互逻辑和自动保存完全对齐 helper”,同时尽量不动 TopicLab 的页面壳、API 形状和角色库链路。

最终产出分成两部分,且都已推送:

后端变更

后端主要集中在 profile_helper 模块内部,保持了 TopicLab 现有 /profile-helper/* API 不变,但把运行语义切到了 helper 风格。

核心变化:

  • sessions.py 从“仅内存会话”升级为“内存会话 + 文件自动落盘”。
  • AI 在调用 write_profile / write_forum_profile 时,会立即把画像和论坛分身写入磁盘,而不再只是留在内存里。
  • 落盘目录通过配置层统一管理,避免把路径硬编码到业务代码里。
  • agent.py 的工具调用语义改成与 helper 一致,真正使用保存函数完成自动写入。
  • prompts.py 对齐了 helper 的对话规则,包括:
    • 先读画像再执行任务
    • 边采集边保存
    • AI 记忆导入与论坛分身生成的行为约束
  • tools.py 做了模块化资源解析,优先读取 helper 风格的 skills/docs/template,同时保留 TopicLab 自带资源作为兜底。
  • backend/libs/profile_helper/ 下的模板和关键 skill/doc 文案已同步到 helper 语义,减少运行时规则漂移。

效果上,后端现在已经更接近独立的 tashan-profile-helper,但仍然挂在 Resonnet/TopicLab 既有框架里。

前端变更

前端改动集中在 frontend/src/modules/profile-helper/,没有扩散到 TopicLab 其他页面。

主要调整:

  • ChatWindow.tsx 的欢迎语、视图命名、入口文案改为 helper 风格。
  • 保留了 TopicLab 原有增强项:
    • 模型选择
    • 一键导入 Topic-Lab 角色库
  • 本地 session key 做了兼容处理,同时兼容 helper 和 TopicLab 旧 key,避免已有会话直接失效。
  • ProfilePanel.tsx 的展示名称和隐私说明改为 helper 的表述方式:
    • “科研数字分身”
    • “他山论坛分身”
    • 更完整的平台内使用与可见性说明

子模块与仓库调整

为了能正常推送并保证别人拉代码不出错,我还补了一个必要的工程性调整:

  • Tashan-TopicLab.gitmodules 已从上游 TashanGKD/Resonnet 改到你的 fork zhang2023-byte/Resonnet

这样主仓库里的 backend 子模块指针会指向你有权限且已经包含本次改动的远程仓库,避免主仓库引用一个不存在于你远程中的子模块提交。

验证情况

已完成的检查:

  • Python 文件通过 py_compile
  • 前端通过 npm exec tsc --noEmit
  • IDE 诊断未发现新增 lint 问题

未完成的部分:

  • 没有直接跑完整 pytest,因为当前环境缺少 pytest / uv 命令

对应提交

  • Resonnetf7b6513 feat(profile-helper): align helper runtime with standalone flow
  • Tashan-TopicLab9526304 feat(profile-helper): sync Topic-Lab shell with helper replacement
  • Tashan-TopicLab964fa56 chore(submodule): point backend to personal Resonnet fork

Adopt the standalone profile helper's interaction and auto-save behavior while keeping Topic-Lab's existing API boundaries and module structure intact.

Made-with: Cursor
Copy link
Contributor

@FZR95 FZR95 left a comment

Choose a reason for hiding this comment

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

lgtm

@FZR95 FZR95 merged commit 87fffbc into TashanGKD:main Mar 8, 2026
4 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