memory-gateway-sync 0.6.0 → 0.7.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/package.json +1 -1
- package/src/index.ts +4 -3
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -46,11 +46,12 @@ export default definePluginEntry({
|
|
|
46
46
|
const defaultAgentId = cfg.agentId ?? "default";
|
|
47
47
|
const ownerClawUserId = (() => {
|
|
48
48
|
const token = process.env.OPENCLAW_GATEWAY_TOKEN ?? "";
|
|
49
|
-
// 格式: oc-user-{userId},用 - 切开取最后一段
|
|
50
49
|
const parts = token.split("-");
|
|
51
50
|
return parts.length >= 3 ? parts[parts.length - 1] : null;
|
|
52
51
|
})();
|
|
53
52
|
|
|
53
|
+
const podReleaseName = process.env.botID ?? null;
|
|
54
|
+
|
|
54
55
|
if (!gatewayUrl || !gatewayToken) {
|
|
55
56
|
api.logger.warn(
|
|
56
57
|
"memory-gateway-sync: gatewayUrl 或 gatewayToken 未配置,插件不启动"
|
|
@@ -152,7 +153,7 @@ export default definePluginEntry({
|
|
|
152
153
|
const payload: IngestPayload = {
|
|
153
154
|
path: relativePath,
|
|
154
155
|
content,
|
|
155
|
-
release_name: parseReleaseName(content),
|
|
156
|
+
release_name: parseReleaseName(content) ?? podReleaseName,
|
|
156
157
|
agentId: ws.agentId,
|
|
157
158
|
userId,
|
|
158
159
|
workspaceDir: ws.dir,
|
|
@@ -162,7 +163,7 @@ export default definePluginEntry({
|
|
|
162
163
|
|
|
163
164
|
try {
|
|
164
165
|
const controller = new AbortController();
|
|
165
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
166
|
+
const timeout = setTimeout(() => controller.abort(), 30000);
|
|
166
167
|
|
|
167
168
|
const res = await fetch(gatewayUrl, {
|
|
168
169
|
method: "POST",
|