Skip to content

Commit 4bcfcc0

Browse files
committed
[skills] Fix REVIEW-MEDIUM-3: include import_key in both POST payloads
Why: buildImportKey was computed but never transmitted, so the ingest endpoint had no way to de-dupe when a retry raced with a belated success from the original request — exactly the failure mode retries create. Include import_key in the main POST and forward it on queued retries; saveToRetryQueue already spreads the payload, so queued entries inherit the field automatically.
1 parent 445b47b commit 4bcfcc0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

skills/auto-capture-claude-code/session-end-capture.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ async function processRetryQueue(ingestUrl, mcpKey) {
246246
source_label: entry.source_label,
247247
source_type: entry.source_type,
248248
auto_execute: entry.auto_execute ?? true,
249+
// Forward the same import_key the main POST used, so a retry that
250+
// races with a belated success from the original request is
251+
// de-duped by the ingest endpoint instead of creating a second
252+
// thought. Entries written before this field existed simply omit it.
253+
...(entry.import_key ? { import_key: entry.import_key } : {}),
249254
}),
250255
});
251256

@@ -343,6 +348,9 @@ async function main() {
343348
source_label: `claude_code:${projectName}`,
344349
source_type: "claude_code_ambient",
345350
auto_execute: true,
351+
// import_key lets the ingest endpoint de-dupe when a retry races with a
352+
// belated success from the original POST (common on flaky networks).
353+
import_key: importKey,
346354
};
347355

348356
try {

0 commit comments

Comments
 (0)