mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:50:42 +00:00
fix: use transport activity for stale health
This commit is contained in:
@@ -34,4 +34,16 @@ describe("projectSafeChannelAccountSnapshotFields", () => {
|
||||
baseUrl: "https://chat.example.test/",
|
||||
});
|
||||
});
|
||||
|
||||
it("preserves non-secret transport liveness timestamps", () => {
|
||||
const snapshot = projectSafeChannelAccountSnapshotFields({
|
||||
lastInboundAt: 123,
|
||||
lastTransportActivityAt: 456,
|
||||
});
|
||||
|
||||
expect(snapshot).toEqual({
|
||||
lastInboundAt: 123,
|
||||
lastTransportActivityAt: 456,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -186,6 +186,9 @@ export function projectSafeChannelAccountSnapshotFields(
|
||||
...(readNumber(record, "lastInboundAt") !== undefined
|
||||
? { lastInboundAt: readNumber(record, "lastInboundAt") }
|
||||
: {}),
|
||||
...(readNumber(record, "lastTransportActivityAt") !== undefined
|
||||
? { lastTransportActivityAt: readNumber(record, "lastTransportActivityAt") }
|
||||
: {}),
|
||||
...(healthState ? { healthState } : {}),
|
||||
...(mode ? { mode } : {}),
|
||||
...(dmPolicy ? { dmPolicy } : {}),
|
||||
|
||||
@@ -172,9 +172,6 @@ export type ChannelGroupAdapter = {
|
||||
|
||||
export type ChannelStatusAdapter<ResolvedAccount, Probe = unknown, Audit = unknown> = {
|
||||
defaultRuntime?: ChannelAccountSnapshot;
|
||||
skipStaleSocketHealthCheck?: boolean;
|
||||
/** Runtime `mode` values where `lastEventAt` can prove connected socket liveness. */
|
||||
staleSocketHealthCheckModes?: readonly string[];
|
||||
buildChannelSummary?: BivariantCallback<
|
||||
(params: {
|
||||
account: ResolvedAccount;
|
||||
|
||||
@@ -199,6 +199,7 @@ export type ChannelAccountSnapshot = {
|
||||
| null;
|
||||
lastMessageAt?: number | null;
|
||||
lastEventAt?: number | null;
|
||||
lastTransportActivityAt?: number | null;
|
||||
lastError?: string | null;
|
||||
healthState?: string;
|
||||
lastStartAt?: number | null;
|
||||
|
||||
Reference in New Issue
Block a user