@adhdev/daemon-core 0.8.39 → 0.8.40
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/index.js +1 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -10
- package/dist/index.mjs.map +1 -1
- package/node_modules/@adhdev/session-host-core/package.json +1 -1
- package/package.json +1 -1
- package/src/commands/chat-commands.ts +3 -8
- package/src/config/chat-history.ts +4 -2
package/package.json
CHANGED
|
@@ -500,16 +500,11 @@ export async function handleSendChat(h: CommandHelpers, args: any): Promise<Comm
|
|
|
500
500
|
const provider = h.getProvider(args?.agentType);
|
|
501
501
|
const transport = getTargetTransport(h, provider);
|
|
502
502
|
const dedupeKey = buildRecentSendKey(h, args, provider, text);
|
|
503
|
-
const historySessionId = getHistorySessionId(h, args);
|
|
504
503
|
|
|
505
504
|
const _logSendSuccess = (method: string, targetAgent?: string) => {
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
undefined, // title
|
|
510
|
-
args?.targetSessionId,
|
|
511
|
-
historySessionId,
|
|
512
|
-
);
|
|
505
|
+
// Sending and transcript persistence are intentionally decoupled.
|
|
506
|
+
// User turns should reach history through read_chat/runtime transcript sync,
|
|
507
|
+
// not by eagerly appending the outgoing input here.
|
|
513
508
|
return { success: true, sent: true, method, targetAgent };
|
|
514
509
|
};
|
|
515
510
|
|
|
@@ -217,9 +217,11 @@ export class ChatHistoryWriter {
|
|
|
217
217
|
const lines = newMessages.map(m => JSON.stringify(m)).join('\n') + '\n';
|
|
218
218
|
fs.appendFileSync(filePath, lines, 'utf-8');
|
|
219
219
|
|
|
220
|
-
// Detect session switch —
|
|
220
|
+
// Detect session switch — only for unstable runtime-only histories.
|
|
221
|
+
// When we have a persistent history session key, replayed read_chat payloads
|
|
222
|
+
// must not clear dedupe state or old turns can be appended again.
|
|
221
223
|
const prevCount = this.lastSeenCounts.get(dedupKey) || 0;
|
|
222
|
-
if (messages.length < prevCount * 0.5 && prevCount > 3) {
|
|
224
|
+
if (!historySessionId && messages.length < prevCount * 0.5 && prevCount > 3) {
|
|
223
225
|
seenHashes.clear();
|
|
224
226
|
this.lastSeenSignatures.delete(dedupKey);
|
|
225
227
|
this.lastSeenTurnSignatures.delete(dedupKey);
|