Files
openclaw/src/gateway/server-shared.ts
Peter Steinberger 1bcc4c5e70 feat(gateway): add cooperative host suspension (#103618)
* feat(gateway): add cooperative suspension preparation

* style: satisfy suspension lint checks

* test(gateway): reset work admission between shared suites

* fix(gateway): reject upgrades during suspension

* fix(gateway): preserve admitted work during suspension

* test(gateway): isolate suspension and restart state

* fix(gateway): close suspension false-ready gaps

* refactor(protocol): slim suspension declaration graph

* refactor(plugin-sdk): sever protocol registry edges

* fix(gateway): preserve admitted restart follow-ups

* fix(gateway): make suspension recovery fail closed

* fix(protocol): keep validation formatter re-export only

* test(gateway): simplify deferred fixture type

* style(gateway): clarify suspension entry name

* fix(gateway): retain detached work admission
2026-07-10 20:24:53 +01:00

19 lines
639 B
TypeScript

// Gateway shared request-state types.
// Defines cached dedupe entries for idempotent Gateway method calls.
import type { ErrorShape } from "../../packages/gateway-protocol/src/schema/frames.js";
export const PENDING_CHAT_SEND_DEDUPE_PREFIX = "pending-chat:";
export function pendingChatSendDedupeKey(runId: string): string {
return `${PENDING_CHAT_SEND_DEDUPE_PREFIX}${runId}`;
}
// Dedupe entries cache recent request results so repeated gateway calls can
// replay the same success/error payload without re-running the method.
export type DedupeEntry = {
ts: number;
ok: boolean;
payload?: unknown;
error?: ErrorShape;
};