@aiwayds/dsh-topics-memory 0.20.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/tools.ts CHANGED
@@ -116,8 +116,12 @@ export function buildTopicTools(service: TopicsService) {
116
116
  },
117
117
  ],
118
118
  },
119
- async execute(args) {
120
- return await service.openTopic(args.slug)
119
+ async execute(args, exec) {
120
+ // The agent handle on the run context IS the session (Agent.id is the
121
+ // session id — the same key the injection records use). Absent in
122
+ // bare test/host contexts: attribution then degrades to 'search'.
123
+ const sessionId = exec?.agent !== undefined ? String(exec.agent.id) : undefined
124
+ return await service.openTopic(args.slug, sessionId)
121
125
  },
122
126
  })
123
127