Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/hooks/session-end.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function main() {
method: "POST",
headers: authHeaders(),
body: JSON.stringify({ sessionId }),
signal: AbortSignal.timeout(5000),
signal: AbortSignal.timeout(30000), // Increased from 5s
});
} catch {
// best-effort
Expand All @@ -49,7 +49,7 @@ async function main() {
method: "POST",
headers: authHeaders(),
body: JSON.stringify({ olderThanDays: 0 }),
signal: AbortSignal.timeout(15000),
signal: AbortSignal.timeout(60000), // Increased from 15s
});
} catch {}

Expand All @@ -58,7 +58,7 @@ async function main() {
method: "POST",
headers: authHeaders(),
body: JSON.stringify({ tier: "all", force: true }),
signal: AbortSignal.timeout(30000),
signal: AbortSignal.timeout(120000), // Increased from 30s
});
} catch {}
}
Expand All @@ -68,12 +68,12 @@ async function main() {
await fetch(`${REST_URL}/agentmemory/claude-bridge/sync`, {
method: "POST",
headers: authHeaders(),
signal: AbortSignal.timeout(5000),
signal: AbortSignal.timeout(30000), // Increased from 5s
});
} catch {
// best-effort
}
}
}

main();
main();
4 changes: 2 additions & 2 deletions src/hooks/stop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ async function main() {
method: "POST",
headers: authHeaders(),
body: JSON.stringify({ sessionId }),
signal: AbortSignal.timeout(30000),
signal: AbortSignal.timeout(120000), // Increased from 30s to 120s
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Drop the inline change-history comment on this timeout line.

Use a named constant if you want the value to be self-documenting.

As per coding guidelines, "Avoid code comments explaining WHAT — use clear naming instead."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/hooks/stop.ts` at line 47, Remove the inline change-history comment and
replace the magic number passed to AbortSignal.timeout with a named constant
(e.g., STOP_TIMEOUT_MS or STOP_SIGNAL_TIMEOUT) declared near the top of the
module; update the call site from AbortSignal.timeout(120000) to
AbortSignal.timeout(STOP_TIMEOUT_MS) so the timeout value is self-documenting
and the comment is no longer needed.

});
} catch {
// summarize is best-effort
}
}

main();
main();
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ async function main() {

const sdk = registerWorker(config.engineUrl, {
workerName: "agentmemory",
invocationTimeoutMs: 180000,
otel: {
serviceName: OTEL_CONFIG.serviceName,
serviceVersion: OTEL_CONFIG.serviceVersion,
Expand Down