Include full contents of all nested repositories
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
25
openclaw/src/agents/announce-idempotency.ts
Normal file
25
openclaw/src/agents/announce-idempotency.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
export type AnnounceIdFromChildRunParams = {
|
||||
childSessionKey: string;
|
||||
childRunId: string;
|
||||
};
|
||||
|
||||
export function buildAnnounceIdFromChildRun(params: AnnounceIdFromChildRunParams): string {
|
||||
return `v1:${params.childSessionKey}:${params.childRunId}`;
|
||||
}
|
||||
|
||||
export function buildAnnounceIdempotencyKey(announceId: string): string {
|
||||
return `announce:${announceId}`;
|
||||
}
|
||||
|
||||
export function resolveQueueAnnounceId(params: {
|
||||
announceId?: string;
|
||||
sessionKey: string;
|
||||
enqueuedAt: number;
|
||||
}): string {
|
||||
const announceId = params.announceId?.trim();
|
||||
if (announceId) {
|
||||
return announceId;
|
||||
}
|
||||
// Backward-compatible fallback for queue items that predate announceId.
|
||||
return `legacy:${params.sessionKey}:${params.enqueuedAt}`;
|
||||
}
|
||||
Reference in New Issue
Block a user