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:
parent
c064e89c78
commit
f285add786
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue