fix: use math.MaxInt instead of 1<<31 to avoid 32-bit overflow

The build workflow cross-compiles for 32-bit targets (arm, mipsle)
where int is 32 bits and 1<<31 overflows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dj-oyu 2026-03-14 20:32:25 +09:00
parent c064e89c78
commit f285add786

View file

@ -1,6 +1,7 @@
package session
import (
"math"
"sync"
"time"
@ -397,7 +398,7 @@ func (la *LegacyAdapter) Save(key string) error {
if replaced {
// Full rewrite: compact all existing turns then write the whole history
if err := la.store.Compact(key, 1<<31, ""); err != nil {
if err := la.store.Compact(key, math.MaxInt, ""); err != nil {
return err
}