Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(calibration): bind undo-wave take ids as numbers so Postgres accepts the bigint[] parameter

garrytan458af4d87509
diff --git a/src/core/calibration/undo-wave.ts b/src/core/calibration/undo-wave.ts
index af2b0e211b..c7412b7bb5 100644
--- a/src/core/calibration/undo-wave.ts
+++ b/src/core/calibration/undo-wave.ts
@@ -107,7 +107,8 @@ export async function undoWave(
WHERE wave_version = $1 AND applied = true`,
[waveVersion],
);
- const targetTakeIds = targetTakeRows.map(r => r.take_id);
+ // Postgres returns bigint ids as BigInt, which a `$1::bigint[]` parameter cannot bind.
+ const targetTakeIds = targetTakeRows.map(r => Number(r.take_id));
if (targetTakeIds.length > 0) {
if (dryRun) {