akemon 0.1.27 → 0.1.28
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/dist/server.js +16 -4
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -840,7 +840,7 @@ async function startSelfCycle(options) {
|
|
|
840
840
|
if (jsonMatch) {
|
|
841
841
|
try {
|
|
842
842
|
const parsed = JSON.parse(jsonMatch[0]);
|
|
843
|
-
if (parsed.who && parsed.where) {
|
|
843
|
+
if (parsed.who && parsed.where && parsed.who.length > 5 && parsed.who !== "...") {
|
|
844
844
|
await appendIdentity(workdir, agentName, parsed);
|
|
845
845
|
console.log(`[self] Identity updated: "${parsed.who.slice(0, 60)}..."`);
|
|
846
846
|
// Update bio mood from reflection
|
|
@@ -918,14 +918,26 @@ Requirements:
|
|
|
918
918
|
catch (err) {
|
|
919
919
|
console.log(`[self] Profile design failed: ${err.message}`);
|
|
920
920
|
}
|
|
921
|
-
// Push consciousness data to relay
|
|
921
|
+
// Push consciousness data to relay — validate before sending
|
|
922
922
|
if (options.relayHttp && options.secretKey) {
|
|
923
|
+
// Filter out engine log noise and placeholder values
|
|
924
|
+
const isValid = (s) => s && s.length > 3 && !s.startsWith("Reading prompt") && !s.startsWith("OpenAI") && !s.startsWith("mcp startup") && s !== "...";
|
|
925
|
+
const cleanIntro = isValid(profileIdentity?.who || "") ? profileIdentity.who : "";
|
|
926
|
+
// For canvas, read from saved file (local is clean) instead of raw engine output
|
|
927
|
+
let cleanCanvas = "";
|
|
928
|
+
try {
|
|
929
|
+
const canvasEntries = await loadRecentCanvasEntries(workdir, agentName, 1);
|
|
930
|
+
if (canvasEntries.length > 0 && isValid(canvasEntries[0].content)) {
|
|
931
|
+
cleanCanvas = canvasEntries[0].content;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
catch { }
|
|
923
935
|
fetch(`${options.relayHttp}/v1/agent/${encodeURIComponent(agentName)}/self`, {
|
|
924
936
|
method: "POST",
|
|
925
937
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${options.secretKey}` },
|
|
926
938
|
body: JSON.stringify({
|
|
927
|
-
self_intro:
|
|
928
|
-
canvas:
|
|
939
|
+
self_intro: cleanIntro,
|
|
940
|
+
canvas: cleanCanvas,
|
|
929
941
|
mood: profileBio.mood,
|
|
930
942
|
profile_html: profileHTML || "",
|
|
931
943
|
}),
|