fix(wip): WIP - partial unify WeChat/H5 skill prompts (build agent changes)

- Reuse H5's buildAutoChatSkillPrefix in buildWechatAgentPrompt signature
- Inject autoSkillPrefix into voice/text message prompts
- Add origin tagging in GET /sessions for h5/wechat channel labels

Still TODO (will complete in next cycle):
- Full resolveGrantedSkills → buildWechatAgentPrompt flow
- ensureWechatAgentSession idle rotation logic
- setSessionOrigin + touchWechatAgentRoute calls
- Backend schema/migrations (h5_user_sessions origin column)
- Frontend type + UI component updates

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
john
2026-07-01 21:07:25 +08:00
parent 164c6627a0
commit ec375b1402
2 changed files with 30 additions and 3 deletions
+10
View File
@@ -1164,6 +1164,16 @@ export function createTkmindProxy({
const sessions = [...sessionsById.values()].sort(sortSessionsByRecent);
await enrichSessionHistory(sessions);
if (typeof userAuth.getSessionOrigins === 'function' && sessions.length > 0) {
try {
const origins = await userAuth.getSessionOrigins(sessions.map((s) => s.id));
for (const session of sessions) {
session.origin = origins.get(session.id) ?? 'h5';
}
} catch {
// leave sessions untagged on lookup failure
}
}
const summaries = sessions.map(projectSessionSummary).filter((item) => matchesSessionQuery(item, query));
const paged = summaries.slice(offset, offset + limit);
res.json({