@cocorograph/hub-agent 0.8.30 → 0.8.31
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.
- package/package.json +1 -1
- package/src/sibling-inject.mjs +14 -2
package/package.json
CHANGED
package/src/sibling-inject.mjs
CHANGED
|
@@ -76,9 +76,18 @@ export const DELEGATION_LEDGER_RETENTION_MS = 24 * 60 * 60 * 1000
|
|
|
76
76
|
|
|
77
77
|
const execFile = promisify(execFileCallback)
|
|
78
78
|
|
|
79
|
+
/**
|
|
80
|
+
* `ps` の起動時刻を送受信双方で比較する契約形へ正規化する。
|
|
81
|
+
* 先頭・末尾の Unicode 空白だけを除去し、日時本体の内部空白は変更しない。
|
|
82
|
+
* 正本は Hub の `codex_agent.py:_normalize_process_started_at`。
|
|
83
|
+
*/
|
|
84
|
+
export function normalizeProcessStartedAt(raw) {
|
|
85
|
+
return raw.trim()
|
|
86
|
+
}
|
|
87
|
+
|
|
79
88
|
async function defaultPidStartedAt(pid) {
|
|
80
89
|
const { stdout } = await execFile("ps", ["-o", "lstart=", "-p", String(pid)])
|
|
81
|
-
return stdout
|
|
90
|
+
return normalizeProcessStartedAt(stdout)
|
|
82
91
|
}
|
|
83
92
|
|
|
84
93
|
const DELIVERY_UNCONFIRMED_HINT =
|
|
@@ -352,7 +361,10 @@ export class SiblingInjectBridge {
|
|
|
352
361
|
if (err?.code !== "EPERM") return true
|
|
353
362
|
}
|
|
354
363
|
try {
|
|
355
|
-
return (
|
|
364
|
+
return (
|
|
365
|
+
normalizeProcessStartedAt(await this._pidStartedAt(event.pid)) ===
|
|
366
|
+
normalizeProcessStartedAt(event.pid_started_at)
|
|
367
|
+
)
|
|
356
368
|
} catch {
|
|
357
369
|
return true
|
|
358
370
|
}
|