Skip to content

Commit 7e6995d

Browse files
author
Hermes
committed
fix(agent-core): allow benign session rewrites with different inode
Compaction rewrites session files via writeFile+rename, which always creates a new inode. Previously, sessionFenceRewriteIsBenign rejected such rewrites at the identity check (sameSessionFileIdentity), so the content validation that follows never ran, causing EmbeddedAttemptSessionTakeoverError false positives. This change removes the inode identity gate from sessionFenceRewriteIsBenign while preserving all content validation: file must exist, end with a newline, append only valid transcript lines. A file with a different inode but valid compaction-style content is indistinguishable from a compaction from the agent's perspective, so the inode check was both too strict and redundant with the content checks. Fixes EmbeddedAttemptSessionTakeoverError during concurrent compaction.
1 parent 2b61d38 commit 7e6995d

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

src/agents/embedded-agent-runner/run/attempt.session-lock.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ async function sessionFenceRewriteIsBenign(params: {
263263
!params.previous?.fingerprint.exists ||
264264
!params.current.exists ||
265265
!params.previous.text ||
266-
!sameSessionFileIdentity(params.previous.fingerprint, params.current) ||
267266
params.current.size > BigInt(MAX_BENIGN_SESSION_FENCE_REWRITE_RESULT_BYTES) ||
268267
params.current.size > MAX_SAFE_FILE_OFFSET
269268
) {

0 commit comments

Comments
 (0)