@danypops/papyrus 0.27.4 → 0.27.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -39,14 +39,22 @@ import { callService } from "./service-client.ts";
|
|
|
39
39
|
|
|
40
40
|
/** Temporary RCA instrumentation for the live-observed duplicate-picker defect. Fire-and-forget: never lets a logging failure affect the actual ask. Remove once root-caused. */
|
|
41
41
|
const DIAG_SOURCE = "papyrus-discuss-ask-diag";
|
|
42
|
+
let diagSequence = 0;
|
|
42
43
|
function diag(message: string, fields?: Record<string, unknown>): void {
|
|
43
44
|
void callService("logs.append", {
|
|
44
45
|
source_id: DIAG_SOURCE,
|
|
45
46
|
source_label: "Discuss live-ask RCA",
|
|
46
47
|
level: "info",
|
|
47
48
|
message,
|
|
49
|
+
operation_id: `diag-${Date.now()}-${++diagSequence}`,
|
|
48
50
|
...(fields ? { fields } : {}),
|
|
49
|
-
}).catch(() => {
|
|
51
|
+
}).catch((error) => {
|
|
52
|
+
void callService("logs.append", {
|
|
53
|
+
source_id: DIAG_SOURCE, source_label: "Discuss live-ask RCA", level: "error",
|
|
54
|
+
message: `diag() itself failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
55
|
+
operation_id: `diag-error-${Date.now()}-${++diagSequence}`,
|
|
56
|
+
}).catch(() => {});
|
|
57
|
+
});
|
|
50
58
|
}
|
|
51
59
|
|
|
52
60
|
/** See pi-ask-user's identical safeMarkdownTheme() comment: a broken theme Proxy throws only on
|
package/package.json
CHANGED