detect_code_skew
Function
This function is defined in the protocols module.Return shortened
(boot, disk) fingerprints if the code changed.
This is the pure, side-effect-free heart of the code-skew guard. It does
not read the filesystem or git; callers pass the fingerprint captured at
boot and a freshly-read on-disk fingerprint (see
:func:read_code_fingerprint).
The check is intentionally fail-open: if either fingerprint is unknown
(None / empty) it returns None so the caller proceeds normally and
never blocks an operation just because the revision could not be read.
Signature
Parameters
Optional[str]
required
Fingerprint captured when the gateway started.
Optional[str]
required
Fingerprint of the code currently on disk.
Returns
Optional[Tuple[str, str]]
…”“ fingerprint); other
fingerprints are returned unchanged.
Uses
fp.partition
Source
View on GitHub
praisonaiagents/gateway/protocols.py at line 4274
